Repository navigation
feat(ui-components): add info variant and hover state to Button component - #45541
Conversation
|
👀 Review this PR in a CodeSee Review Map |
| --default-background-tertiary: var(--gray80); | ||
| --default-background-quaternary: var(--gray75); | ||
| --default-background-danger: var(--red15); | ||
| --default-background-info: var(--blue30); |
There was a problem hiding this comment.
@ahmadabdolsaheb I already forgot why we went with the "default" prefix, but looking at these now, I wonder if we should remove it to keep the variables name a bit shorter. The "default" part implies that there are overrides, but I don't believe we want that.
Same thoughts on the color names in the tailwind config file.
There was a problem hiding this comment.
Might be an anti pattern, but we could just give the foreground color on hover. That way we could cut down on variables.
For instance:
text-default-foreground-primary could become hover:text-default-background-primary
There was a problem hiding this comment.
Let me know if you have done the research on best practices; otherwise the scenario above seems plausible and we could batch it in a pr with the default removals.
There was a problem hiding this comment.
Sorry, I have stepped away from the work a bit.
Your suggestion makes sense now that I'm looking at the variable list again. I think for states (focus, hover, active), we can just use an existing variable instead of having a dedicated set for them, since the states for a button might be different from, say, an <input />.
I'll have a PR to clean these up and add a note on this in the contributing doc 🙂

Checklist:
Update index.md)mainbranch of freeCodeCamp.Ref #45357
This PR adds
infovariant and hover styles to Button component. I'll leave the focus and active state in a next PR, since I'll need to do some research on them.Note: Reviewing by commits is recommended.
Screenshot
Info variant
Hover state