mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
docs(platform-browser): link the styling guide from the namespacing APIs (#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 #70835
This commit is contained in:
@@ -235,7 +235,7 @@ Prefer a style binding such as `[style.--primary-color]`, which Angular namespac
|
||||
you go through a DOM API instead, pass the name you wrote in your styles to
|
||||
[`CssVarNamespacer`](api/platform-browser/CssVarNamespacer), including the leading `--`:
|
||||
|
||||
```angular-ts
|
||||
```angular-ts {header: "profile-photo.ts"}
|
||||
import {Component, ElementRef, inject} from '@angular/core';
|
||||
import {CssVarNamespacer} from '@angular/platform-browser';
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import {CSS_VAR_NAMESPACE} from './dom_renderer';
|
||||
* This is useful when reading or setting CSS variables dynamically in JavaScript that
|
||||
* were transformed by the compiler during the build.
|
||||
*
|
||||
* @see [Using namespaced properties in TypeScript](guide/components/styling#using-namespaced-properties-in-typescript)
|
||||
* @publicApi 22.1
|
||||
*/
|
||||
@Service()
|
||||
|
||||
@@ -88,6 +88,7 @@ export const CSS_VAR_NAMESPACE = new InjectionToken<string>(
|
||||
*
|
||||
* @param namespace The prefix string to use as a namespace. If not provided, it defaults
|
||||
* to the `APP_ID`. An underscore is appended unconditionally.
|
||||
* @see [Namespacing CSS custom properties](guide/components/styling#namespacing-css-custom-properties)
|
||||
* @publicApi
|
||||
*/
|
||||
export function provideCssVarNamespacing(namespace?: string): EnvironmentProviders {
|
||||
|
||||
Reference in New Issue
Block a user