feat(tabs, tab-nav, tab-title, tab): add component tokens#11720
feat(tabs, tab-nav, tab-title, tab): add component tokens#11720aPreciado88 merged 48 commits intodevfrom
Conversation
…ciado88/7180-add-tabs-design-tokens
…ciado88/7180-add-tabs-design-tokens
…ciado88/7180-add-tabs-design-tokens
…ciado88/7180-add-tabs-design-tokens
…ciado88/7180-add-tabs-design-tokens
| import { getIconScale } from "../../utils/component"; | ||
| import { IconNameOrString } from "../icon/interfaces"; | ||
| import { isBrowser } from "../../utils/browser"; | ||
| import { XButton } from "../functional/XButton"; |
There was a problem hiding this comment.
Do we want to separate this x button refactor into a separate PR (applies to changes to other components like Button, Combobox)
There was a problem hiding this comment.
I think it's fine, but I'll defer to you. IIRC, the ✖️ button needed to be adjusted for the tabs tokens work.
There was a problem hiding this comment.
We can install this as is 🚀
|
|
||
| padding-block: var( | ||
| --calcite-tab-content-space-y, | ||
| var(--calcite-tab-content-block-padding, var(--calcite-internal-tabs-content-space-y-fallback)) |
There was a problem hiding this comment.
Is this -fallback portion needed?
There was a problem hiding this comment.
I can take the -fallback bit out
| <> | ||
| <slot name={SLOTS.titleGroup} /> | ||
| <section> | ||
| <section class={CSS.section}> |
There was a problem hiding this comment.
Don't think this is required. We can leverage tag selector in theme tests.
There was a problem hiding this comment.
Applies to resource & e2e files.
There was a problem hiding this comment.
@anveshmekala I tried using tag selection but the test won't pass. I looked at other themed tests and couldn't find a tag selection example setup that works, other than using the section class as a selector.
There was a problem hiding this comment.
Interesting, it is working for me as expected. I might be missing something here. Attached ref #11778
There was a problem hiding this comment.
It works using your setup, I'll update the PR with your update. Thank you!
…ciado88/7180-add-tabs-design-tokens
| } | ||
|
|
||
| &:host(:hover) .container::after { | ||
| background-color: var(--calcite-tab-background-color, var(--calcite-color-foreground-2)); |
There was a problem hiding this comment.
I think this should be --calcite-tab-background-color-hover to customize the hover background-color which has a different default value.
Applies to other places in this file.
|
|
||
| export const CSS = { | ||
| container: "tab-nav", | ||
| container: "container", |
There was a problem hiding this comment.
Nitpick: No longer required.
geospatialem
left a comment
There was a problem hiding this comment.
Great stuff! Have a few doc-consistency suggestions for consideration. 📚
LGTM! |
…ciado88/7180-add-tabs-design-tokens
jcfranco
left a comment
There was a problem hiding this comment.
Awesome stuff! 🚀 Good to merge after addressing relevant comments.
| } | ||
|
|
||
| @mixin x-button( | ||
| $size: "var(--calcite-internal-close-size, 1.5rem /* 24px */)", |
There was a problem hiding this comment.
This can be done in a follow-up, but let's remove the comment. We don't need to annotate conversions.
| $size: "var(--calcite-internal-close-size, 1.5rem /* 24px */)", | ||
| $padding: "0", | ||
| $color: "var(--calcite-close-icon-color, var(--calcite-color-text-1))", | ||
| $backgroundColor: "var(--calcite-close-background-color, var(--calcite-color-transparent))", |
There was a problem hiding this comment.
For consistency, can you rename the arguments to be kebab-cased? This can also be done separately if desired.
|
|
||
| // #region Private Properties | ||
|
|
||
| private closeButtonEl = createRef<HTMLButtonElement>(); |
| @apply flex; | ||
| } | ||
|
|
||
| .cancel-editing-button[appearance="transparent"][kind="neutral"] { |
There was a problem hiding this comment.
Are these changes related? If not, can we submit these in a separate PR?
There was a problem hiding this comment.
This doesn't seem to be related to tabs, it was in the original tabs PR so I included it. I can take this part out and submit it separately 🐱👤
There was a problem hiding this comment.
I did a bit more digging, this is related to the changes in button. I'll add this back in.
|
|
||
| describe("theme", () => { | ||
| describe("default", () => { | ||
| themed(html`<calcite-tab-nav bordered"></calcite-tab-nav>`, { |
There was a problem hiding this comment.
The default tests shouldn't use bordered, right?
There was a problem hiding this comment.
I updated this, thanks for catching it!
| }); | ||
| }); | ||
|
|
||
| describe("bottom position", () => { |
There was a problem hiding this comment.
Should this go into the bordered test above?
| scrollButtonContainer: "scroll-button-container", | ||
| scrollBackwardContainerButton: "scroll-button-container--backward", | ||
| scrollForwardContainerButton: "scroll-button-container--forward", | ||
| tabNav: "tab-nav", |
There was a problem hiding this comment.
For consistency, the root element in an element should use container as the key and value for the CSS class lookup. The previous code wasn't using the proper class, so I'll defer to you whether to fix this here or in a follow-up PR.
jcfranco
left a comment
There was a problem hiding this comment.
Awesome stuff! 🚀 Good to merge after addressing relevant comments.
…ciado88/7180-add-tabs-design-tokens
…ciado88/7180-add-tabs-design-tokens
…ciado88/7180-add-tabs-design-tokens
|
@jcfranco I updated the PR with the requested changes! |
…ciado88/7180-add-tabs-design-tokens
**Related Issue:** [#7180](#7180) ## Summary Add css tokens to the following components. ### Tabs `--calcite-tab-background-color`: When `bordered`, specifies the component's background color. `--calcite-tab-border-color`: Specifies the component's border color. ### Tab-nav `--calcite-tab-background-color`: When `calcite-tabs` is `bordered`, specifies the component's background color. `--calcite-tab-border-color`: When `calcite-tabs` is `bordered`, specifies the component's border color. `--calcite-tab-text-color`: Specifies the component's `iconStart`, `iconEnd`, and text color. ### Tab-title `--calcite-tab-text-color`: Specifies the component's text color. `--calcite-tab-border-color`: Specifies the component's border color. `--calcite-tab-background-color`: Specifies the component's background color. `--calcite-tab-background-color-hover`: When `calcite-tabs` is `bordered`, specifies the component's background color when hovered. `--calcite-tab-accent-color-press`: Specifies the component's accent color when selected or active. `--calcite-tab-close-icon-color`: Specifies the component's close element icon color. `--calcite-tab-close-icon-color-press`: Specifies the component's close element icon color when hovered, focused, and active. `--calcite-tab-close-icon-background-color`: Specifies the component's close element icon background color. `--calcite-tab-close-icon-background-color-press`: Specifies the component's close element icon background color when hovered, focused, and active. ### Tab `--calcite-tab-content-space-y`: Specifies the vertical space between the component's content in the `default` slot. --------- Co-authored-by: Anveshreddy mekala <anv11827@esri.com>
Related Issue: #7180
Summary
Add css tokens to the following components.
Tabs
--calcite-tab-background-color: Whenbordered, specifies the component's background color.--calcite-tab-border-color: Specifies the component's border color.Tab-nav
--calcite-tab-background-color: Whencalcite-tabsisbordered, specifies the component's background color.--calcite-tab-border-color: Whencalcite-tabsisbordered, specifies the component's border color.--calcite-tab-text-color: Specifies the component'siconStart,iconEnd, and text color.Tab-title
--calcite-tab-text-color: Specifies the component's text color.--calcite-tab-border-color: Specifies the component's border color.--calcite-tab-background-color: Specifies the component's background color.--calcite-tab-background-color-hover: Whencalcite-tabsisbordered, specifies the component's background color when hovered.--calcite-tab-accent-color-press: Specifies the component's accent color when selected or active.--calcite-tab-close-icon-color: Specifies the component's close element icon color.--calcite-tab-close-icon-color-press: Specifies the component's close element icon color when hovered, focused, and active.--calcite-tab-close-icon-background-color: Specifies the component's close element icon background color.--calcite-tab-close-icon-background-color-press: Specifies the component's close element icon background color when hovered, focused, and active.Tab
--calcite-tab-content-space-y: Specifies the vertical space between the component's content in thedefaultslot.