-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I separate class style by comma in build css file? #2408
Comments
Why do you expect the style rule to be split into two? |
I use sass for custom css render which does not support many comma in one line. So I want split them. Can I write my custom function to handle this? |
I use sass In Drupal and using multiple selectors in a single line does not match Drupal coding standards: https://www.drupal.org/docs/develop/standards/css/css-formatting-guidelines#format Example:SASS
CSSCurrent behavior (expanded output style)
Expected CSS (required by Drupal coding standards)
Also if to compile CSS for HTML emails, the length of the string becomes really important. |
You could write a mixin: @mixin split-rules($selector) {
@each $complex in selector-parse($selector) {
#{$complex} {
@content;
}
}
}
.class-a {
color: red;
@include split-rules(".child-a, .child-b") {
color: blue;
}
} @vaza18 Sass does its best to generate nice-looking output, but if the precise output style matters a lot, I suggest post-processing it. |
Example,
sass
css
expect css
The text was updated successfully, but these errors were encountered: