content icon indicating copy to clipboard operation
content copied to clipboard

Add info about presentation attributes to css cascade

Open BeksOmega opened this issue 1 year ago • 3 comments

Description

Adds information about presentational attributes to the CSS Cascade docs. Updated throughout the "Author styles" section.

Motivation

Presentational attributes seem very similar to inline styles, but they have a very different precedence. This keeps people from thinking they're the same and running into unexpected behaviors.

Additional details

Manually tested that this information is correct, since the CSS spec doesn't specify how presentational attributes interact with CSS layers.

Related issues and pull requests

Fixes https://github.com/mdn/content/issues/33402

BeksOmega avatar May 07 '24 22:05 BeksOmega

Preview URLs

Flaws (1)

URL: /en-US/docs/Web/CSS/Cascade Title: Introducing the CSS Cascade Flaw count: 1

  • macros:
    • /en-US/docs/Web/CSS/align does not exist

(comment last updated: 2024-05-24 22:06:43)

github-actions[bot] avatar May 09 '24 08:05 github-actions[bot]

Thank you for filing the issue and submitting a PR to resolve it.

HTML presentational attributes are HTML, not part of CSS and therefore not part of the CSS cascade. This also means there isn't a mention as to the impact of CSS layers on presentational attributes, and we don't need to mention something that doesn't exist. Also, the ## Author styles: inline styles, layers, and precedence section is about author styles, not author HTML.

I do agree that a note about presentational attributes makes sense.

Please feel free to add a note in the "Which CSS entities participate in the cascade section. As this area starts with "Only CSS property/value pair declarations participate in the cascade." this is the best place to add this.

estelle avatar May 09 '24 08:05 estelle

Shuffled stuff around! Happy to make more changes if there's a better way to communicate this =)

BeksOmega avatar May 10 '24 21:05 BeksOmega

@BeksOmega Have you had a chance to look at the suggestions?

estelle avatar May 24 '24 19:05 estelle

@BeksOmega Have you had a chance to look at the suggestions?

Sorry about the delay! Committed your suggestions unchanged =)

BeksOmega avatar May 24 '24 22:05 BeksOmega