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

CSS Attribute presence and value selectors - Numerical Comparison <,>,<=,>=,== bitflagsOps + inspect width, height #10401

Open
wesleyolis opened this issue Jun 8, 2024 · 1 comment

Comments

@wesleyolis
Copy link

Hi,

https://www.w3.org/TR/selectors-4/#attribute-representation

I would like to propose that additional numerical comparison and bitflag selectors be introduce, which will allow us to do a lot more advance things.
Yes there are hacks counting in hex for this, but ideally we looking for simple ways to achieve our goals.

There so many times when I would like to use attribute selectors to inspect a width of something, use the abstract @component selectors potentially for this, but then all the other use cases for improving grid layouts.

Additional now with grid there so many times that I would like to change elements of display:grid layout based on a numerical seed value. forcing column breaks or row breaks, instead column dividers for groups of columns.
Change the alignments styles of tailing or lead sections of a group of items in columns or rows, with later proposal that will follow.
nth-attrib-of[attribselectorand value]:{
grid:1/-1;
}

I would like to propose that you introduce the numerical comparison and might as well add support for bit flags while you at it then.

[attr<=val]
[attr>=val]
[attr==val]
[attr>val]
[attr<val]
[attr[bitflagop]==val] // where by 

bitflagop: &, |, exclusive XOR - [X&], exclusive XAND[X&], NOT !

Any question please ask.

@Crissov
Copy link
Contributor

Crissov commented Jun 9, 2024

Most of this has already been mentioned in #354. The bit flag operators seem mostly new.

Don’t ask me why this hasn’t had any priority within the past dozen years.

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

2 participants