Table of contents: read block tokens instead of Tailwind and Quanta colors

Open
#229 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
css, markdown
Domain
design, frontend

Research direction

Start in packages/plate/styles/content.css and inspect @plone/theming tokens to choose fallbacks for the two table-of-contents colors. Read docs/how-to-guides/style-blocks-in-a-theme.md for how tokens are documented, then check the visual tests. Done means both rules use block tokens with theme-token fallbacks, the new tokens are listed in the guide, and the visual tests pass.

Written by the indexing model from the issue text.

Description

Two rules in packages/plate/styles/content.css (table of contents, #216) read design values directly instead of their own block tokens, so themes can't retune them the way they can the rest of the content:

Rule Reads Used for
.block-toc__empty var(--color-gray-500, oklch(55.1% 0.027 264.364)) The "Create a heading…" message
.block-toc__highlight var(--color-quanta-sapphire, #0b78d0) at 13% The highlight on a heading after jumping to it

--color-gray-500 is a Tailwind palette value, and --color-quanta-sapphire is a Quanta (CMS UI) value. Neither belongs in content styles that themes without Tailwind or Quanta must be able to set.

To do:

  • Read block tokens with the current values as fallbacks, for example var(--block-toc-empty-color, var(--muted-foreground)) and var(--block-toc-highlight-color, …).
  • Pick fallbacks from @plone/theming's tokens.
  • List the new tokens in docs/how-to-guides/style-blocks-in-a-theme.md.

Reusing a theme token as the fallback may change the color slightly, so check the visual tests.

Dominant language
JavaScript
Stars
10
Forks
9
Avg merge
4d 7h
Merged PRs (30d)
54

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plone/aurora

All issues in plone/aurora

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.