Skip to content

feat(tokens): Tab and Carousel on the design tokens - #257

Merged
aktasmehmet merged 6 commits into
mainfrom
feat/design-tokens-batch-10
Dec 1, 2026
Merged

aktasmehmet merged 6 commits into
mainfrom
feat/design-tokens-batch-10

Conversation

@aktasmehmet

@aktasmehmet aktasmehmet commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Batch 10 of the design token migration: Tab and Carousel, each migrated in place with its old styles kept as a compare baseline. Carousel's theme is replaced by colorScheme and gains a contentBackdrop prop.

What this PR does

  • Token migration: both components take their colors, spacing and text styles from the tokens and work in dark mode.
  • Generator: adds [data-mtf-mode="light"] { color-scheme: light; }, so a subtree can force the light mode inside a dark page (Carousel uses it; additive only).
  • Compare screens: Token Compare → Tab and Carousel (Today · Legacy Light · Legacy Dark · Basic Light).
  • Figma: new Tab and Carousel pages in the "Motif UI Components" library, with their notes in docs/figma/*.md.
  • Lint: the stricter CSS rules cover Tab and Carousel.

Tab

  • underline: tabs text-soft on a 2px border-soft line, hover text-strong on border-strong, the selected tab primary-text on primary-solid.
  • solid: tabs on neutral-soft (hover neutral-soft-hover), the selected tab primary-solid with on-primary; the selected tab keeps the others' height (it lost its 2px line before).
  • Title text-md stronger, disabled text-disabled, Button's 2px focus ring (inset).

Carousel

  • colorScheme: "dark" | "light" (default dark) is the color of the content: dark text, controls and indicators for a bright image, light ones for a dark image. It sets data-mtf-mode on the root, so it holds in every page mode.
  • Controls are IconButton strong and vertically centered; title heading-h5 text-strong, subtitle body-md text-soft; indicators text-softer, hover text-soft, active text-strong.
  • contentBackdrop (new, default false): the page surface at 80% behind the title (2 × 10), the subtitle (0 × 6), the controls (round, 2) and a 2px ring around each indicator.

💥 BREAKING CHANGE: Carousel theme is removed; use colorScheme. theme="light" → drop the prop; theme="dark" → colorScheme="light".

Visible changes (in the change notes)

  • Tab: the token colors; the solid selected tab keeps its height; a keyboard focus ring.
  • Carousel: the controls are centered and readable on a bright image.

Type of Change

  • 🆕 New Component
  • ✨ Feature / Enhancement
  • 🐛 Bug Fix
  • 💥 Breaking Change
  • 📦 Build / Dependency / Docs Update
  • 🧹 Code Refactoring

Screenshots / Preview

Token compare screens (Today · Legacy Light · Legacy Dark · Basic Light):

Tab

tab

Carousel

carousel

Checklist

  • Self-reviewed, no leftover logs or debug code
  • Uses design tokens — no hardcoded style values
  • Accessible (keyboard nav, ARIA, contrast)
  • Tests added/updated and passing
  • Storybook story added/updated

How to Test

  1. npm run storybook: Token Compare → Tab and Carousel.
  2. Carousel "contentBackdrop": the text reads on both images with either colorScheme.
  3. Tab: Tab through the tabs with the keyboard; the focused tab shows the ring.
  4. npm test: all suites pass.
  5. npm run lint, npm run check:type, npm run check:scss, npm run check:mtf-tokens: no errors.

Closes #EDKUI-1252

Tab: underline and solid on the tokens (text-soft rail, primary selected tab, neutral-soft solid tabs of one height),
Button's focus ring. Carousel: theme is replaced by colorScheme, the content's color, which sets data-mtf-mode on the
root; controls are IconButton strong and centered; new contentBackdrop puts a translucent surface behind the text,
the controls and each indicator. The token generator adds a light mode rule so a subtree can force light. Compare
screens with baselines, Figma notes for the two new pages.

BREAKING CHANGE: Carousel theme is removed; use colorScheme (theme="dark" -> colorScheme="light").
@claude

claude Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @aktasmehmet's task in 34s —— View job


Review of #257: Tab and Carousel on the design tokens

I applied general.md, figma.md, tests.md, css.md and design-tokens.md. I did not run tests or lint, since CI covers those.

  • Gathered context and read the review rules
  • Reviewed the Tab, Carousel, generator and stylelint changes
  • Checked the earlier review threads

No blocking issues.

  • .Root (css.md §0): both modules still compile a .Root rule. In Carousel it is the first rule, and $backdrop now sits under @use as asked. .light, .dark { @include retain-scoped-class; } is fine.
  • Tokens: no raw values and no old --theme-* or --base-sizing-* variables mixed in. Radius is mapped by pixel (radius-md for the old 4px). Typography uses roles for these fixed-size parts (heading-h5, body-md, label-lg stronger).
  • Generator: the [data-mtf-mode="light"] rule only adds to the output, and generated/themes/*.css changed together with formats.ts.
  • Baselines: the compare baselines are new files, and I did not review them (design-tokens.md §1).
  • Tests (tests.md §1): the new assertDefaults lines for colorScheme, indicatorShape and autoplayInterval each have a // prop: value comment above them. The old theme test was replaced by the colorScheme test.
  • Earlier threads: all addressed. The disabled and active Tab case can't occur, because TabItem only sets active when the item is not disabled.

Nit (inline on TabItem.tsx:16)

  • styles["tabItem-icon"] is now undefined in the real build: the mixin that defined that class was removed. The test mock hides this. Drop the className, or keep a rule for it.

Visible changes to confirm for the change notes (design-tokens.md §9)

  • Carousel's default content color is now dark. The old theme default was light, which meant a light surface with dark text, so a bare <Carousel> keeps its look. The PR body covers the theme → colorScheme mapping.
  • Carousel controls are now IconButton strong and vertically centered, and Tab gets a focus ring and a solid selected tab that keeps its height. The PR body already lists these.
  • Tab's solid hover used to change the border color. It now changes the fill and text color instead.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Size Change: -248 B (-0.09%)

Total Size: 283 kB

📦 View Changed
Filename Size Change
dist/index.cjs 141 kB -125 B (-0.09%)
dist/index.es.js 140 kB -123 B (-0.09%)
ℹ️ View Unchanged
Filename Size
dist/chunks/useToggle-1pe2WRaw.js 800 B
dist/chunks/useToggle-B6kbi656.cjs 769 B
dist/hooks.cjs 225 B
dist/hooks.es.js 219 B

compressed-size-action

Comment thread src/lib/components/Tab/Tab.module.scss Resolved
- Tab: the title takes the label-lg role (Tab has no size prop), same look
- Carousel: the controls' round radius is set once, the md radius only on the title and subtitle
- Carousel tests: default comments, the dot indicator default, backdrop test name
Comment thread src/lib/components/Tab/Tab.module.scss Resolved
@aktasmehmet
aktasmehmet merged commit 31fe159 into main Dec 1, 2026
16 checks passed
@aktasmehmet
aktasmehmet deleted the feat/design-tokens-batch-10 branch December 1, 2026 06:19

This branch was successfully deployed

1 active deployment
development — 83dcf043 Deployed Nov 30, 2026 by aktasmehmet via Chromatic #580
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.

2 participants