Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to target checkbox label with classNames prop #27

Closed
joshenlim opened this issue Jan 6, 2021 · 4 comments
Closed

Unable to target checkbox label with classNames prop #27

joshenlim opened this issue Jan 6, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@joshenlim
Copy link
Member

joshenlim commented Jan 6, 2021

Bug report

I'm trying to implement the Checkbox component but realised that the labels have font weight 500 by default. I tried to pass classNames to the checkbox component but it does not target the <span> tag in the label - I'm wondering if that might be possible?

e.g <Checkbox className="font-normal text-gray-500" />

image

The classes are getting added, but the labels aren't getting the styles

image

@joshenlim joshenlim added the bug Something isn't working label Jan 6, 2021
@joshenlim
Copy link
Member Author

joshenlim commented Jan 6, 2021

Also for dark mode, i noticed that the checkbox has a flicker of an outline / border when you click it if the cursor is not yet focusing on the checkbox option

Screen.Recording.2021-01-07.at.2.33.43.AM.mov

@joshenlim joshenlim changed the title Checkbox font is different from the app Unable to pass classnames to checkbox label Jan 6, 2021
@joshenlim joshenlim changed the title Unable to pass classnames to checkbox label Unable to target checkbox label with classNames prop Jan 6, 2021
@MildTomato
Copy link
Contributor

@joshenlim made new issue for flicker

@MildTomato
Copy link
Contributor

MildTomato commented Jan 7, 2021

I'm not sure about this, hard to really say if the style and classnames should be applied to the Label or the Checkbox its self.

I'll change the font-family and font-weight to be inherit though, but you may also end up overriding the style of the 'description' as well.

@MildTomato
Copy link
Contributor

@joshenlim try this out on new version. should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants