refactor(button): refactor CSS vars - #1030
Conversation
|
Deploy preview for pf-next ready! Built with commit 52a52fd |
Before this PR
After this PR
|
| @@ -16,12 +14,6 @@ | |||
| // Hover state variables | |||
There was a problem hiding this comment.
Maybe in the description you could put "Hover, Focus and Active State Variables" so that we know which variable applies to which states?
| @@ -31,62 +23,30 @@ | |||
| --pf-c-button--m-primary--BackgroundColor: var(--pf-global--primary-color--100); | |||
| --pf-c-button--m-primary--Color: var(--pf-global--Color--light-100); | |||
| --pf-c-button--m-primary--hover--BackgroundColor: var(--pf-global--primary-color--200); | |||
There was a problem hiding this comment.
And then add a description above this hover variable describing that it applies to focus and active for Background Color
There was a problem hiding this comment.
My concern with adding that is that I haven't been adding it to other components where I'm consolidating variables, and it isn't in components that were already written that way where vars are reused and consolidated. I can just add it here, or we can go back and add it everywhere. Do you think it's worth doing? I think it's fine just to read the CSS and figure it out but maybe I'm biased :)
There was a problem hiding this comment.
I do like how we have this comment up above:
// Hover/focus/active state variables
--pf-c-button--hover--BorderWidth: var(--pf-global--BorderWidth--md); --pf-c-button--hover--BorderWidth: var(--pf-global--BorderWidth--md);
Maybe the // Hover/focus/active state variables comment above is sufficient to provide devs enough of a clue that for this component --hover-- refers to hover, focus and active, and any variable further down with --hover-- could be assumed to address those states too? That's assuming that "hover" for hover/focus/active is consistent throughout the css for the component.
There was a problem hiding this comment.
Is that cool with you @christiemolloy? I updated the comment for the first hover var to state that the state vars are shared and represented as a "hover" var for each button variation.
| --pf-c-button--m-secondary--BackgroundColor: transparent; | ||
| --pf-c-button--m-secondary--BorderColor: var(--pf-global--primary-color--100); | ||
| --pf-c-button--m-secondary--Color: var(--pf-global--primary-color--100); | ||
| --pf-c-button--m-secondary--hover--BackgroundColor: transparent; |
There was a problem hiding this comment.
And then since the states dont change variables, you could make a note of the fact that these variables carry over to H,F,A
fixes #985