Repository navigation
docs: document CSS custom property namespacing in the styling guide - #70835
Closed
erkamyaman wants to merge 3 commits into
Closed
erkamyaman wants to merge 3 commits into
erkamyaman wants to merge 3 commits into
Conversation
`provideCssVarNamespacing` and `CssVarNamespacer` landed in v22.1 (#68846) with no guide coverage, so the generated API reference was the only description of them. That reference cannot explain where the feature stops: Angular rewrites the custom property names in the styles it compiles, but static `style` attributes, object style bindings, `Renderer2.setStyle`, global stylesheets, and library components that read a global theme all keep the original name, and nothing reports the mismatch at build time or at runtime. Document the feature in the component styling guide: what Angular rewrites, the surfaces that keep the name you write, how to opt a name out with `--global--`, and how to resolve a namespaced name from TypeScript. Fixes #70834
JeanMeche
reviewed
Sep 20, 2026
JeanMeche
left a comment
Member
There was a problem hiding this comment.
AGENT: The documentation additions look great and adhere nicely to the adev-writing-guide. I have left one minor inline suggestion for adding a file header to the final code block for consistency.
SkyZeroZx
reviewed
Sep 20, 2026
Point the TSDoc of `provideCssVarNamespacing` and `CssVarNamespacer` at the guide section that describes them, so the generated API pages lead back to it, and name the component file in the guide's example.
JeanMeche
requested review from
mattrbeck
and removed request for
JeanMeche and
MarkTechson
September 20, 2026 20:15
mattrbeck
reviewed
Sep 29, 2026
mattrbeck
approved these changes
Sep 30, 2026
JeanMeche
approved these changes
Sep 30, 2026
Member
|
caretaker note: This is a doc only change, no need to presubmit. |
Contributor
kirjs
pushed a commit
that referenced
this pull request
Oct 1, 2026
…70835) `provideCssVarNamespacing` and `CssVarNamespacer` landed in v22.1 (#68846) with no guide coverage, so the generated API reference was the only description of them. That reference cannot explain where the feature stops: Angular rewrites the custom property names in the styles it compiles, but static `style` attributes, object style bindings, `Renderer2.setStyle`, global stylesheets, and library components that read a global theme all keep the original name, and nothing reports the mismatch at build time or at runtime. Document the feature in the component styling guide: what Angular rewrites, the surfaces that keep the name you write, how to opt a name out with `--global--`, and how to resolve a namespaced name from TypeScript. Fixes #70834 PR Close #70835
nikos-moysiadis
pushed a commit
to nikos-moysiadis/angular
that referenced
this pull request
Oct 1, 2026
…PIs (angular#70835) Point the TSDoc of `provideCssVarNamespacing` and `CssVarNamespacer` at the guide section that describes them, so the generated API pages lead back to it, and name the component file in the guide's example. PR Close angular#70835
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70834
Adds a section to the component styling guide for the CSS namespacing featurefrom #68846. Covers what gets renamed, what doesn't (static
styleattributes,[style]object bindings,Renderer2.setStyle, global stylesheets, and library components reading a theme, all of which fail silently), the--global--opt-out, andCssVarNamespacerfor DOM APIs. Written against the merged code, not the PR description, which is out of date: the_separator is appended for you now, the--global-error only runs in g3, and a<link>in a template gets inlined and namespaced.