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
Ordinal number word attribute #6090
Comments
This seems exactly what the class attribute is designed for. It's unclear what the benefit of creating a new classification attribute would be. |
I think there's more to it. Benefits off the top of my head:
|
What about |
A class seems just as helpful.
Tabindex, or other technology that actually affects accessibility technology, would work better for this. Since no accessibility technology keys off of unknown attributes like this one, it isn't beneficial. If accessibility technology vendors were suggesting that this would be helpful (more than tabindex), then we could reconsider this point. But I'm very skeptical of people claiming accessibility benefits without AT vendors lined up to implement based off of them.
This can be done without changing the HTML Standard to introduce a no-op attribute. They can just collaborate themselves.
This is not feasible given how browser painting architecture works.
I don't understand this point, or how they could make use of it differently than
This is not really the way standardization works. We work from use cases and benefits first, instead of going through the trouble of writing specs/tests/implementations in 3 browser engines, and only then hoping that it helps someone. You can learn more about this in https://whatwg.org/faq#adding-new-features . In particular I'd strongly suggest you focus on steps 1 and 2. |
@Yay295 good point, but tabindex is for the context of the whole page and is only meant for interactive elements. |
@domenic Please take into consideration that these precedence classes are incredibly ubiquitous. It's a strong signal for spec authors to consider that maybe HTML should step in and offer a standard.
Tabindex is not really the same thing. See reply to @Yay295 |
Again, the ubiquity of a class is not a reason for HTML to move that out of the perfectly-working A signal that something needs standardization is instead a set of use cases. Again, see https://whatwg.org/faq#adding-new-features, especially step 1 and 2. |
It might help to see it from a different perspective. If HTML had this kind of precedence attribute since say, 2008 (HTML5 release year), do you think Bootstrap and all the others would have used it or would they have ignored it and created precedence classes? Do you think screen-readers would have included support for it to help users understand the HTML author's intention of giving elements meaningful order? Do you think developers would have used it in helpful ways like matching this precedence attribute selector with flexbox's order in responsive designs? Anyway, I figured since so many web sites implement element precedence (usually buttons) it might be worth a discussion. I'll share more use cases as I run into them. |
When building a UI you often have elements (usually buttons) that go in an order of precedence. Like:
( SAVE ) CANCEL
Higher precedence typically means a more bold/bright design, but this is semantic too not just styles.
Pretty much every UI library out there comes with classes for doing this and they use ordinal number words in their class names, e.g. "primary", "secondary", "tertiary".
An attribute for this would be really nice to have when authoring HTML and CSS and would maybe be a benefit for people using screen-readers too.
M- has an
ord
attribute for some of its components:I'm the creator of M-, so I like this, but I think it would make sense as a native attribute that everyone could use.
The text was updated successfully, but these errors were encountered: