wagtail / stylelint-config-wagtail

Shareable stylelint config for CSS and SCSS, following Wagtail’s code style.
https://www.npmjs.com/package/@wagtail/stylelint-config-wagtail
MIT License
11 stars 4 forks source link

Reconsider declaration-block-no-redundant-longhand-properties #42

Open thibaudcolas opened 10 months ago

thibaudcolas commented 10 months ago

Follow-up to https://github.com/wagtail/wagtail/issues/10719 / https://github.com/wagtail/wagtail/pull/11151 – where I’ve disabled this rule for now.

I’m not sure how much I like the idea of enforcing this rule for margin / padding properties. The main annoyance from my side is that when you want to set both properties with a similar-enough values, it’s nice to have them both side by side on the same line.

But when the values are quite complex, it would be nice to split into separate lines. Though this can be worked around with variables.

It’s also a bit annoying when you want to add one new longhand property in a situation where a shorthand would be possible – and the diff of the change becomes muddled up between "new" changes and refactorings due to the enforcement of a rule like this.


Not something I’d feel strongly about but I’d like to hear what others think?

lb- commented 10 months ago

I'm all for removing it, it can cause some unwanted churn in the code and also makes it harder to reason about cascading values that override a specific property.