-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(gradient): linear gradient mixin #15081
feat(gradient): linear gradient mixin #15081
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@tw15egan Yes, they do. Its |
I also think the word
|
@aagonzales I've updated the token names and now using the color tokens directly 👍 |
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.
Cool! I think this is good for now then. Refined designs of the gradient will come later.
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.
Looks solid to me. I agree the ai-gradient
naming seems a bit off but I'm not sure what I'd prefer more. This is experimental so it's fine for now I think.
I definitely prefer having it specific like this for now instead of just calling it gradient
. We can make future name changes more specific (or less specific) whereas if we named it gradient
we'd be much more locked in.
import './linear-gradient-story.scss'; | ||
|
||
export default { | ||
title: 'Experimental/unstable__LinearGradient', |
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'm not sure about having this in the storybook long term. Feels more like something we should find a way to document in the Themes elements example. Not a blocker for this PR, but something to consider for the future.
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.
Yeah I can remove this before we merge 👍🏻
Yeah I'm struggling to think of a good name for the tokens. "aura" is another option, except that's also what the dynamic, animated element will be called to. Maybe we can call them "ai-aura-dynamic" and "ai-aura-static"? |
6df2660
to
16714df
Compare
5b6ba55
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.
@tw15egan @aagonzales @tay1orjones I understand this has been approved and merged, but here's my 2-cents on naming convention and why it could be beneficial to not use "AI" in any of our token / mixin / component naming.
|
||
/// Experimental - name and structure subject to change. Use at your own risk! | ||
/// Adds AI gradient styles to a component | ||
/// @access public |
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.
Should @access private
be used for experimental? If it's public
, then it's part of our public API as supported.
/// @example @include focus-outline('outline'); | ||
/// @group utilities | ||
|
||
@mixin ai-gradient($direction: 'right', $width: 50%) { |
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'm also questioning our use of ai-
in token and mixin naming. Following the token naming convention shown here, would we want to go with gradient-01
?
This could be more future proof. What happens when everything is "AI". We don't want our code base littered with ai
prefixes/namespaces. A few years from now, that will seem silly.
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.
Yeah @tay1orjones has mentioned the same thing about the "ai" term. We haven't finalized the token name yet just launching something so TJ isn't blocked for the next implementation steps. I think we were going to try and avoid "gradient" as well since that's not scalable (could evolve to something other than a linear gradient). I was thinking it could just be a flavor of "aura" (like aura-static
) or whatever we end up calling that in the AI world.
* feat(gradient): add linear gradient mixin * feat(gradient): add gradient tokens, update demo story * fix(gradient): change default direction * chore(snapshot): update snapshots * refactor(Gradient): use color tokens, update token names * test(snapshot): update snapshots * docs(ai-gradient): mark mixin experimental, update year * chore(storybook): remove test story
Closes #15074
Adds in an
ai-gradient
mixin (what should we call this?) that can be used to add in the AI auralinear-gradient
to components. This takes in adirection
and awidth
, with defaults ofright
and50%
.To Do:
rgba
value found in Figma kit. Do these map to existing colors?Changelog
New
unstable__LinearGradient
ai-gradient
mixin that takes in adirection
and awidth
ai-gradient-start-01
ai-gradient-start-02
ai-gradient-end
Testing / Reviewing
Go to
unstable__linearGradient
and check out the values.