Skip to content

Styling checkboxes on focus-visible #863

Answered by claviska
mepatterson asked this question in Help
Discussion options

You must be logged in to vote

Not sure what your hover/active states look like, but this should help.

sl-checkbox::part(control) {
  border-color: #181818;
  border-radius: 4px;
  outline-offset: 2px;
  --sl-focus-ring: solid 2px #2663ea;
}

sl-checkbox[checked]::part(control) {
  background-color: white;
  color: black;
}

Example:
https://codepen.io/claviska/pen/poLqqxj?editors=0100

Preview:

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mepatterson
Comment options

@mepatterson
Comment options

@claviska
Comment options

@mepatterson
Comment options

Answer selected by mepatterson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants