Methods
adjustCSS(sheet, elementNameopt)
Pre-processes the make the stylesheet valid.
Strips out the CSS '*-viewport-segments' media query features and environment variables,
if not supported by the user agent, and internally stores rewritten CSS rules,
which will be applied according to the polyfill options.
Call observe() to respond to changes affecting the polyfilled features.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sheet |
CSSStyleSheet | The stylesheet to pre-process. | |
elementName |
string |
<optional> |
The element name, if the stylesheet is associated the shadow root of an element. |
observe(elementopt)
Observe and respond to changes affecting the polyfilled features.
When called without arguments, it will apply rewritten style rules globally,
which will not affect elements with associated shadow root.
When called with [element] it will apply the correct rewritten style rules
to the element with associated shadow root.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
element |
HTMLElement |
<optional> |
An element with associated shadow root. |