Skip to content

Comments

style(button): add Tailwind Variants props for size and color to button component and conditional variants#11

Merged
magali-la merged 2 commits intomainfrom
feat/button-component
Oct 14, 2025
Merged

style(button): add Tailwind Variants props for size and color to button component and conditional variants#11
magali-la merged 2 commits intomainfrom
feat/button-component

Conversation

@magali-la
Copy link
Collaborator

🎯Type of Change:

  • Style 🎨: Code formatting or aesthetic changes (CSS).

This PR...

Adds all button variants using Tailwind Variants, including color and size props and compound variant conditionals for edge-case button without a shadow.


📝 What I Did:

  • Read Tailwind Variants documentation to understand syntax for variants and compoundVariants
  • Defined color and size variants based on Figma design specs, using TailwindCSS classes and hex codes
  • Created a base style for all buttons: drop shadows and flex properties
  • Set a default variant state for when no props are passed to a <Button /> component
  • Created a compoundVariant for a specific button type that appears once in the designs
  • Tested all variants by importing <Button /> into App.jsx and trying different prop combinations, including icon buttons

🧪 How to Test:

  1. Run git checkout feat/button-component to go to the feature branch
  2. Import the button component in App.jsx
<Button 
      size='sm'
      color='primary'
      label="Next"
/>
  1. Try different size and color props and labels, using the guide in Button.jsx
  2. Note: labels can be text or a react icon. You can test the circular icon button with this label:
label={<FaArrowRight/>}
  1. Run git restore src/App.jsx to remove all your changes from App.jsx

🤔 What I learned:

  • Learned how to use Tailwind Variants to create scalable, easy-to-import buttons
  • Reflected on reusability and how to make prop usage intuitive for other developers integrating the component into other parts of the app

@netlify
Copy link

netlify bot commented Oct 14, 2025

Deploy Preview for mint-chip ready!

Name Link
🔨 Latest commit beec6d5
🔍 Latest deploy log https://app.netlify.com/projects/mint-chip/deploys/68edd30a038a73000836e499
😎 Deploy Preview https://deploy-preview-11--mint-chip.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@nkabembo nkabembo left a comment

Choose a reason for hiding this comment

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

Works as Intended. Ready to merge

@magali-la magali-la merged commit 6251e73 into main Oct 14, 2025
5 checks passed
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