pycodestyle
pycodestyle copied to clipboard
Can't set selection box color through global theming
I've been trying to set the selection box color using the global theming structure as described here.
However, it looks like the selection box color is always overridden by Svelvet:
- The
Svelvetcomponent defines aselectionColorhere, which gets passed toGraph. selectionColorends up passed toSelectionBox. Even thoughSelectionBoxallows itscolorto benull, neitherSvelvetnorGraphallow that, so an actual value will end up getting passed.SelectionBox'scolorproperty ends up used in--prop-selection-box-colorhere, and that takes precedence over the--selection-box-colorproperty suggested by the styling guide on Svelvet's website.
Basically, this means that the only way to properly customize the selection box color is by passing it through a prop. I'd like to avoid that, as I'm using Tailwind CSS in my project, and I'd like to just use the values from Tailwind like the following:
:root[svelvet-theme='my-custom-theme'] {
--selection-box-color: theme(colors.purple.500);
}
theme() is a Tailwind construct that pulls the value straight from the Tailwind theme. I could just figure out what value it is that I'm currently using and copy that value in Svelvet's selectionColor prop, but whenever I change the color in my project, I'll have to remember to also update the prop.
Do you folks have any suggestion on how to fix this? I'm willing to submit a PR, but I'd like to know if there's a preferred way to solve this. My suggestion would be either changing the precedence order here and here to consider --seelction-box-color first, or allow undefined or null in Svelvet and Graph's selectionColor prop.