-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add CSS typed arithmetic examples #339
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
Add CSS typed arithmetic examples #339
Conversation
| </head> | ||
| <body> | ||
| <div class="support-info"> | ||
| The rotation of each colored story section is calculated based on its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty neat
| </head> | ||
| <body> | ||
| <div class="support-info"> | ||
| The paragraph <code>background-color</code> and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool, is there anything to note for colorblindness / a11y concerns regarding background-color changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. The color changes are not vital for content legibility, and the change itself does not present an accessibility problem. I've tested the colors at each end of the change for contrast, and they both pass WCAG AAA.
bsmth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good, thanks 👍🏻
Chrome 140 adds support for CSS typed arithmetic; see https://chromestatus.com/feature/4740780497043456.
It is not very clear what this is from the spec, but https://css-tricks.com/css-typed-arithmetic/ provides a good explanation.
This PR adds some nice little examples that show what is made possible by this addition.
Note that the linked "Using CSS typed arithmetic" guide does not yet exist; I'm working on that next.