We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
(This was originally posted in #9742 (comment) but moved to its own issue later.)
Proposal:
A scope statement, similar to a layer statement, could be used to create a reusable named scope. For example:
@scope foo (.start) to (.end);
A reusable named scope can then be used without specifying <scope-start>/<scope-end>:
<scope-start>
<scope-end>
@scope foo { p { color: red; } }
The main thing this enables is avoiding the need to repeat selectors for every use.
Open questions:
The text was updated successfully, but these errors were encountered:
For @media this same feature is currently specified as @custom-media : https://drafts.csswg.org/mediaqueries-5/#custom-mq
@media
@custom-media
@custom-media --modern (color), (hover); @media (--modern) and (width > 1024px) { .a { color: green; } }
This separates declaring a scope and using a scope.
Sorry, something went wrong.
@romainmenke good point, I wonder if there should be a common primitive for "defining" things.
Example syntax (bikesheddable):
@define(scope) --foo (.start) to (.end); @define(media) --modern (color), (hover);
@custom-* can be the common primitive :)
@custom-*
A benefit of a dedicated at-rule is that things can be different without causing conflicts.
No branches or pull requests
(This was originally posted in #9742 (comment) but moved to its own issue later.)
Proposal:
A scope statement, similar to a layer statement, could be used to create a reusable named scope. For example:
A reusable named scope can then be used without specifying
<scope-start>
/<scope-end>
:The main thing this enables is avoiding the need to repeat selectors for every use.
Open questions:
The text was updated successfully, but these errors were encountered: