-
Notifications
You must be signed in to change notification settings - Fork 51
Hds::Icon
- Add support for predefined "foreground" colors in@color
argument
#2302
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
88a3417
to
8f9669d
Compare
Hds::Icon
- Add support for predefined foreground colors in@color
argumentHds::Icon
- Add support for predefined "foreground" colors in@color
argument
1e4b58e
to
8f9669d
Compare
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 good to me. Added a minor grammar suggestion, but I'm glad that icon color is in alignment with the rest of the components in the system.
8f79082
to
6e2d9c8
Compare
674c392
to
e1f9f46
Compare
|
||
<Shw::Text::H2>Color</Shw::Text::H2> | ||
|
||
<Shw::Text::H4 @tag="h3">Color inheritance</Shw::Text::H4> |
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.
Nit: you could just do <Shw::Text::H3>Color inheritance</Shw::Text::H4>
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.
Missed that the @tag was changed initially. If you want the visual style of the smaller H4 here for some reason then this is fine.
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.
Nit: you could just do Shw::Text::H3Color inheritance</Shw::Text::H4>
<Shw::Text::H4 @tag="h3">
means render an <h3>
tag with the visual style of a .shw-text-h4
|
||
export type HdsIconSizes = `${HdsIconSizeValues}`; | ||
|
||
export enum HdsIconColorValues { |
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.
(question): wouldn't we want all of these to be HdsColorValues anyway? Is there a need to have them specifically in IconColorValues? It seems reasonable that if these are our ColorValues we'd want them available for everywhere that we use these values. WDYT?
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 thought about it, but I ended up keeping them separate for different reasons:
- we may want to add also the "brand" colors for the icon (but not the text, I don't see use cases for that); at the moment thought is not clear how we would do it: have different brand colors, which ones would be the ones that could be used for an icon?
- this would require to add a global
types.ts
file, underpackages/components/src/components/hds
; not a big deal but maybe something we want to consider a bit more
so my thinking is that we can always do it, it's not something for this specific PR
Co-authored-by: Zack Moore <[email protected]>
e1f9f46
to
055a407
Compare
📌 Summary
While reviewing #2274, I realized that we don't support pre-defined "foreground" colors for the
Hds::Icon
, in the same way as we do for theHds::Text
component. This leads to this different way of applying a foreground color:This PR addresses this difference (while the
Hds::Icon
has not yet been released, so it's just an extension of the existing API, without impact on our consumers).Notice: I have tested the change in Cloud UI and it worked as expected
🛠️ Detailed description
In this PR I have:
@color
argument@color
in "Component API" sectionPreview: https://hds-showcase-git-hds-icon-color-argument-hashicorp.vercel.app/components/icon#color
Notice: I haven't added a changelog to this PR because lives on top of the
Hds::Icon
ones, so the changelog is provided by them.🔗 Links
📸 Screenshots
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.