Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/global/PlaygroundTabs/styles.module.css
Original file line number Diff line number Diff line change
@@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
line-height: 160%;
letter-spacing: -0.01em;

color: #e9edf3;
color: var(--c-indigo-20);
}
}
}
26 changes: 13 additions & 13 deletions src/components/page/reference/ReleaseNotes/styles.module.css
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
10 changes: 10 additions & 0 deletions src/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading