How are you supposed to style something like cmdk that depends on data attributes for styling #1411
Unanswered
JonathanLorimer
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I think import { globalStyle } from '@vanilla-extract/css';
globalStyle('[cmdk-item]', {
color: 'red'
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ahh, that's helpful, it solves my immediate use case, but that means there can only ever be one global style for those elements. There are different contexts in which you want to apply different styles. For example if the Still I think this is enough to get me started. Thanks for the quick response! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using
cmdk
as a lib, and it is impossible to style things like the group headers, as the library only exposes a data-attribute to style, and doesn't accept consumer supplied class names.I can't use the global style trick for styling children, because data attributes are considered a complex selector.
Any help would be appreciated, thanks!
Beta Was this translation helpful? Give feedback.
All reactions