Name: part-theme
Owner: PolymerLabs
Description: Experimental proof of concept shim for ::part/::theme css.
Created: 2017-10-17 00:53:08.0
Updated: 2018-02-27 10:12:23.0
Pushed: 2018-02-06 18:51:59.0
Homepage: null
Size: 9
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is an experimental proof of concept shim for ::part or ::theme as defined here https://tabatkins.github.io/specs/css-shadow-parts/.
PartThemeMixin
should be applied to any elements that define or consume css. Elements may instead just call applyPartTheme(element)
to avoid use of the mixin.
PartThemeMixin
.part
attributes after connectedCallback
requires use of the custom api _applyPartTheme()
.Performance will likely be sub-optimal due to instance level work done to support parts.
Element's styles are parsed for ::part
/::theme
selectors. These are
re-written using css custom properties.
Element's shadowRoot
dom is scanned for elements with part attributes.
A new style element is added with rules that match these attributes
corresponding to part properties provided as css custom properties from the
element ancestor.
NOTE: Any time dom is modified in the element containing part attributes,
_applyPartTheme
must be called. This is done automatically only when the
element is connected.