Skip to content

Commit e5a1f6b

Browse files
Fix checkbox and radio button contrast for dark mode (#324)
* fix checkbox contrast in dark mode Fixes #320. The contrast for the "check" and the background in dark mode was not enough, making it seem like the checkbox was uncheckable. * Fix checkbox and radio button checked dark mode styles --------- Co-authored-by: Ian Murray <[email protected]>
1 parent be1e41b commit e5a1f6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/ruby_ui/checkbox/checkbox.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def default_attrs
1717
action: "change->ruby-ui--checkbox-group#onChange change->ruby-ui--form-field#onInput invalid->ruby-ui--form-field#onInvalid"
1818
},
1919
class: [
20-
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background accent-primary",
20+
"peer h-4 w-4 shrink-0 rounded-sm border-input ring-offset-background accent-primary",
2121
"disabled:cursor-not-allowed disabled:opacity-50",
22-
"checked:bg-primary checked:text-primary-foreground",
22+
"checked:bg-primary checked:text-primary-foreground dark:checked:bg-secondary checked:text-primary checked:border-primary",
2323
"aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none",
2424
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
2525
]

lib/ruby_ui/radio_button/radio_button.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def default_attrs
1818
class: [
1919
"h-4 w-4 p-0 border-primary rounded-full flex-none",
2020
"disabled:cursor-not-allowed disabled:opacity-50",
21-
"checked:bg-primary checked:text-primary-foreground",
21+
"checked:bg-primary checked:text-primary-foreground dark:checked:bg-secondary checked:text-primary checked:border-primary",
2222
"aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none"
2323
]
2424
}

0 commit comments

Comments
 (0)