Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

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.

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner September 29, 2025 10:26
@chrisdavidmills chrisdavidmills requested review from bsmth and removed request for a team September 29, 2025 10:26
</head>
<body>
<div class="support-info">
The rotation of each colored story section is calculated based on its
Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@bsmth bsmth left a 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 👍🏻

@chrisdavidmills chrisdavidmills merged commit e7cd60c into mdn:main Sep 30, 2025
1 check passed
@chrisdavidmills chrisdavidmills deleted the typed-arithmetic-examples branch September 30, 2025 14:15
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

Successfully merging this pull request may close these issues.

2 participants