Skip to content

add Snap a length as a line width#44194

Merged
dipikabh merged 8 commits into
mdn:mainfrom
sb3nder:computed-border-width
Jul 8, 2026
Merged

add Snap a length as a line width#44194
dipikabh merged 8 commits into
mdn:mainfrom
sb3nder:computed-border-width

Conversation

@sb3nder

@sb3nder sb3nder commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Add high level description of the Snap a length as a line width rounding method, to the <length> CSS type" page.

Motivation

The computed value for border-*-width, column-rule-width, outline-width, outline-offset, -webkit-border-*-width, is specified as "the absolute length, snapped as a line width" .
There is no docs explaing what that means, that I can easely link in the computed value description.

Additional details

border-*-width, column-rule-width, outline-width snapped as a line width:
w3c/csswg-drafts#5210

Computed value untangled from *-style properties value:
w3c/csswg-drafts#11494 (comment)

outline-offset snapped as a line width:
w3c/csswg-drafts#12906

Definition of "length snapped as a line width":
https://drafts.csswg.org/css-values-4/#snap-as-a-line-width

Related issues and pull requests

Fixes #44193

Relates mdn/data#1069

@sb3nder sb3nder requested a review from a team as a code owner May 19, 2026 21:48
@sb3nder sb3nder requested review from dipikabh and removed request for a team May 19, 2026 21:48
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed labels May 19, 2026
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

(comment last updated: 2026-07-08 08:06:55)

@dipikabh

Copy link
Copy Markdown
Contributor

Hello @sb3nder, thanks for the PR!

Couple of pointers about how we document on MDN:

  • We use Markdown style links.
  • We don't usually link to the spec in the middle of the prose. Instead, we explain the expected behavior in simple language.
  • The algorithm in the spec is for the browser implementers. What we document is how web developers will encounter this behavior.

Hope this helps.

This <length> behavior change could be a single line update - you can consider adding it to the "Syntax" or "Absolute length units" section.
It would also be nice to have a short example to explain this behavior.

@sb3nder

sb3nder commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@dipikabh, thank you for the help.
I gave it another try, let me know what you think.

@dipikabh dipikabh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @sb3nder.

Your update is good; I've proposed some tweaks and also suggested to add it to a different part of the "Syntax" section. Please take a look at my inline suggestions. Thanks!

Comment thread files/en-us/web/css/reference/values/length/index.md
Comment thread files/en-us/web/css/reference/values/length/index.md Outdated
Comment thread files/en-us/web/css/reference/values/length/index.md
Comment thread files/en-us/web/css/reference/values/length/index.md
sb3nder and others added 5 commits July 8, 2026 09:35
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Comment thread files/en-us/web/css/reference/values/length/index.md
@sb3nder sb3nder requested a review from dipikabh July 8, 2026 08:09

@dipikabh dipikabh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot, @sb3nder!

@dipikabh dipikabh merged commit b25b4a9 into mdn:main Jul 8, 2026
9 checks passed
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.

[CSS] add length snapped as a line width reference

3 participants