mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
The shared style host now has the capability to add component styles as link elements with external style references. This is currently unused within the runtime but is an enabling feature for upcoming features such as automatic component style HMR and development server deferred stylesheet processing. Instead of inline style content that is then added to a `style` element for each host node, a `link` element with a stylesheet `rel` attribute and a `href` attribute can now be created. The development server must be configured to provide the relevant component stylesheet upon request. The Angular CLI development server will provide this functionality once this capability is enabled. Since the primary use of this capability is development mode and will not be used for production code, server (SSR) style reuse is currently not yet implemented but may be implemented in the future. A component feature is used to provide the DOM renderer access to any external styles that were emitted at compile time. When external styles are present, the `getExternalStyles` function will be present on the runtime component metadata object. The DOM render will use this function to access and encapsulate the external style URLs as required by the component. PR Close #57922 |
||
|---|---|---|
| .. | ||
| browser | ||
| dom | ||
| security | ||
| static_assets | ||
| BUILD.bazel | ||
| hydration_spec.ts | ||
| testing_public_spec.ts | ||