-
Notifications
You must be signed in to change notification settings - Fork 92
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
Rule idea: declaration-nested-properties #44
Comments
Good idea 👍 |
Getting down to this at last. And a question. Do we really want the "always" option here? That would mean this rule will have to enforce nesting properties that... which ones exactly?
text: {
align: center;
decoration: underline;
indent: 2em;
}
UPD: if the parser meets more than one of them...
|
@dryoma interesting, regarding |
|
If we go with whitelist/blacklist, than no defaults are possible by the nature of stylelint. And whenn suggesting the 2nd option I was hoping that someone could point at the list of properties that are usually/preferably use nesting in Sass, as Sass itself (according to Sassmeister) does'n seem to give two moos about what is nested: a {
may: {
the: {
force: be with you;
}
}
} a {
may-the-force: be with you;
} |
I guess if Sass does not care about what you nest, maybe we should not either -- and just skip option 2. So we could do 3), or 1) that would have |
If we go with 1), then is this: a {
display: block;
margin: {
left: 10px;
}
} acceptable? I.e. nesting just one prop. Maybe this rule must be triggered only if two or more props with the same prefix ( Or maybe create an option that allows/prohibits that (enforcin nesting of just one rule)? |
or maybe require everything to be nested by default and add an option |
So, with a {
margin-left: 10px; // a warning
animation-name: weeee; // a warning
animation-delay: 0.1s; // a warning
text: {
align: justify; // ok
}
} with a {
margin-left: 10px; // get off, I'm the only child!
animation-name: weeee; // a warning
animation-delay: 0.1s; // a warning
text: {
align: justify; // warning, as "except" options reverse corresponding main options
}
} Like so? Also, how should we name that p.s. .funky {
font: 20px/24px fantasy {
weight: bold;
}
} makes me wanna go nuts rignt now :) |
@s10wen the rules are available in 1.4.1 (at last) |
@dryoma niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiice and <3 the example at #44 (comment) the force must be strong with you 👍 |
From stylelint/stylelint#1386 (comment) @jeddy3 suggested I post this here.
The text was updated successfully, but these errors were encountered: