Skip to content

Conversation

@rkaraivanov
Copy link
Member

Add support for adopting document-level styles into shadow DOM when using cell and header templates. This enables custom styles defined in the light DOM to be applied to templated content within web components.

Changes:

  • Added AdoptedStylesController to manage style adoption in shadow DOM
  • Added adopt-root-styles property to grid component
  • Implemented style adoption in cell and header components when templates are used
  • Added unit tests for AdoptedStylesController and style adoption functionality
  • Optimizeed rendering by replacing map directive with repeat directive

The controller caches adopted stylesheets per document and handles theme changes by invalidating the cache. Styles are only adopted when the property is enabled AND a template is provided, ensuring minimal overhead when not in use.

Add support for adopting document-level styles into shadow DOM when using
cell and header templates. This enables custom styles defined in the light
DOM to be applied to templated content within web components.

Changes:
- Added AdoptedStylesController to manage style adoption in shadow DOM
- Added `adopt-root-styles` property to grid component
- Implemented style adoption in cell and header components when templates are used
- Added unit tests for AdoptedStylesController and style adoption functionality
- Optimizeed rendering by replacing `map` directive with `repeat` directive

The controller caches adopted stylesheets per document and handles theme
changes by invalidating the cache. Styles are only adopted when the property
is enabled AND a template is provided, ensuring minimal overhead when not
in use.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 21853839417

Details

  • 179 of 185 (96.76%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 97.833%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/controllers/root-styles.ts 89 95 93.68%
Totals Coverage Status
Change from base Build 21486695420: -0.2%
Covered Lines: 3094
Relevant Lines: 3140

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants