Skip to content

Checkbox Component with Tailwind #654

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

Merged
merged 13 commits into from
May 5, 2025

Conversation

bzzz-coding
Copy link
Member

Changes

  • Created Checkbox component styled with Tailwind, according to this Figma design and the existing Checkbox component styled with SASS
  • Added checkboxes on demo-tailwind page

Screenshots, if applicable

Screenshot

@bzzz-coding
Copy link
Member Author

Hey @LoTerence , thanks for reviewing my PR, which I'm not very confident about. My understanding of how a checkbox is focused seems different from the SASS styles in the existing Checkbox component. I see a transition and duration in the SASS code, but Tailwind's peer-focus seems to apply the styles as long as the input is focused. What's correct?

@bzzz-coding bzzz-coding requested a review from LoTerence March 11, 2025 05:06
@LoTerence
Copy link
Member

Hey Bitian, I understand your confusion. Its a pretty complex component now that I'm looking at it.

I see a transition and duration in the SASS code, but Tailwind's peer-focus seems to apply the styles as long as the input is focused. What's correct?

Its not that one is "correct" and the other is "incorrect". They are simply two different approaches of applying the highlight effect style. The difference is in the behavior.

I would like to imitate the behavior of the previous component as much as possible. So the style shouldnt be applied only when the input is focused. Before, it looks like the style was applied when the checkbox is hovered over. We should try to implement it this way as well.

Let me do the Checkbox component. I am going to totally redo it, so its going to be pretty different from Avas version. I will make a new branch off this branch to work off of, and close this PR.

@LoTerence LoTerence closed this Mar 12, 2025
@LoTerence LoTerence removed their request for review March 12, 2025 01:41
@LoTerence
Copy link
Member

Wait a second, I just saw the figma, there is no hover state in Rishi's version of the Checkbox. Is this what you were asking about? Because that changes the behavior of the checkbox entirely.

Could you follow up with Rishi and clarify with him about how the Checkbox is supposed to behave? Your version in tailwind-demo might actually be more correct. Sorry about the confusion.

@LoTerence LoTerence reopened this Mar 12, 2025
@LoTerence
Copy link
Member

Tagging issue #583

@bzzz-coding
Copy link
Member Author

@LoTerence Thanks for tagging the issue! Regarding the step "once the component is fully tested and verified working, remove the .scss file associated with that component and refactor away any old code", should I do this now or should that be done after this PR has been reviewed and merged in?

@LoTerence
Copy link
Member

Hey @bzzz-coding If you could do it now to knock out two birds with one stone, that would be good. If you want to open a new PR for that part, we can do that too.

Check out Benny's PR #663 for an example of fully converting a component from scss to tailwind - it removes the scss and refactors away old code too.

@LoTerence LoTerence self-requested a review April 8, 2025 00:18
Copy link
Member

@LoTerence LoTerence left a comment

Choose a reason for hiding this comment

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

Overall really great!! I just added a few comments to change a couple things, and to remind myself to make some issues to address unrelated bugs I found.

Thanks for doing this Bitian! Please let me know if you have any questions :)

@bzzz-coding
Copy link
Member Author

@LoTerence Thanks for reviewing my PR and providing feedback! I'll make the changes today.

@bzzz-coding bzzz-coding requested a review from LoTerence April 22, 2025 04:01
Copy link
Member

@LoTerence LoTerence left a comment

Choose a reason for hiding this comment

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

Great job Bitian! Just a few small changes and its good to go! I'm glad you are already putting cn to use 😁

bzzz-coding and others added 6 commits May 5, 2025 13:42
* update qualifier page 1

- aligned qualifier nav
- use grid system instead of flex box for items

* Refactor: update button styles for primary-dark theme

* Feat: add ProgressIndicator component and integrate it into QualifierPage2

* Refactor: update border style in QualifierNav component

* Refactor: dynamic grid layout in QualifierPage1 for responsive design

* Feat: enhance RadioButtonForm to support skill selection callback

* Feat: update RadioButtonForm dynamically render skill & experience levels

* Add selectCOP and experience levels props to qualifiers

* Feat: use context in QualiferPage2 to keep track of chosen experience level

* Feat: integrate qualifiers context to manage selected COP in QualifierPage1

* Feat: refactor QualifierPage2 layout and improve skill selection handling

* Refactor:

- renamed experienceLevels to skills_matrix
- refactored to use tw-components/Buttons.tsx & added second style
- Ran npm run lint in frontend directory

* update tech stack

* feat: use new tw-button variant, fix merge

---------

Co-authored-by: Terence Lo <[email protected]>
@LoTerence LoTerence self-requested a review May 5, 2025 21:54
Copy link
Member

@LoTerence LoTerence left a comment

Choose a reason for hiding this comment

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

Looks great! Go ahead and merge!!

@bzzz-coding bzzz-coding merged commit c66b20d into hackforla:develop May 5, 2025
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.

3 participants