Skip to content

Update calc() documentation based on browser support for typed arithmetic #40988

@mkrause

Description

@mkrause

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/calc

What specific section or headline is this issue about?

"Input considerations"

What information was incorrect, unhelpful, or incomplete?

Both Webkit and Chrome (v140) now have support for typed arithmetic in CSS calc(), for example this will work: calc(2rem / 1px). Currently MDN still mentions:

Current implementations require that, when using the * and / operators, one of the operands must be unitless. For /, the right operand must be unitless. For example font-size: calc(1.25rem / 1.25) is valid but font-size: calc(1.25rem / 125%) is invalid.

What did you expect to see?

  • Update the documentation to reflect the latest browser support
  • Add a new row under "Browser compatibility" to document this new capability

Do you have any supporting links, references, or citations?

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Labels

Content:CSSCascading Style Sheets docsgoal: up-to-date(Experimental label) Issues about outdated content.needs BCD updateRequires changes in BCD mdn/browser-compat-data

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions