mirror of
https://gitee.com/shuto-github/Shadow-DOM-inject-styles.git
synced 2026-01-29 00:02:44 +08:00
init
This commit is contained in:
13
README.md
13
README.md
@@ -1,2 +1,15 @@
|
||||
# Shadow-DOM-inject-styles
|
||||
A helper function to easily modify Shadow DOM CSS.
|
||||
|
||||
```ts
|
||||
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);
|
||||
```
|
||||
Reference in New Issue
Block a user