Skip to content

Commit cb71cee

Browse files
committed
Bulletproofs button component
- fixes hover styles - fixes font inheritance and antialiasing - replicates aria roles onto button element
1 parent 457e86e commit cb71cee

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/webviews/apps/shared/components/button.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class GlButton extends LitElement {
4848
cursor: pointer;
4949
border: 1px solid var(--button-border);
5050
border-radius: var(--gk-action-radius, 0.3rem);
51+
-webkit-font-smoothing: auto;
5152
}
5253
5354
.control {
@@ -59,6 +60,7 @@ export class GlButton extends LitElement {
5960
gap: var(--button-gap);
6061
padding: var(--button-padding);
6162
line-height: var(--button-line-height);
63+
font-family: inherit;
6264
6365
color: inherit;
6466
text-decoration: none;
@@ -160,7 +162,7 @@ export class GlButton extends LitElement {
160162
--code-icon-v-align: unset;
161163
}
162164
163-
:host(:hover:not([disabled]):not([aria-checked='true'])) {
165+
:host([aria-checked]:hover:not([disabled]):not([aria-checked='true'])) {
164166
background-color: var(--vscode-inputOption-hoverBackground);
165167
}
166168
@@ -254,7 +256,12 @@ export class GlButton extends LitElement {
254256
><slot name="prefix"></slot><slot class="label"></slot><slot name="suffix"></slot
255257
></a>`;
256258
}
257-
return html`<button class="control" ?disabled=${this.disabled}>
259+
return html`<button
260+
class="control"
261+
role=${ifDefined(this.role)}
262+
aria-checked=${ifDefined(this.ariaChecked)}
263+
?disabled=${this.disabled}
264+
>
258265
<slot name="prefix"></slot><slot class="label"></slot><slot name="suffix"></slot>
259266
</button>`;
260267
}

0 commit comments

Comments
 (0)