- 2 spaces - for indentation
- One rule per line
- Space between rules and brackets
Good
.rule {
color: #fff;
}
.block,
.item {
padding: 1em;
}Bad
.rule{
color: #fff;
}
.rule{ background-color: red; }
.block, .item{
padding: 1em;
}
Create the file .editorconfig and insert at project root folder.
[*.{css}]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Those approaches are always welcome: