Skip to content

Commit 9a5fa9a

Browse files
authored
Merge pull request #374 from patternfly/set-accordion-placeholders-fork
Suggested mixin updates
2 parents c8b63dd + b1059e3 commit 9a5fa9a

File tree

5 files changed

+139
-295
lines changed

5 files changed

+139
-295
lines changed

elements/pfe-accordion/demo/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
section {
3434
padding: 2rem;
3535
}
36+
a {
37+
color: var(--pfe-broadcasted--color--ui-link);
38+
}
39+
a:hover {
40+
color: var(--pfe-broadcasted--color--ui-link--hover);
41+
}
42+
a:visited {
43+
color: var(--pfe-broadcasted--color--ui-link--visited);
44+
}
45+
a:focus {
46+
color: var(--pfe-broadcasted--color--ui-link--focus);
47+
}
3648
.dark-background {
3749
background-color: #191e84;
3850
}
Lines changed: 14 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@import "../../pfe-sass/pfe-sass";
22

3+
$LOCAL: accordion;
4+
35
/// ===========================================================================
46
/// DEFAULT ACCORDION HEADING
57
/// ===========================================================================
@@ -8,52 +10,24 @@
810
@include pfe-accordion-header;
911

1012
button {
11-
@include pfe-trigger-button($type: accordion); // border 3px
12-
@include pfe-trigger-color-light($type: accordion);
13+
@include pfe-trigger-color($component-name: accordion);
14+
@include pfe-trigger-button;
1315

1416
&[aria-expanded="true"] {
15-
@include pfe-trigger-color-light-expanded($type: accordion);
16-
@include pfe-trigger-expanded;
17-
}
18-
19-
&[aria-expanded="true"]::after {
20-
@include pfe-chevron-expanded-true;
17+
@include pfe-trigger-color-expanded($component-name: accordion);
18+
@include pfe-trigger-expanded;
19+
&::after {
20+
@include pfe-chevron-expanded;
21+
}
2122
}
2223

2324
&[aria-expanded="false"]::after {
24-
@include pfe-chevron-expanded-false;
25+
@include pfe-chevron-expanded($state: false);
2526
}
2627
}
2728
}
2829

29-
////////// last child
30-
31-
// @TODO: add lighter/lightest and darker/darkest colors.
32-
33-
// :host([color="darker"]:last-of-type),
34-
// :host([color="darkest"]:last-of-type) {
35-
// button[aria-expanded="false"] {
36-
// @include pfe-trigger-button-last($theme: dark);
37-
// }
38-
// }
39-
40-
// :host([color="lighter"]:last-of-type),
41-
// :host([color="lightest"]:last-of-type) {
42-
// button[aria-expanded="false"] {
43-
// @include pfe-trigger-button-last($theme: light);
44-
// }
45-
// }
46-
47-
// :host([color="darker"]:first-child),
48-
// :host([color="darkest"]:first-child) {
49-
// button {
50-
// @include pfe-trigger-button-first($theme: dark);
51-
// }
52-
// }
53-
54-
:host(:first-child),
55-
:host([color="lighter"]:first-child),
56-
:host([color="lightest"]:first-child) {
30+
:host(:first-child) {
5731
button {
5832
@include pfe-trigger-button-first($theme: light);
5933
}
@@ -72,39 +46,15 @@
7246
}
7347

7448
/// ===========================================================================
75-
/// COLOR OVERRIDES
49+
/// CONTEXT STYLES, ON=DARK
7650
/// ===========================================================================
7751

7852
:host([on="dark"]) {
7953
button {
80-
@include pfe-trigger-color-dark($type: accordion);
54+
@include pfe-trigger-color($theme: dark, $component-name: accordion);
8155

8256
&[aria-expanded="true"] {
83-
@include pfe-trigger-color-dark-expanded($type: accordion);
57+
@include pfe-trigger-color-expanded($theme: dark, $component-name: accordion);
8458
}
8559
}
8660
}
87-
88-
// @TODO: add lighter/lightest and darker/darkest colors.
89-
90-
// :host([color="lighter"]),
91-
// :host([color="lightest"]) {
92-
// button {
93-
// @include pfe-trigger-color-lightest;
94-
95-
// &[aria-expanded="true"] {
96-
// @include pfe-trigger-color-light-expanded;
97-
// }
98-
// }
99-
// }
100-
101-
// :host([color="darker"]),
102-
// :host([color="darkest"]) {
103-
// button {
104-
// @include pfe-trigger-color-darkest;
105-
106-
// &[aria-expanded="true"] {
107-
// @include pfe-trigger-color-darkest-expanded;
108-
// }
109-
// }
110-
// }
Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@import "../../pfe-sass/pfe-sass";
22

3+
$LOCAL: accordion;
4+
35
/// ===========================================================================
46
/// DEFAULT ACCORDION PANEL
57
/// ===========================================================================
@@ -14,6 +16,7 @@
1416
}
1517

1618
:host([on="dark"][expanded]) {
19+
@include pfe-theme($theme: "dark");
1720
@include pfe-accordion-panel-expanded-style($theme: dark);
1821
}
1922

@@ -25,27 +28,8 @@
2528
.container {
2629
@include pfe-accordion-panel-container-inset($align: left);
2730
}
28-
31+
2932
:host(:last-of-type[expanded]) {
30-
@include pfe-accordion-panel-expanded-last;
33+
margin-bottom: 0;
3134
}
3235

33-
// @TODO: add lighter/lightest and darker/darkest colors.
34-
35-
// :host([color="lighter"][expanded]),
36-
// :host([color="lightest"][expanded]) {
37-
// @include pfe-accordion-panel-expanded-style;
38-
// @include pfe-accordion-panel-expanded-style-lightest;
39-
// }
40-
41-
// :host([color="darker"][expanded]),
42-
// :host([color="darkest"][expanded]) {
43-
// @include pfe-accordion-panel-expanded-style($theme: dark);
44-
// @include pfe-accordion-panel-expanded-style-darkest;
45-
// }
46-
47-
// :host(:last-of-type[color="darker"][expanded]),
48-
// :host(:last-of-type[color="darkest"][expanded]) {
49-
// @include pfe-accordion-panel-expanded-last-dark;
50-
// }
51-
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
@import "../../pfe-sass/pfe-sass";
22

3+
$LOCAL: accordion;
4+
35
:host {
46
display: block;
57
position: relative;
68
overflow: hidden;
79
margin: 0;
8-
color: var(--pfe-broadcasted--color--text);
10+
color: #{pfe-radio(color--text)};
911
}
1012

1113
:host([on="dark"]) {
@@ -16,19 +18,3 @@
1618
@include pfe-theme($theme: "light");
1719
}
1820

19-
// @TODO: add lighter/lightest and darker/darkest colors.
20-
21-
// :host([color="darker"]) {
22-
// @include pfe-theme($theme: "darker");
23-
// }
24-
// :host([color="darkest"]) {
25-
// @include pfe-theme($theme: "darkest");
26-
// }
27-
28-
// :host([color="lighter"]) {
29-
// @include pfe-theme($theme: "lighter");
30-
// }
31-
// :host([color="lightest"]) {
32-
// @include pfe-theme($theme: "lightest");
33-
// }
34-

0 commit comments

Comments
 (0)