-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
newline_between_rules support for Sass (enhancement) #657
Comments
And what do you want it to look like? |
Similar to CSS version #574 // Icons
.icons {
padding: 0;
li {
display: inline-block;
}
a {
display: block;
color: #000;
}
a:hover {
color: #ccc;
}
}
// Button
.button {
&.primary {
color: #4183c4;
}
&.primary:hover {
color: lighten(#4183c4, 15%);
}
} |
+1 |
3 similar comments
+1 |
+1 |
+1 |
maybe an option like
|
+1, also for less |
+1 |
1 similar comment
+1 |
I can confirm that this is indeed a problem only with the nested rules. Current with
Becomes this:
And
So support for newlines between nested rules should be considered. |
+1 |
Any ETA on this thing? |
+1 |
1 similar comment
+1 |
+1 :( |
+1 |
Another +1 Sorry for the noise. I didn't know if another way to upvote this. |
@zimmerboy there's an "Add your reaction" button at the top right of every comment, which contains the +1 reaction (:+1:). |
My workaround in
Note: This only takes care of newlines between rules, not rules after properties. Anyone some ideas on that? |
@Sickboy - Cool, start a pull request, add some tests. Please feel free to move this forward. |
Is this coming anytime soon? It's my only blocker for using beautify for sass. |
@mrahhal - The issue is nearly two years old. It seams @Sickboy has done some work on this. Someone just needs to make a pull request with tests. Maybe you'd like to do this? See CONTRIBUTING.md. |
@bitwiseman unfortunately I don't have the experience with this kind of projects nor the time. But my question is, so is everyone either using plain css or just sticking with how the current formatting works? That's weird for a very old but easy to solve issue . @Sickboy are you on this? Maybe I'll tackle it after all if nobody's active on this. Apart from some weird behavior with "max_preserve_newlines", this is really the only thing missing that's completely preventing me from using beautify. |
Any updates? |
@royduin - please test with the latest release. |
@stgogm |
@bitwiseman Okay, sorry. Just wanted to note that as it's not really an issue if you respect the SCSS linter rules. |
@stgogm - Cool, thanks for the info. 😄 |
@stgogm while you have it set up, could you test the nested newline_between_rules: true does your fieldset {
border: 0;
margin: 0;
min-width: 0;
padding: 0;
&+fieldset {
margin-top: $padding-large;
}
} become fieldset {
border: 0;
margin: 0;
min-width: 0;
padding: 0;
&+fieldset {
margin-top: $padding-large;
}
} ? |
Actually, it makes no difference: Code as authored (without new line in between): form {
display: block;
}
fieldset {
border: 0;
margin: 0;
min-width: 0;
padding: 0;
& + fieldset {
margin-top: $padding-large;
}
} After beautify with form {
display: block;
}
fieldset {
border: 0;
margin: 0;
min-width: 0;
padding: 0;
&+fieldset {
margin-top: $padding-large;
}
} After beautify with form {
display: block;
}
fieldset {
border: 0;
margin: 0;
min-width: 0;
padding: 0;
&+fieldset {
margin-top: $padding-large;
}
} It just removed the space between the js-beautify --version
1.6.12 |
Thanks @stgogm! So nope @bitwiseman #1146 didn't fix this |
Another example where "newline_between_rules" is not enough for SCSS:
Formatting this SCSS doesn't add a new line between the variable and the div selector. |
Is clear when this feature will be available? |
Does it have any progress? |
@dehghani-mehdi @whxaxes |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Please vote with a 👍 reaction to the initial post rather than +1 messages - that won't spam subscribers. Thanks! |
Now
newline_between_rules
option in v1.5.5 is supported for CSS only #574So, in Sass for nesting doesn't work.
Here my
test.js
file:Output:
I hope to add
newline_between_rules
support for Sass.Regards.
The text was updated successfully, but these errors were encountered: