Skip to content
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

Merged
merged 21 commits into from
Nov 22, 2024

Conversation

anveshmekala
Copy link
Contributor

@anveshmekala anveshmekala commented Oct 22, 2024

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 when active.
--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.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Oct 22, 2024
}

.anchor:hover,
.anchor:focus {
@apply bg-foreground-2;
background-color: var(--calcite-navigation-logo-background-color-hover, var(--calcite-color-foreground-2));
Copy link
Contributor Author

@anveshmekala anveshmekala Oct 22, 2024

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

Copy link
Contributor

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

@anveshmekala anveshmekala marked this pull request as ready for review October 24, 2024 20:09
@anveshmekala anveshmekala added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Oct 25, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Oct 25, 2024
* @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.
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@alisonailea alisonailea left a 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.

* @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.
Copy link
Contributor

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));
Copy link
Contributor

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

Copy link
Contributor Author

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));
Copy link
Contributor

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

@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));
Copy link
Contributor

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)));
}

Copy link
Contributor Author

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)));
  }
}

@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Oct 25, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Nov 14, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Nov 21, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Nov 21, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Nov 22, 2024
@anveshmekala anveshmekala merged commit 0638891 into dev Nov 22, 2024
15 checks passed
@anveshmekala anveshmekala deleted the anveshmekala/7180-navigation-logo-add-tokens branch November 22, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants