constverum / stylelint-config-rational-order

Stylelint config that sorts related property declarations by grouping together in the rational order :vertical_traffic_light:
Apache License 2.0
448 stars 53 forks source link

Feature request: Empty line setting for minimum required properties #11

Open justrhysism opened 5 years ago

justrhysism commented 5 years ago

I like separating the properties into rational groups with lines in between - however when there's only a handful (< 3 || 4) of properties the gaps are a bit unwieldily and it makes it difficult to reason.

Suggestion: a minimum property setting for enacting the empty lines.

jm3 commented 5 years ago

@justrhysism great idea, I've been wanting the same thing. I often find my selector rules to have lots of single-line groups which is kind of weird.

I did a quick peek at the source and ran tests (npm i; npm i -D jest-cli; npm test), and based on what I saw, I don't think I'm savvy enough about how stylelint plugins and stylelint-order work in order to hack this out myself.

Would you want to try pairing on it?

justrhysism commented 5 years ago

My time is limited (young kids consuming life) but I think this feature would be super useful (as is the entire plugin) so am happy to contribute :) - assuming the author is happy to accept.

justrhysism commented 5 years ago

@jm3 alright so I've taken an initial look at this, and have realised that this plugin is basically just a configurator on top of stylelint-order.

The properties-order rule has an option emptyLineBefore which inserts the line above the group.

It appears that to get this feature in this plugin, we're going to need to add it to that plugin.

justrhysism commented 5 years ago

Link back: https://github.com/hudochenkov/stylelint-order/issues/86

justrhysism commented 5 years ago

So took me a while to get there as I had to add the feature to stylelint-order first!

zeorin commented 4 years ago

Any movement on this? Is there a way we could use this new option while we wait for the rational order to be updated?

justrhysism commented 4 years ago

@zeorin not sure, the project seems to be abandoned :(