Skip to content

Commit dfb76e4

Browse files
authored
fix(toggle): match small readonly to design spec (#20505)
1 parent 62c474d commit dfb76e4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/react/src/components/Toggle/Toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export function Toggle({
203203
{labelText && <Text className={labelTextClasses}>{labelText}</Text>}
204204
<div className={appearanceClasses}>
205205
<div className={switchClasses}>
206-
{isSm && (
206+
{isSm && !readOnly && (
207207
<svg
208208
aria-hidden="true"
209209
focusable="false"

packages/styles/scss/components/toggle/_toggle.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
background-color: transparent;
177177

178178
&::before {
179-
background-color: $text-primary;
179+
background-color: $icon-primary;
180180
inset-block-start: convert.to-rem(2px);
181181
inset-inline-start: convert.to-rem(2px);
182182
}

packages/web-components/src/components/toggle/toggle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CDSToggle extends HostListenerMixin(CDSCheckbox) {
5454
}
5555

5656
protected _renderCheckmark() {
57-
if (this.size !== TOGGLE_SIZE.SMALL) {
57+
if (this.size !== TOGGLE_SIZE.SMALL || this.readOnly == true) {
5858
return undefined;
5959
}
6060
return html`

0 commit comments

Comments
 (0)