feat(compiler): Namespace CSS variables to the app (#68846)

Adds logic to inject symbols into CSS variables for runtime namespacing.
The runtime now replaces instances of `%NS%` with a namespacing
variable, limiting reach of CSS variables to the current app. An opt-out
syntax of a `--global` prefix allows users to avoid this behavior.

PR Close #68846
This commit is contained in:
Matthew Beck
2026-05-19 19:38:52 -07:00
committed by leonsenft
parent bbbcf8fc7f
commit f98547675c
19 changed files with 547 additions and 8 deletions
@@ -54,6 +54,15 @@ export class By {
// @public
export function createApplication(options?: ApplicationConfig, context?: BootstrapContext): Promise<ApplicationRef>;
// @public
export class CssVarNamespacer {
namespace(name: string): string;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<CssVarNamespacer, never>;
// (undocumented)
static ɵprov: i0.ɵɵInjectableDeclaration<CssVarNamespacer>;
}
// @public
export function disableDebugTools(): void;
@@ -158,6 +167,9 @@ export const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef
// @public
export function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
// @public
export function provideCssVarNamespacing(namespace: string): EnvironmentProviders;
// @public
export function provideProtractorTestingSupport(options?: {
usePendingTasksForStability?: boolean;