Skip to content

Commit

Permalink
PEW-89: Use token for switch internal label font colour
Browse files Browse the repository at this point in the history
  • Loading branch information
xander-marjoram committed Feb 7, 2025
1 parent 4353805 commit 82efcb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changeset/happy-chairs-watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@justeattakeaway/pie-divider": minor
"@justeattakeaway/pie-icon-button": minor
"@justeattakeaway/pie-modal": minor
"@justeattakeaway/pie-switch": minor
"@justeattakeaway/pie-tag": minor
---

Expand Down
4 changes: 3 additions & 1 deletion packages/components/pie-switch/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export class PieSwitch extends FormControlMixin(RtlMixin(LitElement)) implements
}

return html`
<span data-test-id="switch-label-${labelPlacement}">
<span
data-test-id="switch-label-${labelPlacement}"
class="c-switch-label">
${label}
</span>`;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/components/pie-switch/src/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@
}
}

.c-switch-label {
color: var(--dt-color-content-default);
}

// The description is only required for screen readers so we need to visually hide the description
.c-switch-description {
@include p.visually-hidden;
Expand Down

0 comments on commit 82efcb0

Please sign in to comment.