Skip to content

Commit 0e386b6

Browse files
authored
Merge pull request #176 from rackerlabs/issue-168
fix(Accordion): correct CSS in polyfilled browsers
2 parents 2b9891f + f020245 commit 0e386b6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/helix-ui/styles/core/hx-accordion-panel.less

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
hx-accordion-panel {
22
display: block;
33

4-
> :not([slot="header"]) {
4+
// Hide content if closed (ignore header)
5+
//
6+
// Both :not() selectors have to be combined, because
7+
// they cannot be selected in isolation.
8+
// - :not([slot="header"]) is for modern browsers
9+
// - :not(#toggle) is for polyfilled browsers
10+
&:not([open]) > *:not([slot="header"]):not(#toggle) {
511
display: none;
612
}
713

8-
&[open] > * {
9-
display: block;
10-
}
11-
14+
> #toggle.hx-accordion-panel, // polyfill rewrite
1215
> [slot="header"] {
1316
padding: 0.5rem 0;
1417
}

0 commit comments

Comments
 (0)