Skip to content

Commit

Permalink
Fix disabled styles for radio labels (#2256)
Browse files Browse the repository at this point in the history
Co-authored-by: langermank <langermank@users.noreply.github.com>
  • Loading branch information
langermank and langermank authored Sep 25, 2023
1 parent 4449ee7 commit fd17adf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/dull-rules-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@primer/view-components': patch
---

Fix disabled styles for radio

<!-- Changed components: _none_ -->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 18 additions & 3 deletions app/components/primer/alpha/text_field.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,7 @@ input[type='checkbox'].FormControl-checkbox {
}

&[disabled] {
& ~ .FormControl-checkbox-labelWrap,
& ~ .FormControl-radio-labelWrap {
& ~ .FormControl-checkbox-labelWrap {
& .FormControl-label {
color: var(--control-fgColor-disabled);
cursor: not-allowed;
Expand Down Expand Up @@ -664,13 +663,29 @@ input[type='radio'].FormControl-radio {
@mixin minTouchTarget var(--control-medium-size) var(--control-medium-size);
}

&[disabled] {
& ~ .FormControl-radio-labelWrap {
& .FormControl-label {
color: var(--control-fgColor-disabled);
cursor: not-allowed;
}
}
}

&:checked {
border-color: var(--control-checked-borderColor-rest, var(--color-accent-fg));
border-width: var(--base-size-4);

&:disabled {
&[disabled], &:disabled {
cursor: not-allowed;
border-color: var(--control-fgColor-disabled);

& ~ .FormControl-radio-labelWrap {
& .FormControl-label {
color: var(--control-fgColor-disabled);
cursor: not-allowed;
}
}
}
}

Expand Down

0 comments on commit fd17adf

Please sign in to comment.