Skip to content

Help changing the selected state label for sl-option #1318

Answered by claviska
shawnhancock asked this question in Help
Discussion options

You must be logged in to vote

Try this:

sl-option[aria-selected="true"]::part(checked-icon),
sl-option[aria-selected="true"]::part(label) {
  color: white;
}

I'm not sure if you're customizing the color palettes or not, but note that the default themes currently expect colors to work as shown here in the docs:

https://shoelace.style/tokens/color

These color tokens are intended to be perceptually uniform in terms of luminance, so any changes that deviate from that will mess with contrast and likely mean additional custom selectors to "fix" styles like this.

We're working on making it much easier to theme Shoelace in a future release, but I figured I'd mention that in case it helps. Thanks for your patience!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shawnhancock
Comment options

@claviska
Comment options

Answer selected by shawnhancock
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