Skip to content

Make arithmetic operator formatting consistent in CSS docs - #44335

Open
VladNegara wants to merge 6 commits into
mdn:mainfrom
VladNegara:code-font-arithmetic-operators
Open

Make arithmetic operator formatting consistent in CSS docs#44335
VladNegara wants to merge 6 commits into
mdn:mainfrom
VladNegara:code-font-arithmetic-operators

Conversation

@VladNegara

Copy link
Copy Markdown
Contributor

Description

I added backticks around the +, -, *, / operators in the docs of the min() and max() CSS functions to have them rendered in code font.

Motivation

I am proposing these changes for consistency with the docs for the clamp() function. The docs for calc() and calc-size() also use code font.

Additional details

I personally think spacing out the parentheses from the symbols looks unprofessional. This is how it is currently written in the docs:

addition ( + )

If the operators are typeset in code font, I believe this sets them apart enough from the surrounding parentheses to justify removing the spaces altogether, like this:

addition (+)

This change is not included in this PR.

@VladNegara
VladNegara requested a review from a team as a code owner June 2, 2026 11:09
@VladNegara
VladNegara requested review from pepelsbey and removed request for a team June 2, 2026 11:09
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (3 pages)

(comment last updated: 2026-07-12 20:02:20)

@pepelsbey pepelsbey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you 🙂

A few suggestions:

  • + and - are operators, too. So marking them as code makes sense.
  • Since * is now code, there’s no need for a slash. Otherwise it will be rendered \*.
  • Added more code to calc() and <length> for consistency.

Comment thread files/en-us/web/css/reference/values/max/index.md Outdated
Comment thread files/en-us/web/css/reference/values/min/index.md Outdated
Comment thread files/en-us/web/css/reference/values/max/index.md Outdated
Co-authored-by: Vadim Makeev <hi@pepelsbey.dev>
@github-actions github-actions Bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants