Skip to content

Conversation

@sakupi01
Copy link
Contributor

@sakupi01 sakupi01 commented Jul 27, 2025

Description

The change mainly aims for better accuracy to describe CSS value processing flow according to the specification.

Motivation

The previous version sometimes used incorrect terminology and descriptions, which will ultimately lead differences between mdn and the specs.

e.g.

  • CSS property value result will not come only from specificity - it will be the result of the entire cascade process
  • "specified values" were mostly used incorrectly/confused with "declared values" - "specified values" result from the defaulting process after cascading, but the previous version didn't make this clear
  • The document mainly described the stages after the Defaulting process, even though the terminology and phases before Defaulting
    (which are Filtering, Cascading, and related terms) are necessary to make after-Defaulting values understandable. Omitting the before-Defaulting process essentially leads to misworded descriptions.
  • Initial value shouldn't be listed as a value processing stage according to the spec - it is the terminology used in the specified value resolution process

The change also includes some typo/wording updates, which will make the description more accurate or simpler.

Additional details

The changes ensure compliance with:

Related issues and pull requests

@sakupi01 sakupi01 requested a review from a team as a code owner July 27, 2025 10:58
@sakupi01 sakupi01 requested review from estelle and removed request for a team July 27, 2025 10:58
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/m [PR only] 51-500 LoC changed labels Jul 27, 2025
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Drive-by, just looking at Markdown correctness. Not interested in reviewing, although this looks like good work; thank you!

@sakupi01
Copy link
Contributor Author

sakupi01 commented Jul 27, 2025

Every CSS property's value comes from the declaration that wins the [cascade](/en-US/docs/Web/CSS/CSS_cascade/Cascade) algorithm. When multiple declarations provide different property values for the same element, the declaration that ranks highest in the [cascade sorting order](/en-US/docs/Web/CSS/CSS_cascade/Cascade#cascading_order) gets applied.

Each property value comes from a single property-value pair; is single value is applied from each property. Even if the value is a comma separated list of values, that list of values came from a single declaration.
Each property value comes from a single property name-value pair; a single value is applied from each property. Even if the value is a comma separated list of values, that list of values came from a single declaration.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

## Property values

Every CSS property's value comes from the declaration with the greatest {{cssxref("specificity")}}. If two or more declarations with the same specificity provide different property values for the same element, the declaration value whose selector has the greatest algorithmic weight gets applied.
Every CSS property's value comes from the declaration that wins the [cascade](/en-US/docs/Web/CSS/CSS_cascade/Cascade) algorithm. When multiple declarations provide different property values for the same element, the declaration that ranks highest in the [cascade sorting order](/en-US/docs/Web/CSS/CSS_cascade/Cascade#cascading_order) gets applied.
Copy link
Contributor Author

@sakupi01 sakupi01 Jul 27, 2025

Choose a reason for hiding this comment

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

It could be read like property value comes because of only from the resolution of the specificity algorithm, but it's actually not.

Comment on lines +83 to 87
- [Declared value](#declared_value)
- [Cascaded value](#cascaded_value)
- [Specified value](#specified_value)
- [Computed value](#computed_value)
- [Used value](#used_value)
Copy link
Contributor Author

@sakupi01 sakupi01 Jul 27, 2025

Choose a reason for hiding this comment

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

The terminology "Initial value" is used IN the resolution phase of specified value, that is Defaulting phase - it's not the term to describe the part of value processing flow.

https://www.w3.org/TR/css-cascade-4/#value-stages
https://www.w3.org/TR/css-cascade-4/#defaulting

@sakupi01 sakupi01 changed the title renew css value processing document Refine CSS Value Processing document Jul 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 29, 2025

Preview URLs

Flaws (5)

URL: /en-US/docs/Web/CSS/CSS_cascade/Value_processing
Title: CSS property value processing
Flaw count: 3

  • macros:
    • Macro produces link /en-US/docs/Web/CSS/specificity which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/specificity which is a redirect
    • Macro produces link /en-US/docs/Learn_web_development/Core/Styling_basics/Cool-looking_box which is a redirect

URL: /en-US/docs/Web/CSS/CSS_syntax/Error_handling
Title: CSS error handling
Flaw count: 2

  • macros:
    • Macro produces link /en-US/docs/Web/CSS/at-rule which is a redirect
    • Macro produces link /en-US/docs/Learn_web_development/Core/Styling_basics/Cool-looking_box which is a redirect
External URLs (1)

URL: /en-US/docs/Web/CSS/CSS_cascade/Value_processing
Title: CSS property value processing

(comment last updated: 2025-08-28 12:20:15)

@sakupi01
Copy link
Contributor Author

sakupi01 commented Aug 4, 2025

@estelle

I would love a review from you, if that's possible!

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

This PR is excellent. I only got through the first bit, so have more to review, but I am heading out in 20 minutes for the week so I wanted to commit what I have instead of leaving you waiting.

I realize from the number of comments in just the first portion of this it seems like i may be being critical. I am just trying to ensure that the level is such that people with less knowledge than us aren't confused. So please don't take the number of edits as a reflection of the work you did. It's excellent. I am just making suggestions that I hope will answer the readers questions before they ask them.

@sakupi01
Copy link
Contributor Author

Thank you so much for taking the time to review this, @estelle!

I really appreciate your thoughtful feedback, especially knowing how busy you are.
I've addressed the points you raised and commented respectively.
Looking forward to your thoughts on the rest when you get a chance.

Enjoy your time off!

@sakupi01 sakupi01 requested a review from estelle August 12, 2025 16:34
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

a few more suggestions and questions

@sakupi01
Copy link
Contributor Author

sakupi01 commented Aug 27, 2025

Thank you very much for spending time, @estelle !

I made changes of:
grammar or english,
defaulting description with accuracy,
and CSS value processing index with 'Actual value'.

I hope they make sense!

@sakupi01 sakupi01 requested a review from estelle August 27, 2025 13:06
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

Thank you!
Yay. That was quite the first content PR. Welcome to the team!

@estelle estelle merged commit 07cb371 into mdn:main Aug 28, 2025
8 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/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants