Skip to content

style(tabs): added sp-tabs-overflow mod tokens #5386

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

Closed
wants to merge 2 commits into from

Conversation

mizgaionutalexandru
Copy link
Contributor

@mizgaionutalexandru mizgaionutalexandru commented Apr 22, 2025

Description

This PR adds some --mod tokens to the sp-tabs-overflow component's styles to allow further customization.

Added --mod tokens to allow customization of:

  • Tabs Overflow next button position (--mod-sp-tabs-overflow-next-button-right)
  • Tabs Overflow previous button position (--mod-sp-tabs-overflow-previous-button-left)
  • Tabs Overflow shadow color (--mod-sp-tabs-overflow-shadow-color)

Related issue(s)

  • N/A

Motivation and context

With the current styling, this can have an undesired look when the sp-tabs-overflow element does not ocupy the whole width of the parent.
Screenshot 2025-04-22 at 10 04 35

The change will allow for looks similar to this one (see that the gradient fades into the background)
Screenshot 2025-04-22 at 10 05 39

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

Copy link

changeset-bot bot commented Apr 22, 2025

🦋 Changeset detected

Latest commit: 5e577c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 84 packages
Name Type
@spectrum-web-components/tabs Patch
@spectrum-web-components/top-nav Patch
@spectrum-web-components/bundle Patch
documentation Patch
@spectrum-web-components/eslint-plugin Patch
@spectrum-web-components/accordion Patch
@spectrum-web-components/action-bar Patch
@spectrum-web-components/action-button Patch
@spectrum-web-components/action-group Patch
@spectrum-web-components/action-menu Patch
@spectrum-web-components/alert-banner Patch
@spectrum-web-components/alert-dialog Patch
@spectrum-web-components/asset Patch
@spectrum-web-components/avatar Patch
@spectrum-web-components/badge Patch
@spectrum-web-components/breadcrumbs Patch
@spectrum-web-components/button-group Patch
@spectrum-web-components/button Patch
@spectrum-web-components/card Patch
@spectrum-web-components/checkbox Patch
@spectrum-web-components/clear-button Patch
@spectrum-web-components/close-button Patch
@spectrum-web-components/coachmark Patch
@spectrum-web-components/color-area Patch
@spectrum-web-components/color-field Patch
@spectrum-web-components/color-handle Patch
@spectrum-web-components/color-loupe Patch
@spectrum-web-components/color-slider Patch
@spectrum-web-components/color-wheel Patch
@spectrum-web-components/combobox Patch
@spectrum-web-components/contextual-help Patch
@spectrum-web-components/dialog Patch
@spectrum-web-components/divider Patch
@spectrum-web-components/dropzone Patch
@spectrum-web-components/field-group Patch
@spectrum-web-components/field-label Patch
@spectrum-web-components/help-text Patch
@spectrum-web-components/icon Patch
@spectrum-web-components/icons-ui Patch
@spectrum-web-components/icons-workflow Patch
@spectrum-web-components/icons Patch
@spectrum-web-components/iconset Patch
@spectrum-web-components/illustrated-message Patch
@spectrum-web-components/infield-button Patch
@spectrum-web-components/link Patch
@spectrum-web-components/menu Patch
@spectrum-web-components/meter Patch
@spectrum-web-components/modal Patch
@spectrum-web-components/number-field Patch
@spectrum-web-components/overlay Patch
@spectrum-web-components/picker-button Patch
@spectrum-web-components/picker Patch
@spectrum-web-components/popover Patch
@spectrum-web-components/progress-bar Patch
@spectrum-web-components/progress-circle Patch
@spectrum-web-components/radio Patch
@spectrum-web-components/search Patch
@spectrum-web-components/sidenav Patch
@spectrum-web-components/slider Patch
@spectrum-web-components/split-view Patch
@spectrum-web-components/status-light Patch
@spectrum-web-components/swatch Patch
@spectrum-web-components/switch Patch
@spectrum-web-components/table Patch
@spectrum-web-components/tags Patch
@spectrum-web-components/textfield Patch
@spectrum-web-components/thumbnail Patch
@spectrum-web-components/toast Patch
@spectrum-web-components/tooltip Patch
@spectrum-web-components/tray Patch
@spectrum-web-components/underlay Patch
@spectrum-web-components/custom-vars-viewer Patch
@spectrum-web-components/story-decorator Patch
@spectrum-web-components/vrt-compare Patch
@spectrum-web-components/base Patch
@spectrum-web-components/grid Patch
@spectrum-web-components/opacity-checkerboard Patch
@spectrum-web-components/reactive-controllers Patch
@spectrum-web-components/shared Patch
@spectrum-web-components/styles Patch
@spectrum-web-components/theme Patch
@spectrum-web-components/truncated Patch
example-project-rollup Patch
example-project-webpack Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

Branch preview

Review the following VRT differences

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

github-actions bot commented Apr 22, 2025

Tachometer results

Chrome

tabs permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 519 kB 108.70ms - 110.54ms - unsure 🔍
-4% - +1%
-4.34ms - +0.81ms
branch 457 kB 108.98ms - 113.79ms unsure 🔍
-1% - +4%
-0.81ms - +4.34ms
-
Firefox

tabs permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 519 kB 208.04ms - 216.20ms - unsure 🔍
-3% - +2%
-7.18ms - +3.98ms
branch 457 kB 209.92ms - 217.52ms unsure 🔍
-2% - +3%
-3.98ms - +7.18ms
-

Comment on lines +17 to +34
--sp-tabs-overflow-next-button-right: var(
--mod-sp-tabs-overflow-next-button-right,
calc(-1 * var(--spectrum-component-edge-to-text-100))
);
--sp-tabs-overflow-previous-button-left: calc(
-1 * var(--spectrum-component-edge-to-text-100)
--sp-tabs-overflow-previous-button-left: var(
--mod-sp-tabs-overflow-previous-button-left,
calc(-1 * var(--spectrum-component-edge-to-text-100))
);
--sp-tabs-overflow-button-height: calc(
var(--spectrum-tab-item-height-medium) -
var(--spectrum-border-width-200)
);
--sp-tabs-overflow-button-size: var(--spectrum-tab-item-height-medium);
--sp-tabs-overflow-icon-color: var(--spectrum-gray-800);
--sp-tabs-overflow-shadow-color: var(--spectrum-gray-100);
--sp-tabs-overflow-shadow-color: var(
--mod-sp-tabs-overflow-shadow-color,
var(--spectrum-gray-100)
);
Copy link
Contributor

@Rajdeepc Rajdeepc Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a temporary fix and is against the mod inheritance property contract. Please reach out to the channel for better support from the spectrum-css team.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is not in spectrum-css as far as I'm aware. Shouldn't we add these --mod tokens here?

@caseyisonit
Copy link
Contributor

We are going to close this after a discussion in slack. The horizon team is developing their own style of tabs so this is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants