Skip to content
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

properties-order seems to be ignored when properties-alphabetical-order is also set. #191

Open
cduivis opened this issue Mar 22, 2024 · 2 comments

Comments

@cduivis
Copy link

cduivis commented Mar 22, 2024

I've got the following use case.
I want all properties to be ordered alphabetically except for a few that I want to group together.

"order/order": [
	"dollar-variables",
	"at-variables",
	"less-mixins",
	"custom-properties",
	"declarations",
	"rules",
	"at-rules"
],
"order/properties-alphabetical-order" : true,
"order/properties-order" : [{
	"groupName"  : "margin",
	"properties" : [ "margin", "margin-top", "margin-right", "margin-bottom", "margin-left" ]
},{
	"groupName"  : "padding",
	"properties" : [ "padding", "padding-top", "padding-right", "padding-bottom", "padding-left" ]
}]

I would have expected that by default it orders everything alphabetically, while making an exception for the defined properties in the group.

But as shown by the screenshot below that is not what happens:
image

@rjgotten
Copy link

Ooph, that's kind of killing for long-hand properties that fit an intuitively common order, like the clockwise top-right-bottom-left for border, marging, padding, etc.

@hudochenkov
Copy link
Owner

Alphabetical order does group properties, because they start with the same word, e. g. margin.

You can't use both properties-order and properties-alphabetical-order. You have to pick one.

If you still want a mix of both. Then you have to use properties-order and provide your own order, where you could sort everything alphabetically, and then group properties however you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants