You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
701 B
21 lines
701 B
7 years ago
|
# Shadow DOM
|
||
|
|
||
|
By default Pillar components don't use Shadow DOM because polyfill for it in some browsers may be a
|
||
|
bit expensive. If you know what you doing and want to use Shadow DOM, all you need to do is pass an
|
||
|
options object with `useShadow` when registering:
|
||
|
|
||
|
```javascript
|
||
|
Pillar.register(MyComponent, 'my-component', {
|
||
|
useShadow: 'open',
|
||
|
});
|
||
|
```
|
||
|
|
||
|
### Modes
|
||
|
|
||
|
* `useShadow: 'open'` will enable Shadow DOM that is accessible from outside JavaScript.
|
||
|
* `useShadow: 'closed'` will enable Shadow DOM that is unaccessible and unchangeable from
|
||
|
JavaScript. As such, these elements can't be controlled using
|
||
|
[Pillar DevTools](./6_DEVTOOLS.html).
|
||
|
|
||
|
**_Next: [Pillar DevTools →](./6_DEVTOOLS.html)_**
|