mirror of
https://gitee.com/shuto-github/Shadow-DOM-inject-styles.git
synced 2026-05-10 00:00:01 +08:00
17 lines
385 B
Markdown
17 lines
385 B
Markdown
# Shadow-DOM-inject-styles
|
|
A helper function to easily modify Shadow DOM CSS.
|
|
|
|
```ts
|
|
import {injectStyles} from 'shadow-dom-inject-styles';
|
|
|
|
const toolbar = (this.el.querySelector('ion-header > ion-toolbar') as HTMLElement);
|
|
|
|
// language=CSS
|
|
const styles = `
|
|
.toolbar-background {
|
|
background: red !important;;
|
|
}
|
|
`;
|
|
|
|
injectStyles(toolbar, '.toolbar-background', styles);
|
|
``` |