question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Toggle checkbox color [feature request]

See original GitHub issue

Is it possible to add color prop to <Checkbox toggle />? Right now it’s with !important and it’s not even possible to change color without changing semantic.css.

.ui.toggle.checkbox input:checked~.box:before,
.ui.toggle.checkbox input:checked~label:before {
  background-color: #2185D0 !important
}
.ui.toggle.checkbox input:focus:checked~.box:before,
.ui.toggle.checkbox input:focus:checked~label:before {
  background-color: #0d71bb !important
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
farhansalamcommented, Jan 2, 2018

this works in SUIR

.ui.toggle.checkbox input:focus:checked~.box:before,
.ui.toggle.checkbox input:focus:checked~label:before {
    background-color: teal !important
}

.ui.toggle.checkbox .box:before, .ui.toggle.checkbox label:before {
    background-color: grey;
}

10reactions
lisandelacruzcommented, Jan 16, 2018

@farhansalam solution is great but when the Toggle loses focus, it changes to the default blue color, you also need to add:

.ui.toggle.checkbox input:checked ~ .box:before,
.ui.toggle.checkbox input:checked ~ label:before {
  background-color: #YOUR_CUSTOM_COLOR !important;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic React UI : is there a way to change the background ...
First, a color feature for checkboxes is missing from semantic-ui (as far as I can see, there is no documentation about it at...
Read more >
Checkbox | Semantic UI
A checkbox allows a user to select a value from a small set of options, often binary. ... Toggle. A checkbox can be...
Read more >
Toggle-Switch Guidelines - Nielsen Norman Group
Radio Buttons, Checkboxes, Single Checkbox, Toggle Switches ... Color is an important visual signifier for toggles and there are two things ...
Read more >
<input>: The Input (Form Input) element - HTML
checkbox, A check box allowing single values to be selected/deselected. ... color, A control for specifying a color; opening a color picker ...
Read more >
Understanding Success Criterion 1.4.11: Non-text Contrast | WAI
A black border on a white background indicates the checkbox, the black tick shape indicates the state of checked. Black square border with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found