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

WIP: Checkbox element #61

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

WIP: Checkbox element #61

wants to merge 5 commits into from

Conversation

ameseee
Copy link
Collaborator

@ameseee ameseee commented Jun 7, 2021

What does this PR do?

  • Nothin too great yet - just putting up since I don't have any big chunk of work time this week, want to let you know where this is at.

Still need to:

  • get checkmark icon in there (current drawing a checkmark)
  • add transition
  • add focus state

@tannerwelsh I have a question. I am doing something wrong and can not get the visual indicator of focus to work. I am testing it by running the doc site and tabbing through - focus is visual for the nav bar, then I tab 4 times for "nothing" then tab again and stop on a link underneath - so I know those 4 "nothing" tabs are when I'm stopping at the checkboxes. I just can't figure out what I'm missing to get that outline to show up?!

@tannerwelsh tannerwelsh linked an issue Jun 8, 2021 that may be closed by this pull request
6 tasks
@ameseee ameseee requested a review from tannerwelsh June 14, 2021 12:34
Copy link
Contributor

@tannerwelsh tannerwelsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ameseee Took me a sec to realize what the problem was, but then it turned out to be pretty simple :)

In your example code you'd put the <label> before the <input>, but the style for :focus was applied using the "adjacent sibling combinator" in your selector input:focus + label:before. This because there was not label after the input, no style was being applied. Putting the label after the input tag solved the problem :)

BTW, here's how to manually apply :focus on an element using Chrome dev tools:

Screen Shot 2021-06-14 at 9 25 20 AM

FWIW, if this checkbox is too unwieldy I think we could simplify it a bit. I found some good tips on styling checkboxes and radio buttons on MDN - should we try this approach to get our colors into the checkbox style for starters? https://developer.mozilla.org/en-US/docs/Learn/Forms/Advanced_form_styling#styling_checkboxes_and_radio_buttons

^ with the above we wouldn't need to hide the input or import FontAwesome or do any of that other fancy stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Element: Checkboxes
2 participants