-
Notifications
You must be signed in to change notification settings - Fork 1
[WIP] feat(tag): add color emphasis #131
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Olaf Kappes <okappes@qti.qualcomm.com>
4404222 to
099c7e1
Compare
R-Bower
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question about colors
|
|
||
| &:active { | ||
| background: | ||
| linear-gradient(var(--color-interactive-background-ghost-pressed) 0 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused by the linear gradient. Why use this instead of a static color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah! that's a point I wanted to address with Steve on Monday.
it looks like Figma is stacking the base color with background/hover rather than using a dedicated one:

(blue medium is used for the border, forget about it)
so I transposed that mechanism the best I could (could've probably used color-mix too) in the meantime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah, I see now. Here's the Figma CSS for the blue emphasis hover state (I removed the var fallbacks for clarity)
background:
linear-gradient(
0deg, var(--color-interactive-background-ghost-hover) 0%,
var(--color-interactive-background-ghost-hover) 100%),
var(--color-category-blue-subtle)
);This continues for the other colors, but only the last var changes. So we could declare this linear gradient once and swap out the last color based on the emphasis.
&:hover {
background:
linear-gradient(
0deg, var(--color-interactive-background-ghost-hover) 0%,
var(--color-interactive-background-ghost-hover) 100%),
var(--hover-bg)
);
}
&[data-emphasis="blue"] {
--hover-bg: var(--color-category-blue-subtle);
}
&[data-emphasis="green"] {
--hover-bg: var(--color-category-green-subtle);
}
/* etc... */
R-Bower
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit: see my previous review. Accidentally hit "Approve"
No description provided.