Skip to content

Commit dd8bbcf

Browse files
authored
Add shadycss to howto-tabs (#105)
1 parent fc6a87a commit dd8bbcf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

elements/howto-tabs/howto-tabs.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
<slot name="panel"></slot>
4545
`;
4646

47+
// HIDE
48+
// ShadyCSS will rename classes as needed to ensure style scoping.
49+
ShadyCSS.prepareTemplate(template, 'howto-tabs');
50+
// /HIDE
51+
4752
/**
4853
* `HowtoTabs` is a container element for tabs and panels.
4954
*
@@ -83,6 +88,13 @@
8388
* exactly one tab is active.
8489
*/
8590
connectedCallback() {
91+
// HIDE
92+
// Shim Shadow DOM styles. This needs to be run in connectedCallback
93+
// because if you shim Custom Properties (CSS variables) the element
94+
// will need access to its parent node.
95+
ShadyCSS.styleElement(this);
96+
// /HIDE
97+
8698
// The element needs to do some manual input event handling to allow
8799
// switching with arrow keys and Home/End.
88100
this.addEventListener('keydown', this._onKeyDown);

0 commit comments

Comments
 (0)