[BOOKINGSG-9112][Jaz] Checkbox — Migrate styles to Linaria#1094
[BOOKINGSG-9112][Jaz] Checkbox — Migrate styles to Linaria#1094Jazsley wants to merge 5 commits intopre-release/v4from
Conversation
|
for future PRs: do separate the commits for the different css migration steps. this lets the reviewer view individual commits and makes it easier to spot diffs |
| height: 100%; | ||
| cursor: pointer; | ||
|
|
||
| &[disabled] { |
There was a problem hiding this comment.
hold up. there's a slight discrepancy here with the logic in master branch
when focusableWhenDisabled is true, the checkbox receives disabled={false} and aria-disabled={true}. meaning this style won't be applied. but we should be expecting 1) no hover style and 2) cursor not-allowed but 3) focus ring preserved
verify with this example
<Checkbox disabled focusableWhenDisabled />
| // ========================================================================= | ||
| // Input behaviour | ||
| // ========================================================================= | ||
| describe("input behaviour", () => { |
There was a problem hiding this comment.
can remove this header and this describe block
| await compareScreenshot(story, "variants"); | ||
|
|
||
| await expect(story.layout).toMatchAriaSnapshot(` | ||
| - checkbox "Default" |
There was a problem hiding this comment.
update for the small variant too
| color: ${Colour["icon-primary-subtlest"]}; | ||
| `; | ||
|
|
||
| export const uncheckedDisabledIcon = css` |
There was a problem hiding this comment.
uncheckedDisabledIcon and iconDisabled have the same styling. We should just keep to iconDisabled
…led and removing uncheckedDisabledIcon style
[BOOKINGSG-9112][Jaz] Checkbox — Migrate styles to Linaria
Summary
Migrated the
checkboxcomponent fromstyled-componentsto Linariacsstags, replacing V3 design tokens with V4 equivalents and removing all function interpolations in favour ofclsx-based conditional class application.Changes:
V3_Colour/V3_Motiontokens withColour/Motionfrom themestyledtags to Linariacsstags (@linaria/core)SquareIcon,SquareTickFillIcon, etc.) rendered directly withclassNameapplied viaclsx&:not([disabled]):hover + svgChecklist
classNameis chained correctly withclsx