Skip to content

Commit 099dc3e

Browse files
fix: Accordion design kit alignment (#1512) (#1726)
* fix: Isolating styles from pfe-accordion PR * fix: Migrating styles over from accordion PR and fixing IE11 discrepencies * fix: Update demo page text * fix: Update docs * fix: Update polyfills for accordion * fix: Add a create for pfe-icon if not defined * fix: Pull JS changes out of pfelement * Update elements/pfelement/src/pfelement.js * fix: Resolving define bugs * fix: Fixing a design feedback and cleaning up duplication * fix: Update the pfe-collapsible extend * fix: Resolving IE11 discrepencies * fix: Add a warning for version mismatches * fix: Update baselines * fix: Update baselines; snapshot IE * fix: Remove unused extends * fix: Pull out polyfill updates to other PRs * fix: Remove duplicate region roles * fix: Update documentation * fix: correct pfe-icon duplicate define calls; update slot docs for accent * fix: Update styles to fix bug on h-tags with margin-top * fix: adjust comment * fix: Update documentation * fix: Update demo page and adjust mark's placement * fix: Pull out unrelated updates * fix: Changelog update * fix: Adjusting margins for alignment * fix: Apply design feedback; tweaking the animation * fix: Resolve IE11 bug, clean up styles, demo page * fix: Make more room for accents to align themselves * fix: Correct active background color duplication * fix: Update baseline images; remove HP refs * fix: Design feedback applied * fix: Migrate tests to new testing framework * fix: Remove references from WCT for items converted to new test framework * fix: Bring back commented out tests Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e9d8d58 commit 099dc3e

37 files changed

+1524
-1992
lines changed

CHANGELOG-1.x.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 1.11.0 (2021)
22

33
- [d3ea7fa](https://github.com/patternfly/patternfly-elements/commit/d3ea7facb0c36b7f3e20e2568bdc4bf2e5a5a852) feat: Graceful failure for component registry
4+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: Accordion alignment with latest design kit
45
- [5f88c39](https://github.com/patternfly/patternfly-elements/commit/5f88c3963f8a6c13a9aeba6e9f664678453d46ce) fix: Jump links parseInt for IE11
56

67
# 1.10.1 (2021-07-12)

docs/demo.html

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,36 @@ <h3 slot="pfe-card--header">Card 3</h3>
7474
</pfe-band>
7575
<pfe-band>
7676
<h2 slot="pfe-band--header">Accordion component</h2>
77-
<pfe-accordion>
77+
<pfe-accordion expanded-index="1">
7878
<pfe-accordion-header>
79-
<h3>Why do wizards need money if they could just create it?</h3>
79+
<h3>Laboris sunt qui dolor consectetur excepteur in aliqua ipsum?</h3>
8080
</pfe-accordion-header>
8181
<pfe-accordion-panel>
82-
<p>There is legislation that decides what you can conjure and what you can not. Because things that you conjure out of thin air will not last, it is illegal in the wizarding world.</p>
82+
<p>Culpa adipisicing sunt dolor ullamco dolor duis in ad commodo.</p>
83+
<pfe-cta>
84+
<a href="#">Call to action</a>
85+
</pfe-cta>
8386
</pfe-accordion-panel>
8487
<pfe-accordion-header>
85-
<h3>Why doesn't Harry have a portrait of his parents?</h3>
88+
<h3>Anim est tempor fugiat pariatur laborum deserunt ex mollit aliquip?</h3>
8689
</pfe-accordion-header>
8790
<pfe-accordion-panel>
88-
<p><a href="#">The characters in the portraits</a> are not actually ghosts. They mainly are there just to repeat common phrases or serve as a general <a href="foobarbaz.com">representation of the individual</a> they depict. A portrait of his parents would not be of much help to Harry.</p>
91+
<p><a href="#">Ullamco ullamco sint</a> ex id magna elit deserunt dolore nostrud eu et dolore est Lorem. Esse laborum do ut consectetur occaecat proident et nostrud ut nostrud veniam officia Lorem.</p>
8992
</pfe-accordion-panel>
9093
<pfe-accordion-header>
91-
<h3>Why is Harry considered a half-blood if both of his parents could use magic?</h3>
94+
<h3>Nostrud ad sit commodo nostrud?</h3>
9295
</pfe-accordion-header>
9396
<pfe-accordion-panel>
94-
<p>Because Harry's grandparents were not able to do magic. This is generally frowned upon by those who consider themselves pure, such as the Malfoy's or other antagonists.</p>
97+
<p>Nisi veniam tempor reprehenderit laboris amet laborum et do ut. Veniam eiusmod aliquip ullamco quis esse laborum Lorem exercitation consequat.</p>
9598
</pfe-accordion-panel>
9699
<pfe-accordion-header>
97-
<h3>Is Hogwarts the only wizarding school?</h3>
100+
<h3>Reprehenderit cupidatat labore?</h3>
98101
</pfe-accordion-header>
99102
<pfe-accordion-panel>
100-
<p>No! It has been revealed that there are actually 11 long established and prestigious schools around the globe. These include Castelobruxo in the rainforest of Brazil, Durmstrang Institute (whereas nobody is certain of it’s whereabouts), and Ilvermorny, right here in the United States.</p>
101-
</pfe-accordion-panel>
102-
<pfe-accordion-header>
103-
<h3>Where do the main characters work as adults?</h3>
104-
</pfe-accordion-header>
105-
<pfe-accordion-panel>
106-
<p>Harry and Hermione are at the Ministry: he ends up leading the Auror department. Ron helps George at the joke shop and does very well. Ginny becomes a professional Quidditch player and then sportswriter for the Daily Prophet.</p>
107-
<p><a href="https://www.pottermore.com/collection/characters" target="blank">Read more about the characters</a></p>
103+
<p>Magna incididunt aliquip consectetur dolor adipisicing amet cillum officia nostrud. Elit exercitation voluptate aute nostrud.</p>
104+
<pfe-cta>
105+
<a href="#">Call to action</a>
106+
</pfe-cta>
108107
</pfe-accordion-panel>
109108
</pfe-accordion>
110109
</pfe-band>

elements/pfe-accordion/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,32 @@ Accepts a 0-based index value (integer) for the set of accordion items to collap
117117

118118
Collapse all accordion items.
119119

120+
## Styling hooks
121+
122+
| Theme hook | Description | Default |
123+
| --- | --- | --- |
124+
| `--pfe-accordion--Padding` | Applied to header and panel components | var(--pfe-theme--container-padding, 1rem) calc(var(--pfe-theme--container-padding, 1rem) * 1.5) |
125+
| `--pfe-accordion--BorderColor` | Color of the encompassing borders | var(--pfe-theme--color--surface--border, #d2d2d2) |
126+
| `--pfe-accordion--BorderWidth` | Width of the encompassing borders | var(--pfe-theme--surface--border-width, 1px) |
127+
| `--pfe-accordion--accent--width` | Width of the accent mark | var(--pfe-theme--surface--border-width--active, 3px) |
128+
| `--pfe-accordion--Width` | Maximum width for the accordion element | 100% |
129+
| `--pfe-accordion--MaxWidth--content` | Maximum width for the content inside the accordion panel | 80ch |
130+
| `--pfe-accordion--BoxShadow` | Box shadow on the header and panel in closed state | 0 5px 4px transparent |
131+
| `--pfe-accordion--ZIndex` | Accordion's z-index for the stack | 3 |
132+
| `--pfe-accordion--FontSize--header` | Font-size for the accordion header text | var(--pf-global--FontSize--xl, 1.25rem) |
133+
| `--pfe-accordion--FontWeight--header` | Font-weight for the accordion header text | var(--pfe-theme--font-weight--normal, 400) |
134+
| `--pfe-accordion--TextAlign` | Text alignment for the accordion header text | left |
135+
| `--pfe-accordion--BackgroundColor` | Background color for the accordion header and panel | transparent |
136+
| `--pfe-accordion--Color` | Text color for the accordion header and panel | var(--pfe-broadcasted--text, #3c3f42) |
137+
| `--pfe-accordion--accent` | Left accent line color for the accordion header and panel | transparent |
138+
| `--pfe-accordion--BackgroundColor--active` | Background color when the accordion is active (hover, focus) | var(--pfe-theme--color--surface--lighter, #f0f0f0) |
139+
| `--pfe-accordion--Color--active` | Text color when the accordion is active (hover, focus) | var(--pfe-broadcasted--text, #3c3f42) |
140+
| `--pfe-accordion--accent--active` | Color of the accent mark when the accordion is active (hover, focus) | var(--pfe-theme--color--ui-accent, #06c) |
141+
| `--pfe-accordion--BackgroundColor--expanded` | Background color when the accordion is open | var(--pfe-theme--color--surface--lightest, #fff) |
142+
| `--pfe-accordion--Color--expanded` | Text color when the accordion is open | var(--pfe-broadcasted--text, #3c3f42) |
143+
| `--pfe-accordion--accent--expanded` | Color of the accent mark when the accordion is open | var(--pfe-theme--color--ui-accent, #06c) |
144+
| `--pfe-accordion--BoxShadow--expanded` | Box shadow when the accordion is open | 0 5px 4px rgba(140, 140, 140, 0.35) |
145+
120146
## Test
121147

122148
npm run test

elements/pfe-accordion/demo/demo.css

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ section {
22
padding: 2rem;
33
}
44

5-
pfe-jump-links-nav {
6-
--pfe-accordion__panel-container--Padding: calc(var(--pfe-theme--container-spacer, 1rem) * 1.5);
7-
}
8-
95
.dark-background {
106
background-color: #252525;
117
--context: dark;
@@ -44,35 +40,43 @@ h2 {
4440

4541
/* Example not using context variable */
4642
.custom-styles {
47-
background-color: #e00;
48-
--pfe-broadcasted--text: pink;
43+
background-color: rgb(108, 245, 154);
44+
--context: saturated;
45+
46+
--pfe-broadcasted--text: #444;
4947
--pfe-broadcasted--link: green;
5048
--pfe-broadcasted--link--hover: #eee;
5149
--pfe-broadcasted--link--focus: #fff;
52-
}
5350

54-
.custom-styles pfe-accordion {
55-
--pfe-accordion--accent: #fff;
56-
--pfe-theme--color--ui-accent: #ad41ad;
57-
}
51+
--pfe-accordion--BackgroundColor--active: rgba(255, 255, 255, 0.5);
52+
--pfe-accordion--accent--active: hotpink;
53+
--pfe-accordion--Color--active: inherit;
54+
55+
--pfe-accordion--accent--expanded: hotpink;
56+
--pfe-accordion--BackgroundColor--expanded: pink;
57+
--pfe-accordion--Color--expanded: #000;
5858

59-
.custom-styles pfe-accordion-header[expanded] {
60-
--pfe-accordion--accent: #ad41ad;
59+
--pfe-accordion--BorderColor: #fff;
6160
}
6261

63-
.custom-styles pfe-accordion pfe-accordion {
62+
.custom-styles pfe-accordion-panel pfe-accordion {
63+
--context: light;
64+
6465
--pfe-accordion--accent: initial;
65-
--pfe-theme--color--ui-accent: initial;
66+
--pfe-accordion--accent--expanded: initial;
67+
--pfe-accordion--accent--active: initial;
68+
--pfe-accordion--BackgroundColor--expanded: initial;
69+
--pfe-accordion--Color--expanded: initial;
70+
--pfe-accordion--Color--active: initial;
71+
72+
--pfe-accordion--BorderColor: #fff;
73+
6674
--pfe-broadcasted--text: initial;
6775
--pfe-broadcasted--link: initial;
6876
--pfe-broadcasted--link--hover: initial;
6977
--pfe-broadcasted--link--focus: initial;
7078
}
7179

72-
.custom-styles pfe-accordion pfe-accordion-header[expanded] {
73-
--pfe-accordion--accent: initial;
74-
}
75-
7680
.custom-styles h2 {
7781
margin-top: 0;
7882
}

0 commit comments

Comments
 (0)