Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"typescriptreact",
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.eslint": "explicit"
},
}
17 changes: 15 additions & 2 deletions css/src/components/switch.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@
}

.Switch-input:focus ~ .Switch-wrapper {
box-shadow: var(--shadow-spread) var(--secondary-shadow);
box-shadow: 0 0 0 var(--spacing-05) var(--shadow-0),
0 0 0 calc(var(--spacing-05) + var(--border-width-05)) var(--primary-focus);
Comment on lines +45 to +46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use tokenized focus shadow variables

The new focus rule hard-codes a full box-shadow recipe in switch.module.css, which violates the repository’s mandatory design-token rule in AGENTS.md (no hard-coded box-shadow rules outside token files) and bypasses the centralized shadow mappings in css/src/variables/index.css; this makes future theme/token updates inconsistent because Switch focus styling will no longer track token-level shadow changes.

Useful? React with 👍 / 👎.

background-color: var(--secondary-light);
}

.Switch-input:focus ~ .Switch-wrapper--checked {
box-shadow: var(--shadow-spread) var(--primary-shadow);
box-shadow: 0 0 0 var(--spacing-05) var(--shadow-0),
0 0 0 calc(var(--spacing-05) + var(--border-width-05)) var(--primary-focus);
background-color: var(--primary);
}

Expand All @@ -63,6 +65,10 @@
background-color: var(--secondary-dark);
}

.Switch-input:active ~ .Switch-wrapper:before {
outline-color: var(--inverse-light);
}

.Switch-input:active ~ .Switch-wrapper--checked {
background-color: var(--primary-darker);
}
Expand All @@ -88,6 +94,8 @@
border-radius: var(--border-radius-full);
box-sizing: border-box;
transition-duration: 80ms;
outline: 1px solid var(--inverse-lighter);
outline-offset: -1px;
Comment on lines +97 to +98

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace literal knob outline pixels with tokens

This introduces fixed pixel values (1px and -1px) for the knob outline, which conflicts with the mandatory design-token guidance in AGENTS.md (“Do not hard-code ... pixel sizes ... outside token files”); using literals here makes Switch sizing less adaptable to token-driven density/scale updates and breaks consistency with the design-system token contract.

Useful? React with 👍 / 👎.

}

.Switch-wrapper--checked {
Expand All @@ -102,6 +110,7 @@
-ms-transform: translateX(100%);
transform: translateX(100%);
transition-duration: 80ms;
outline: none;
}

.Switch--disabled {
Expand All @@ -112,6 +121,10 @@
background-color: var(--secondary-lighter);
}

.Switch-wrapper--disabled:before {
outline-color: var(--secondary-dark);
}

.Switch-wrapper--checkedDisabled {
background-color: var(--primary-lighter);
}