Skip to content

Commit b9bb7e3

Browse files
authored
fix(button)!: remove shadow <button> (#2707)
* docs(button): fix demo * fix(button)!: remove shadow <button> Closes #2706 * fix(chip): use the new pf-button * test(button): form submit * fix(button): click event on space/enter * test(chip): refactor tests * test: update tests * test(back-to-top): fix a11y assertion * test(dropdown): skip aria attrs assertion see dequelabs/axe-core#4259
1 parent fd1202d commit b9bb7e3

File tree

19 files changed

+689
-633
lines changed

19 files changed

+689
-633
lines changed

.changeset/curly-wings-cross.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/elements": major
3+
---
4+
`<pf-button>`: improves accessibility of elements that use `<pf-button>` by giving the custom element itself the `button` role

elements/pf-back-to-top/test/pf-back-to-top.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('<pf-back-to-top>', function() {
7373
});
7474

7575
it('should be accessible', async function() {
76-
await expect(element).to.be.accessible;
76+
await expect(element).to.be.accessible();
7777
});
7878

7979
describe('pressing the tab key', function() {
@@ -103,7 +103,7 @@ describe('<pf-back-to-top>', function() {
103103
});
104104

105105
it('should be accessible', async function() {
106-
await expect(element).to.be.accessible;
106+
await expect(element).to.be.accessible();
107107
});
108108

109109
describe('pressing the tab key', function() {
@@ -310,4 +310,3 @@ describe('<pf-back-to-top>', function() {
310310
});
311311
});
312312
});
313-

elements/pf-button/demo/variants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<h2>Disabled</h2>
1212
<pf-button disabled>Primary</pf-button>
1313
<pf-button disabled variant="secondary">Secondary</pf-button>
14-
<pf-button disabled variant="secondary" danger>Danger Secondary
14+
<pf-button disabled variant="secondary" danger>Danger Secondary</pf-button>
1515
<pf-button disabled variant="tertiary">Tertiary</pf-button>
1616
<pf-button disabled danger>Danger</pf-button>
1717
<pf-button disabled warning>Warning</pf-button>

elements/pf-button/pf-button-base.css

Lines changed: 0 additions & 91 deletions
This file was deleted.

elements/pf-button/pf-button-icon.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* *
55
******************************/
66

7-
.pf-button.hasIcon {
7+
.hasIcon {
88
gap: calc(2 * var(--pf-c-button__icon--m-start--MarginLeft,
99
var(--pf-global--spacer--xs, 0.25rem)));
1010
}

elements/pf-button/pf-button-plain.css

Lines changed: 0 additions & 60 deletions
This file was deleted.

elements/pf-button/pf-button-tokens.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,7 @@
167167
--pf-c-button--disabled__c-badge--BackgroundColor: var(--pf-global--BackgroundColor--200, #f0f0f0);
168168
--pf-c-button--m-primary__c-badge--BorderColor: var(--pf-global--BorderColor--300, #f0f0f0);
169169
--pf-c-button--m-primary__c-badge--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
170+
171+
--_button-color: var(--pf-c-button--m-primary--Color);
172+
--_button-background-color: var(--pf-c-button--m-primary--BackgroundColor);
170173
}

0 commit comments

Comments
 (0)