有人可以通过调整beautifyrc文件的设置来帮助我解决如何在每个CSS块之后(在大括号后)添加新的空格吗?
SCSS问题:
.return-btn {
background-color: #ACE514 !important;
border: 0;
border-bottom: 3px solid #1F8619 !important;
border-radius: 0;
font-size: 18px;
margin: 50px 0 50px 0;
}
.return-btn:hover {
background-color: #ACE514 !important;
border-bottom: 3px solid #1F8619 !important;
}
美化我的.scss时,我要在“ .return-btn”的右括号后加上一个新的空格。
我当前在default.jsbeautifyrc中的设置:
{
"js": {
"eol": "\n",
"preserve_newlines": true,
"max_preserve_newlines": 10,
"space_after_anon_function": true,
"brace_style": "collapse",
"keep_array_indentation": true,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"wrap_attributes": "auto",
"end_with_newline": true,
"comma_first": false
},
"css": {
"allowed_file_extensions": ["css", "scss", "sass", "less"],
"eol": "\\n",
"end_with_newline": true,
"selector_separator_newline": true,
"newline_between_rules": true,
"smartIndent": false,
"indent_char": " ",
"indent_size": 2,
"selector_separator": " "
},
"html": {
"eol": "\n",
"end_with_newline": true,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"indent_inner_html": false,
"brace_style": "collapse",
"indent_scripts": "normal",
"wrap_line_length": 0,
"wrap_attributes": "auto"
}
}
当我格式化输出的css文件本身时,在每个右花括号后添加换行符,但不在scss文件中。
最佳答案
似乎该功能现在不可用且已被请求,请参阅newline_between_rules support for Sass (enhancement)以获取更多信息。
关于css - Beautifyrc SCSS在关闭花括号后添加新的白线,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39436307/