Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-clouds-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@patternfly/elements": minor
---

`<pf-button>`: expose `button` part for styling the internal button element
7 changes: 4 additions & 3 deletions elements/pf-button/BaseButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from './BaseButton.css';

/**
* Base button class
*
* @csspart button - Internal button element
* @csspart icon - Container for the icon slot
* @slot icon
* Contains the button's icon or state indicator, e.g. a spinner.
Expand Down Expand Up @@ -57,10 +57,11 @@ export abstract class BaseButton extends LitElement {
override render() {
const { hasIcon } = this;
return html`
<button type="${ifDefined(this.type)}"
<button aria-label="${ifDefined(this.label)}"
class="${classMap({ hasIcon })}"
part="button"
type="${ifDefined(this.type)}"
value="${ifDefined(this.value)}"
aria-label="${ifDefined(this.label)}"
@click="${this.#onClick}"
?disabled="${this.disabled || this.#internals.formDisabled}">
<slot id="icon" part="icon" aria-hidden="true" name="icon">${this.renderDefaultIcon()}</slot>
Expand Down