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
The syntax of a <style-feature> is currently defined as “ a valid declaration, a supported CSS property, or a <custom-property-name>.”
<style-feature>
<custom-property-name>
The first part allows one to only do equality comparisons, like so:
/* --num-children is exactly 10 */ @container style(--num-children: 10) { #target { background: red; } }
What is currently not allowed is to do mathematical comparisons, which I think would be nice to add, allowing authors to do things like this:
/* --num-children is 10 or greater */ @container style(--num-children >= 10) { #target { background: red; } }
Or even this:
#target { background: if( style(--num-children >= 10): red; style(--num-children >= 8): orange; style(--num-children >= 6): yellow; else: green; ); }
(Assuming if() treats multiple conditions as if they were an else if – if not then the lines need to be reshuffled a bit)
if()
else if
Or this:
#target { background: if( style(--num-children >= 10): red; style(8 <= --num-children < 10): orange; style(6 <= --num-children < 8): yellow; else: green; ); }
The text was updated successfully, but these errors were encountered:
I remember mentioning this syntax in other issues before, but I can't find it.
Sorry, something went wrong.
No branches or pull requests
The syntax of a
<style-feature>
is currently defined as “ a valid declaration, a supported CSS property, or a<custom-property-name>
.”The first part allows one to only do equality comparisons, like so:
What is currently not allowed is to do mathematical comparisons, which I think would be nice to add, allowing authors to do things like this:
Or even this:
(Assuming
if()
treats multiple conditions as if they were anelse if
– if not then the lines need to be reshuffled a bit)Or this:
The text was updated successfully, but these errors were encountered: