From 3a0f3b01c54620a3fb24177cf63376ee72965e4e Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Thu, 19 Nov 2026 17:36:33 -0800 Subject: [PATCH 1/3] style: use ionic-ds tokens for colors that match them exactly --- .../global/PlaygroundTabs/styles.module.css | 2 +- .../NativeEnterpriseCard/index.module.scss | 2 +- .../reference/ReleaseNotes/styles.module.css | 26 +++++++++---------- src/css/custom.scss | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/global/PlaygroundTabs/styles.module.css b/src/components/global/PlaygroundTabs/styles.module.css index 725edd4f7b3..d95477e8f57 100644 --- a/src/components/global/PlaygroundTabs/styles.module.css +++ b/src/components/global/PlaygroundTabs/styles.module.css @@ -1,6 +1,6 @@ /* Dark theme overrides */ [data-theme="dark"] .tabNav { - --tab-nav-btn-background: rgb(34, 45, 58); + --tab-nav-btn-background: var(--c-carbon-90); --tab-nav-btn-color: var(--c-carbon-20); } diff --git a/src/components/page/native/NativeEnterpriseCard/index.module.scss b/src/components/page/native/NativeEnterpriseCard/index.module.scss index 6a7e606fa76..e44e9edfa79 100644 --- a/src/components/page/native/NativeEnterpriseCard/index.module.scss +++ b/src/components/page/native/NativeEnterpriseCard/index.module.scss @@ -67,7 +67,7 @@ line-height: 160%; letter-spacing: -0.01em; - color: #e9edf3; + color: var(--c-indigo-20); } } } diff --git a/src/components/page/reference/ReleaseNotes/styles.module.css b/src/components/page/reference/ReleaseNotes/styles.module.css index 07d91cc313d..9a443da8002 100644 --- a/src/components/page/reference/ReleaseNotes/styles.module.css +++ b/src/components/page/reference/ReleaseNotes/styles.module.css @@ -1,17 +1,17 @@ .release-notes { margin-block-start: 4rem; - --accent-color: #0054e9; + --accent-color: var(--c-blue-100); --accent-color-rgb: 0, 84, 233; - --accent-color-100: #4d8dff; + --accent-color-100: var(--c-blue-70); --accent-color-200: #639cff; - --accent-color-300: #4d8dff; - --accent-color-400: #7cabff; - --accent-color-500: #97bdff; - --accent-color-600: #b2ceff; - --accent-color-700: #cddfff; - --accent-color-800: #e3edff; - --accent-color-900: #f0f6ff; + --accent-color-300: var(--c-blue-70); + --accent-color-400: var(--c-blue-50); + --accent-color-500: var(--c-blue-40); + --accent-color-600: var(--c-blue-30); + --accent-color-700: var(--c-blue-20); + --accent-color-800: var(--c-blue-10); + --accent-color-900: var(--c-blue-0); --background: var(--token-primary-bg-c); --color: var(--ifm-font-color-base); --code-font-family: 'SFMono-Regular', 'Roboto Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace; @@ -104,8 +104,8 @@ text-transform: uppercase; background: transparent; - color: #b2becd; - border: 1px solid #b2becd; + color: var(--c-indigo-50); + border: 1px solid var(--c-indigo-50); border-radius: 14px; height: 24px; padding: 2px 8px; @@ -125,8 +125,8 @@ } .release-note-minor .release-badge { - background: #b2becd; - border-color: #b2becd; + background: var(--c-indigo-50); + border-color: var(--c-indigo-50); color: var(--background, #fff); } diff --git a/src/css/custom.scss b/src/css/custom.scss index 406bb6b5fe7..a8d558f7aff 100644 --- a/src/css/custom.scss +++ b/src/css/custom.scss @@ -63,7 +63,7 @@ html[data-theme='light'] { } html[data-theme='dark'] { - --token-primary-bg-c: #03060b; + --token-primary-bg-c: var(--c-carbon-100); --token-secondary-bg-c: #13171c; --ifm-link-color: var(--c-blue-70); From 03dd220a84fee4cdf8e597143e6f614e7240cce0 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Fri, 20 Nov 2026 10:50:42 -0800 Subject: [PATCH 2/3] docs(css): explain how the site uses the ionic-ds color tokens --- src/css/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/css/README.md b/src/css/README.md index 18a62e01259..ae858a8e917 100644 --- a/src/css/README.md +++ b/src/css/README.md @@ -6,6 +6,16 @@ The `theme` folder overrides markup rendered by `@docusaurus/theme-classic`. Eac Markup rendered by our own swizzled components keeps its styles next to the component in [src/theme](/src/theme), the same way Docusaurus does. A wrapped component's module can also style the upstream markup it renders, scoped under the wrapper's class, when the rule only applies inside that wrapper. For example, `src/theme/TOC/styles.module.css` styles the Edit this page link only where the TOC renders it, while `theme/EditThisPage.scss` styles the link everywhere. Refer to [src/theme/README.md](/src/theme/README.md). +## Colors from ionic-ds + +`customCss` loads `tokens.css` from `@ionic-internal/ionic-ds`, Ionic's design system package, before `custom.scss`, so its custom properties work in every stylesheet, CSS modules included. The site uses its color scales and `--shadow-0`, not its type, spacing, or radius tokens. + +- Each color is a scale from `0`, the lightest, to `100`, the darkest, such as `--c-indigo-50` or `--c-blue-70`. Indigo, carbon, and gray step by 10, the other colors by 5. +- A token has the same value in both themes, so a dark style uses a different step under `html[data-theme='dark']` instead of redefining the token. +- Use a token only when its value is exactly the color you need. A near match changes how the page renders, so keep the hard-coded value instead. + +The values are in [tokens.css](/node_modules/@ionic-internal/ionic-ds/dist/tokens/tokens.css), once dependencies are installed. + ## Writing an override Start each file with its themed variables, then the overrides. From 80f7034f359c0723b0d70073bbf88ca8e9b81ba9 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Mon, 23 Nov 2026 15:25:01 -0800 Subject: [PATCH 3/3] docs(css): fix the token scale ranges and link tokens.css on unpkg Co-authored-by: Shane <561207+ShaneK@users.noreply.github.com> --- src/css/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css/README.md b/src/css/README.md index ae858a8e917..0fb5ba0b901 100644 --- a/src/css/README.md +++ b/src/css/README.md @@ -10,11 +10,11 @@ Markup rendered by our own swizzled components keeps its styles next to the comp `customCss` loads `tokens.css` from `@ionic-internal/ionic-ds`, Ionic's design system package, before `custom.scss`, so its custom properties work in every stylesheet, CSS modules included. The site uses its color scales and `--shadow-0`, not its type, spacing, or radius tokens. -- Each color is a scale from `0`, the lightest, to `100`, the darkest, such as `--c-indigo-50` or `--c-blue-70`. Indigo, carbon, and gray step by 10, the other colors by 5. +- Each color is a scale that gets darker as the number goes up, such as `--c-indigo-50` or `--c-blue-70`. Indigo, carbon, and gray run from `0` to `100`, the other colors from `0` to `200`, all in steps of 10. - A token has the same value in both themes, so a dark style uses a different step under `html[data-theme='dark']` instead of redefining the token. - Use a token only when its value is exactly the color you need. A near match changes how the page renders, so keep the hard-coded value instead. -The values are in [tokens.css](/node_modules/@ionic-internal/ionic-ds/dist/tokens/tokens.css), once dependencies are installed. +The values are in [tokens.css](https://unpkg.com/@ionic-internal/ionic-ds@8/dist/tokens/tokens.css), also at `node_modules/@ionic-internal/ionic-ds/dist/tokens/tokens.css` once dependencies are installed. ## Writing an override