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

Possible to place all before everything else? #149

Closed
patric-eberle opened this issue Sep 7, 2021 · 4 comments
Closed

Possible to place all before everything else? #149

patric-eberle opened this issue Sep 7, 2021 · 4 comments

Comments

@patric-eberle
Copy link

Is it possible to force the placement of the all property, which will reset every other property, before any other type with the basic order? From the documentation it is not clear to me how this could be achieved, since order only knows the keyword declarations as a whole.

https://developer.mozilla.org/en-US/docs/Web/CSS/all

@hudochenkov
Copy link
Owner

You need to use properties-order rule for that.

@Brixy
Copy link

Brixy commented Oct 15, 2021

I was just going to ask the same thing.

@patric-eberle’s suggestion would be a good default (IMHO).

There’s quite a number of properties that would be affected.

@jeddy3
Copy link
Contributor

jeddy3 commented Oct 21, 2021

To expand on #149 (comment), I believe you can use the unspecified secondary option of the properties-order rule to place the all property above anything else.

If you don't care about the order of the properties after all, you can use:

{
	"order/properties-order": [
		["all"],
		{ "unspecified": "bottom" }
	]
}

If you want them to be alphabetical, you can use:

{
	"order/properties-order": [
		["all"],
		{ "unspecified": "bottomAlphabetical" }
	]
}

@Brixy
Copy link

Brixy commented Oct 22, 2021

This works perfectly, @jeddy3.

Thank you very much for the tip.

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

4 participants