-
Notifications
You must be signed in to change notification settings - Fork 76
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(navigation-logo): add component tokens #10582
feat(navigation-logo): add component tokens #10582
Conversation
} | ||
|
||
.anchor:hover, | ||
.anchor:focus { | ||
@apply bg-foreground-2; | ||
background-color: var(--calcite-navigation-logo-background-color-hover, var(--calcite-color-foreground-2)); |
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 this be --calcite-navigation-logo-background-color-focus
? since #10002 removes background-color on :hover
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.
same as above. I don't think state tokens are necessary here but if they are, first check if the navigation-logo background color is different than navigation? If not, use the same token for both --calcite-navigation-background-color-hover
* @prop --calcite-navigation-logo-border-color: Specifies the border color of the component. | ||
* @prop --calcite-navigation-logo-description-text-color: Specifies text color of description of component. | ||
* @prop --calcite-navigation-logo-heading-text-color: Specifies the text color of heading of component. | ||
* @prop --calcite-navigation-logo-icon-color-press: Specifies the icon color of the component when active. |
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 this be --calcite-navigation-logo-color-press
? The reason for using --calcite-navigation-logo-icon-color-press
is to indicate the color only affects the icon since there is no text at host level other than heading
or description
which has it own tokens.
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.
the heading - description
pattern should be
--calcite-[component]-text-color: Specifies the component's default color for description and icons
--calcite-[component]-heading-text-color: Specifies the component's heading text 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.
I think we can simplify tokens here and leave the extra tailwind changes. We want to keep using the rem styles for now.
packages/calcite-components/src/components/navigation-logo/navigation-logo.scss
Outdated
Show resolved
Hide resolved
* @prop --calcite-navigation-logo-border-color: Specifies the border color of the component. | ||
* @prop --calcite-navigation-logo-description-text-color: Specifies text color of description of component. | ||
* @prop --calcite-navigation-logo-heading-text-color: Specifies the text color of heading of component. | ||
* @prop --calcite-navigation-logo-icon-color-press: Specifies the icon color of the component when active. |
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.
the heading - description
pattern should be
--calcite-[component]-text-color: Specifies the component's default color for description and icons
--calcite-[component]-heading-text-color: Specifies the component's heading text color.
font-size: var(--calcite-font-size-0); | ||
line-height: var(--calcite-font-line-height-fixed-lg); | ||
border-block-end: var(--calcite-spacing-base) solid var(--calcite-navigation-logo-border-color, transparent); | ||
background-color: var(--calcite-navigation-logo-background-color, var(--calcite-color-foreground-1)); |
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.
if the background color of the navigation-logo different than the background color of navigation? If not, use the same token for both --calcite-navigation-background-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.
as discussed in teams, navigation-logo is not expected to use outside of navigation. will fallback this to navigation-background-color
} | ||
|
||
.anchor:hover, | ||
.anchor:focus { | ||
@apply bg-foreground-2; | ||
background-color: var(--calcite-navigation-logo-background-color-hover, var(--calcite-color-foreground-2)); |
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.
same as above. I don't think state tokens are necessary here but if they are, first check if the navigation-logo background color is different than navigation? If not, use the same token for both --calcite-navigation-background-color-hover
packages/calcite-components/src/components/navigation-logo/navigation-logo.scss
Outdated
Show resolved
Hide resolved
@apply text-color-1; | ||
border-color: var(--calcite-color-brand); | ||
--calcite-icon-color: var(--calcite-color-brand); | ||
--calcite-icon-color: var(--calcite-navigation-logo-icon-color-press, var(--calcite-color-brand)); |
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.
this should be
.icon {
color: var(--calcite-navigation-logo-icon-color-press, var(--calcite-icon-color, var(--calcite-color-brand)));
}
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.
does the state tokens apply here?
we can use one token
.icon {
color: var(--calcite-navigation-logo-text-color, var(--calcite-internal-navigation-logo-text-color, var(--calcite-icon-color, inherit)));
}
:host([active]),
:host(:active) {
.icon {
--calcite-internal-navigation-logo-text-color: var(--calcite-icon-color, var(--calcite-color-brand)));
}
}
Related Issue: #7180
Summary
Add the following component-scoped CSS Variables to calcite-navigation-logo:
--calcite-navigation-accent-color
: Specifies the component's border color whenactive
.--calcite-navigation-background-color
: Specifies the component's background color.--calcite-navigation-logo-heading-text-color
: Specifies the component's default color for heading text.--calcite-navigation-logo-text-color
: Specifies the component's default color for icon and description text.