Skip to content

Commit ffc6a3b

Browse files
authored
docs: clarify stylesheet cascade layers
Agent: GPT Sol 6.2 · operator
2 parents d909920 + 22c6144 commit ffc6a3b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Element applications can use `material/styles/base-elements` to keep the base's
236236

237237
`material/styles/base-lite` is a smaller option for element pages that also omit the page reset and contrast modes: it keeps the theme, tokens, body theme and global reduced-motion switch. Factory components and page-level `data-ripple` utilities need `material/styles/base`. Choose one base entry for the page.
238238

239-
Library styles sit in ordered `mtrl.*` cascade layers, so unlayered application CSS overrides them without specificity battles.
239+
`material/styles/base` and the per-component stylesheets use ordered `mtrl.*` cascade layers. Normal unlayered application rules take precedence over those layered rules. The all-in-one `material/styles` stylesheet is unlayered, so normal application rules compete with it by specificity and source order.
240240

241241
Components can opt into the existing type-scale role properties through an application Sass build. Prebuilt CSS keeps the default profile. Load configuration first, then compile the factory stylesheet:
242242

‎npm-readme.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ document.body.append(name.element, save.element);
3939

4040
`material/styles` is a stylesheet, so this needs a bundler that handles CSS imports (Vite, webpack, Bun, …). Each factory returns a DOM element and a small API; call `destroy()` when the view goes away.
4141

42+
`material/styles/base` and the per-component stylesheets use ordered `mtrl.*` cascade layers. Normal unlayered application rules take precedence over those layered rules. The all-in-one `material/styles` stylesheet is unlayered, so normal application rules compete with it by specificity and source order.
43+
4244
For a factory page whose buttons stay filled, small and round, use the optional fixed-profile sheet:
4345

4446
```typescript

0 commit comments

Comments
 (0)