• Overview
@angular/platform-browser

CssVarNamespacer

Class
stablesince v22.1

A service that can be used to manually namespace CSS variable names at runtime. This is useful when reading or setting CSS variables dynamically in JavaScript that were transformed by the compiler during the build.

API

    
      class CssVarNamespacer {}
    
    

namespace

string

Prepends the namespace prefix to a CSS variable name.

@paramnamestring

The CSS variable name to namespace, including the leading --.

@returnsstring

The namespaced CSS variable name, including the leading --. Returns the input unchanged if no namespace is configured.

Jump to details