简体   繁体   English

Visual Studio Advanced CSS格式从紧凑扩展到扩展

[英]Visual Studio Advanced CSS Formatting Beyond Compact to Expanded

I've been trying find a way to format my css when in Visual Studio 我一直在尝试寻找在Visual Studio中格式化CSS的方法

It appears there are only: 看来只有:

Compact: 紧凑:

.class {style: style;}

Semi Expanded: 半展开:

.class{
    style: style;
}

Expanded: 展开:

.class
{
    style: style;
}

If you format as compact, you get something like: 如果将格式格式化为紧凑格式,则会得到以下内容:

.class-one {style: style;}

.class-two {style: style; style: style; style: style;}

.class-two:after {style: style; style: style;}

One thing I am trying to remove is the blank line between the css. 我要删除的一件事是CSS之间的空白行。

Also I was hoping that there is a way to add tabs after the selector. 我也希望有一种方法可以在选择器之后添加标签。 Lets say I want a selector then 5 tabs before the opening { 可以说我想要一个选择器,然后在打开{之前添加5个标签

.class-one               {style: style;}
.class-two               {style: style;style: style;style: style;}
.class-two:after         {style: style;style: style;}

If anyone knows of a way to change it and save it as a preset that would be nice. 如果有人知道一种更改方式并将其保存为预设的方法,那将是不错的选择。 If there isn't that's ok too. 如果没有,那也没关系。 It wouldn't be the end of the world. 这不会是世界的尽头。

Thanks! 谢谢!

I am using ReSharper plugin, different formatting options available 我正在使用ReSharper插件,提供了不同的格式选项

View Here 在这里查看

To apply Code Cleanup at the current file -> Choose ReSharper | 要在当前文件上应用代码清除->选择ReSharper | Tools | 工具| Cleanup Code 清理代码

http://www.jetbrains.com/resharper/ http://www.jetbrains.com/resharper/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM