mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 02:48:19 +00:00
Builds on attach-shadow, adopt-styles and ShadowTemplate, this commit adds ShadowHost and finally CustomElement. CustomElement is a renderless component to help with the creation of native HTML Custom Elements along with runtime type checking and self-documentation for attributes, slots, cssprops and cssparts. As you will probably see there is a little more work to come here. But in the same breath, everything would be fine to go in as is.
15 lines
323 B
JavaScript
15 lines
323 B
JavaScript
import Component from '@glimmer/component';
|
|
import { action } from '@ember/object';
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
export default class ShadowHostComponent extends Component {
|
|
|
|
@tracked shadowRoot;
|
|
|
|
@action
|
|
attachShadow($element) {
|
|
this.shadowRoot = $element.attachShadow({ mode: 'open' });
|
|
}
|
|
|
|
}
|