diff --git a/src/components/global/PlaygroundTabs/styles.module.css b/src/components/global/PlaygroundTabs/styles.module.css index 725edd4f7b..d95477e8f5 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 6a7e606fa7..e44e9edfa7 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 07d91cc313..9a443da800 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/README.md b/src/css/README.md index 18a62e0125..0fb5ba0b90 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 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](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 Start each file with its themed variables, then the overrides. diff --git a/src/css/custom.scss b/src/css/custom.scss index 406bb6b5fe..a8d558f7af 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);