+
diff --git a/src/components/global/Tooltip/tooltip.css b/src/components/global/Tooltip/styles.module.css
similarity index 96%
rename from src/components/global/Tooltip/tooltip.css
rename to src/components/global/Tooltip/styles.module.css
index 72510f32e9b..704fd46c5d8 100644
--- a/src/components/global/Tooltip/tooltip.css
+++ b/src/components/global/Tooltip/styles.module.css
@@ -3,7 +3,7 @@
* but gives it no appearance, so all of it lives here.
*/
-.tooltip__root {
+.root {
z-index: 9999;
max-width: min(350px, calc(100vw - 10px));
pointer-events: none;
diff --git a/src/components/page/api/EncapsulationPill/index.tsx b/src/components/page/api/EncapsulationPill/index.tsx
index cf0bcece73d..5d96198b28e 100644
--- a/src/components/page/api/EncapsulationPill/index.tsx
+++ b/src/components/page/api/EncapsulationPill/index.tsx
@@ -10,7 +10,7 @@ export default function EncapsulationPill({ type, ...props }: { type: string; cl
const toUrl = useBaseUrl(`reference/glossary#${type}`);
return (
-
+
{type}
);
diff --git a/src/components/page/api/EncapsulationPill/styles.module.scss b/src/components/page/api/EncapsulationPill/styles.module.scss
index 5757634a02a..4f0a4779227 100644
--- a/src/components/page/api/EncapsulationPill/styles.module.scss
+++ b/src/components/page/api/EncapsulationPill/styles.module.scss
@@ -16,6 +16,9 @@
}
.encapsulationPill {
+ position: absolute;
+ top: 0;
+
display: inline-block;
padding: 0.375rem;
diff --git a/src/components/page/intro/AppWizard/index.module.scss b/src/components/page/intro/AppWizard/index.module.scss
index 3116af2fd47..8c84fb80bd0 100644
--- a/src/components/page/intro/AppWizard/index.module.scss
+++ b/src/components/page/intro/AppWizard/index.module.scss
@@ -1,4 +1,4 @@
-@use '../../../../styles/mixins';
+@use '../../../../css/mixins';
.appWizard {
display: flex;
diff --git a/src/components/page/native/NativeEnterpriseCard/index.module.scss b/src/components/page/native/NativeEnterpriseCard/index.module.scss
index 46db6241d58..6a7e606fa76 100644
--- a/src/components/page/native/NativeEnterpriseCard/index.module.scss
+++ b/src/components/page/native/NativeEnterpriseCard/index.module.scss
@@ -1,67 +1,3 @@
-.nativeEnterpriseCards {
- display: flex;
-
- margin-inline-start: -1.5rem;
- margin-block-start: -1.5rem;
-
- @media (max-width: 767px) {
- flex-direction: column;
-
- :global {
- .image-wrapper img {
- max-height: 10rem;
- }
- }
- }
-
- > a {
- display: block;
- margin-inline-start: 1.5rem;
- margin-block-start: 1.5rem;
-
- box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.08), 0px 4px 8px rgba(0, 0, 0, 0.1);
- border-radius: 12px;
- overflow: hidden;
-
- transition: all 150ms ease;
- }
-
- > a:hover,
- > a:active,
- > a:focus {
- transform: translateY(-1px);
- box-shadow: 0 0.35em 1.175em rgba(2, 8, 20, 0.1), 0 0.175em 0.5em rgba(2, 8, 20, 0.08);
- }
-
- :global {
- .heading-group {
- padding: 2rem;
- }
-
- .image-wrapper > img {
- object-fit: cover;
- width: 100%;
- }
-
- header {
- font-weight: 600;
- font-size: 1.25rem;
- line-height: 24px;
- letter-spacing: -0.02em;
- color: var(--ifm-heading-color);
-
- margin-block-end: 0.5rem;
- }
-
- p {
- font-size: 0.875rem;
- line-height: 160%;
- letter-spacing: -0.01em;
- color: var(--ifm-font-color-base);
- }
- }
-}
-
.nativeEnterprise {
margin-top: 2rem;
margin-bottom: 2rem;
diff --git a/src/components/page/theming/ColorGenerator/styles.module.scss b/src/components/page/theming/ColorGenerator/styles.module.scss
index 6a119d03e41..4caa385b3a4 100644
--- a/src/components/page/theming/ColorGenerator/styles.module.scss
+++ b/src/components/page/theming/ColorGenerator/styles.module.scss
@@ -3,17 +3,6 @@
flex-direction: column;
}
-.preview-column {
- max-width: 480px;
- min-height: 700px;
-}
-
-.selector-column {
- max-width: 600px;
- height: 100%;
- overflow-y: scroll;
-}
-
.titleRow {
display: flex;
align-items: center;
@@ -57,15 +46,6 @@
list-style-type: none;
}
-.swatch {
- display: block;
- width: 24px;
- height: 24px;
- border-radius: 24px;
- margin-right: 16px;
- border: 1px solid rgba(0, 0, 0, 0.1);
-}
-
.item {
margin: 0;
position: relative;
diff --git a/src/css/README.md b/src/css/README.md
new file mode 100644
index 00000000000..868b6db34b8
--- /dev/null
+++ b/src/css/README.md
@@ -0,0 +1,57 @@
+# CSS folder
+
+`custom.scss` is the global stylesheet, loaded through `customCss` in [docusaurus.config.js](/docusaurus.config.js). It holds the Infima variable overrides and the base element styles.
+
+The `theme` folder overrides markup rendered by `@docusaurus/theme-classic`. Each file is named after the component it styles, following the theme's own paths, for example `theme/Navbar/MobileSidebar.scss` for `@theme/Navbar/MobileSidebar`. `custom.scss` brings them in with the Sass `@use` rule.
+
+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 still renders upstream's markup inside it, so overrides for that markup stay in `theme/`. For example, `TOC` is wrapped: the wrapper's own classes live in `src/theme/TOC/styles.module.css`, and the overrides for upstream's table of contents live in `theme/TOC.scss`. Refer to [src/theme/README.md](/src/theme/README.md).
+
+## Writing an override
+
+Start each file with its themed variables, then the overrides.
+
+Light themed variables can be targeted using the following selector:
+
+```css
+html[data-theme='light'] {
+ --ifm-menu-color-background-active: red;
+}
+```
+
+Dark themed variables can be targeted using the following selector:
+
+```css
+html[data-theme='dark'] {
+ --ifm-menu-color-background-active: blue;
+}
+```
+
+Global variables can be overridden at root like this:
+
+```css
+:root {
+ --sidebar-spacing-horizontal: 1.5rem;
+}
+```
+
+`#__docusaurus` is the root element the site renders into, so nesting a rule under it matches the same elements but adds an ID's specificity. Use it when a rule overrides a property the theme or Infima already sets on that element. Their rules often tie with ours, and a tie goes to whichever stylesheet loads last, which can differ between dev and production builds. The ID makes ours win either way.
+
+Leave it out for variables, for elements the theme does not style, and in our own CSS modules, whose classes nothing else competes with. Once a rule carries the ID, anything that later overrides it needs the ID too, so add it only where there is a conflict.
+
+```scss
+// The theme's rule: .sidebar_abc { padding: 0.5rem; } specificity 0,1,0
+
+// Ties with the theme's rule, so it may lose depending on load order: 0,1,0
+[class^='sidebar_'] {
+ padding: 1rem;
+}
+
+// Always wins: 1,1,0
+#__docusaurus {
+ [class^='sidebar_'] {
+ padding: 1rem;
+ }
+}
+```
+
+Prefer the stable `theme-` class names from `ThemeClassNames` over the hashed CSS module classes, such as `[class^='docItemCol_']`, since a hashed class can change between Docusaurus versions. Many elements have no `theme-` class, such as the admonition heading, so a hashed selector is the only option there. `[class^='name_']` only matches when that class comes first on the element, so check the upstream markup, or use `[class*='name_']` when other classes come before it.
diff --git a/src/styles/_mixins.scss b/src/css/_mixins.scss
similarity index 79%
rename from src/styles/_mixins.scss
rename to src/css/_mixins.scss
index 6bdbf6c71e3..5204167dec2 100644
--- a/src/styles/_mixins.scss
+++ b/src/css/_mixins.scss
@@ -5,8 +5,8 @@
///
/// `$url` has to be passed by the caller rather than resolved here, because the
/// two places this is used resolve relative paths differently. Sass inlines the
-/// partials under `components/` into `custom.scss`, so their paths are relative
-/// to `src/styles/`, while a `.module.scss` is compiled where it sits and its
+/// partials under `theme/` into `custom.scss`, so their paths are relative
+/// to `src/css/`, while a `.module.scss` is compiled where it sits and its
/// paths are relative to its own directory.
@mixin icon-mask($url, $size: 12px) {
content: '';
diff --git a/src/styles/custom.scss b/src/css/custom.scss
similarity index 59%
rename from src/styles/custom.scss
rename to src/css/custom.scss
index f1133013798..b90e609b15c 100644
--- a/src/styles/custom.scss
+++ b/src/css/custom.scss
@@ -1,27 +1,26 @@
-/* stylelint-disable docusaurus/copyright-header */
/**
- * Any CSS included here will be global. The classic template
- * bundles Infima by default. Infima is a CSS framework designed to
- * work well for content-centric websites.
+ * Global styles, loaded through `customCss` in docusaurus.config.js.
+ *
+ * This file holds the Infima variable overrides and the base element styles.
+ * Overrides for theme components live in `theme/`, one file per component,
+ * named after the component in `@docusaurus/theme-classic`. Components we
+ * swizzle keep their styles next to them in `src/theme`.
*/
-/* You can override the default Infima variables here. */
-
-@use './components/admonition';
-@use './components/back-to-top-button';
-@use './components/code';
-@use './components/doc-item';
-@use './components/doc-root';
-@use './components/doc-sidebar';
-@use './components/edit-this-page';
-@use './components/markdown';
-@use './components/navbar';
-@use './components/navbar-sidebar';
-@use './components/pagination';
-@use './components/search';
-@use './components/table';
-@use './components/tabs';
-@use './components/toc';
+@use './theme/Admonition';
+@use './theme/AnnouncementBar';
+@use './theme/BackToTopButton';
+@use './theme/CodeBlock';
+@use './theme/DocSidebar';
+@use './theme/EditThisPage';
+@use './theme/DocItem/Content';
+@use './theme/Navbar';
+@use './theme/Navbar/MobileSidebar';
+@use './theme/DocPaginator';
+@use './theme/SearchBar';
+@use './theme/MDXComponents/Table';
+@use './theme/Tabs';
+@use './theme/TOC';
:root {
--ifm-background-color: var(--token-primary-bg-c);
@@ -58,7 +57,6 @@ html[data-theme='light'] {
--ifm-heading-color: var(--c-carbon-100);
--ifm-secondary-heading-color: var(--c-carbon-300);
- --ifm-code-background: var(--c-indigo-10);
--ifm-font-color-base: var(--c-carbon-90);
--ifm-info-color-bg: var(--c-carbon-90);
}
@@ -110,18 +108,6 @@ a {
}
}
-body {
- margin: 0;
-}
-
-.theme-doc-version-badge {
- display: none;
-}
-
-ion-grid {
- margin: 1em 0;
-}
-
figure {
margin: 0;
}
@@ -131,11 +117,6 @@ figure > * {
margin: 0 auto;
}
-figure.device {
- max-width: 400px;
- margin: 0 auto;
-}
-
figcaption {
text-align: center;
}
@@ -150,83 +131,8 @@ iframe {
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.1);
}
-.git-link {
- &::before {
- content: '';
- height: 1em;
- width: 1em;
- display: inline-block;
- background-color: currentColor;
- mask-repeat: no-repeat;
- mask-position: center;
- mask-size: 100% 100%;
- mask-image: url(../../static/icons/code-branch.svg);
- vertical-align: -0.1em;
- margin-inline-end: 5px;
- }
-}
-
-.cordova-ee-card {
- max-width: 100%;
-}
-
-.cordova-ee-img {
- width: 50px;
- float: left;
- margin-right: 20px;
-}
-
-.native-ee-detail {
- float: right;
- cursor: pointer;
-}
-
-.cordova-ee-card p {
- margin: 1rem 0 0;
-}
-
-// OS Announcement Bar
-[class*='announcementBar_'] {
- --docusaurus-announcement-bar-height: 3.5rem;
-
- background: linear-gradient(90deg, #440f14, #5e1219 15%, #000 35%, #000 45%, #5e1219 85%, #440f14);
-
- &:hover,
- &:focus,
- &:active {
- strong {
- color: var(--c-red-50);
- }
- }
-}
-
-[class*='announcementBarContent_'] {
- padding: 0;
-
- > a {
- display: flex;
- align-items: center;
- justify-content: center;
- height: var(--docusaurus-announcement-bar-height);
-
- letter-spacing: 0.01em !important;
- text-decoration: none !important;
-
- color: #fff !important;
-
- font-size: 1.04rem;
- font-weight: 500;
-
- strong {
- font-weight: 500;
-
- color: var(--c-red-70);
-
- transition: color 0.2s ease-out;
- }
- }
-}
-
+// Its markdown sets these as plain class names instead of
+// importing a CSS module, so only global rules can match them.
.install-button {
background-color: var(--ifm-info-color-bg);
border: 2px solid var(--ifm-font-color-base);
diff --git a/src/styles/components/_admonition.scss b/src/css/theme/Admonition.scss
similarity index 94%
rename from src/styles/components/_admonition.scss
rename to src/css/theme/Admonition.scss
index df575bd60b8..6741852cc9a 100644
--- a/src/styles/components/_admonition.scss
+++ b/src/css/theme/Admonition.scss
@@ -65,17 +65,13 @@ html[data-theme='dark'] {
}
}
- [class^='admonitionContent_'] {
- p {
- a {
- color: var(--admonition-link-c);
- text-decoration: underline;
- }
+ [class^='admonitionContent_'] p a {
+ color: var(--admonition-link-c);
+ text-decoration: underline;
+ }
- code {
- background: var(--admonition-code-c-bg);
- }
- }
+ [class^='admonitionContent_'] p code {
+ background: var(--admonition-code-c-bg);
}
&::before {
diff --git a/src/css/theme/AnnouncementBar.scss b/src/css/theme/AnnouncementBar.scss
new file mode 100644
index 00000000000..bf88bf3a08f
--- /dev/null
+++ b/src/css/theme/AnnouncementBar.scss
@@ -0,0 +1,40 @@
+.theme-announcement-bar {
+ --docusaurus-announcement-bar-height: 3.5rem;
+
+ background: linear-gradient(90deg, #440f14, #5e1219 15%, #000 35%, #000 45%, #5e1219 85%, #440f14);
+
+ &:hover,
+ &:focus,
+ &:active {
+ strong {
+ color: var(--c-red-50);
+ }
+ }
+}
+
+[class*='announcementBarContent_'] {
+ padding: 0;
+
+ > a {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: var(--docusaurus-announcement-bar-height);
+
+ letter-spacing: 0.01em !important;
+ text-decoration: none !important;
+
+ color: #fff !important;
+
+ font-size: 1.04rem;
+ font-weight: 500;
+
+ strong {
+ font-weight: 500;
+
+ color: var(--c-red-70);
+
+ transition: color 0.2s ease-out;
+ }
+ }
+}
diff --git a/src/styles/components/_back-to-top-button.scss b/src/css/theme/BackToTopButton.scss
similarity index 80%
rename from src/styles/components/_back-to-top-button.scss
rename to src/css/theme/BackToTopButton.scss
index 484aa37bf5a..6509298238e 100644
--- a/src/styles/components/_back-to-top-button.scss
+++ b/src/css/theme/BackToTopButton.scss
@@ -1,6 +1,6 @@
//overrides
#__docusaurus {
- [class*='backToTopButton_'] {
+ .theme-back-to-top-button {
&::after {
mask: var(--ifm-menu-link-sublist-icon) 50% / 1rem 0.75rem no-repeat;
}
diff --git a/src/styles/components/_code.scss b/src/css/theme/CodeBlock.scss
similarity index 89%
rename from src/styles/components/_code.scss
rename to src/css/theme/CodeBlock.scss
index a14f9cb6760..478ba560379 100644
--- a/src/styles/components/_code.scss
+++ b/src/css/theme/CodeBlock.scss
@@ -20,7 +20,6 @@ html[data-theme='dark'] {
:not(pre) > code {
position: relative;
margin-block-start: -0.125rem;
- background-color: inherit;
vertical-align: baseline;
background-color: var(--code-block-bg-c);
@@ -33,7 +32,7 @@ code {
// Overrides
#__docusaurus {
- [class*='codeBlockContainer_'] {
+ .theme-code-block {
--prism-background-color: var(--code-block-bg-c);
box-shadow: none;
@@ -74,15 +73,6 @@ pre[class*='language-'] {
/* box-shadow: 1px 1px .5em black inset; */
}
-/* Inline code */
-:not(pre) > code[class*='language-'] {
- padding: 0.15em 0.2em 0.05em;
- border-radius: 0.3em;
- border: 0.13em solid hsl(30, 20%, 40%);
- box-shadow: 1px 1px 0.3em -0.1em black inset;
- white-space: normal;
-}
-
/* Tomorrow Comment */
.token.comment,
.token.prolog,
diff --git a/src/styles/components/_markdown.scss b/src/css/theme/DocItem/Content.scss
similarity index 60%
rename from src/styles/components/_markdown.scss
rename to src/css/theme/DocItem/Content.scss
index 047ef74d19a..6c5b5f7466c 100644
--- a/src/styles/components/_markdown.scss
+++ b/src/css/theme/DocItem/Content.scss
@@ -1,13 +1,9 @@
html[data-theme='light'] {
- --markdown-toc-title-c: var(--c-indigo-60);
- --markdown-toc-list-item-c: var(--c-indigo-70);
--markdown-text-intro-c: var(--c-carbon-80);
--markdown-bold-c: var(--c-carbon-100);
}
html[data-theme='dark'] {
- --markdown-toc-title-c: #fff;
- --markdown-toc-list-item-c: #fff;
--markdown-text-intro-c: var(--c-indigo-40);
--markdown-bold-c: #fff;
}
@@ -40,11 +36,6 @@ html[data-theme='dark'] {
font-size: 0.813rem;
}
- .encapsulation-pill {
- position: absolute;
- top: 0;
- }
-
> * {
max-width: 100%;
}
@@ -90,8 +81,9 @@ html[data-theme='dark'] {
margin-block-start: 1rem;
}
- //intro paragraphs
- > header + p {
+ // The first two paragraphs after the title are the intro
+ > header + p,
+ > header + p + p {
color: var(--markdown-text-intro-c);
font-size: 1.25rem;
@@ -99,48 +91,5 @@ html[data-theme='dark'] {
> b {
color: var(--markdown-bold-c);
}
-
- + p {
- color: var(--markdown-text-intro-c);
- font-size: 1.25rem;
-
- > strong,
- > b {
- color: var(--markdown-bold-c);
- }
- }
- }
-
- .table-of-contents {
- margin-block-end: 3rem;
-
- list-style: none;
- padding: 0;
-
- &__title {
- color: var(--markdown-toc-title-c);
- margin-block-end: 1.5rem;
-
- font-weight: bold;
- text-transform: uppercase;
- font-size: 0.625rem;
- line-height: 0.75rem;
- letter-spacing: 0.08em;
- }
-
- li {
- color: var(--markdown-toc-list-item-c);
- font-size: 0.75rem;
- line-height: 0.875rem;
- margin: 0;
-
- a {
- color: inherit;
- }
-
- + li {
- margin-block-start: 0.75rem;
- }
- }
}
}
diff --git a/src/css/theme/DocPaginator.scss b/src/css/theme/DocPaginator.scss
new file mode 100644
index 00000000000..7489113b6b3
--- /dev/null
+++ b/src/css/theme/DocPaginator.scss
@@ -0,0 +1,42 @@
+//overrides
+#__docusaurus {
+ .pagination-nav {
+ &__link {
+ border: none;
+
+ transition: color 0.2s ease-out;
+ }
+
+ // Previous item
+ &__link--prev {
+ padding-inline-start: 0;
+ }
+
+ &__link--prev .pagination-nav__label::before {
+ padding-inline-end: var(--icon-padding);
+ background-color: var(--ifm-background-color);
+ transform: translateX(calc(var(--icon-padding) * -1));
+ content: '←';
+ }
+
+ // Next item
+ &__link--next {
+ padding-inline-end: 0;
+ }
+
+ &__link--next .pagination-nav__label::after {
+ padding-inline-start: var(--icon-padding);
+ background-color: var(--ifm-background-color);
+ transform: translateX(calc(-100% + var(--icon-padding)));
+ content: '→';
+ }
+
+ &__label {
+ --icon-padding: 0.25rem;
+ }
+
+ &__sublabel {
+ margin-block-end: 1rem;
+ }
+ }
+}
diff --git a/src/styles/components/_doc-sidebar.scss b/src/css/theme/DocSidebar.scss
similarity index 68%
rename from src/styles/components/_doc-sidebar.scss
rename to src/css/theme/DocSidebar.scss
index e5830d897dc..94078da204d 100644
--- a/src/styles/components/_doc-sidebar.scss
+++ b/src/css/theme/DocSidebar.scss
@@ -29,7 +29,7 @@ html[data-theme='dark'] {
--ifm-menu-color-background-hover: transparent;
}
-//overrides
+// overrides
#__docusaurus {
.theme-doc-sidebar-container {
background: var(--token-primary-bg-c);
@@ -42,18 +42,6 @@ html[data-theme='dark'] {
height: 100vh;
border-inline-end: 1px solid var(--sidebar-border-c);
-
- [class^='sidebarViewport'] {
- // Targets the logo
- > a {
- display: flex;
- align-items: center;
- height: var(--ifm-navbar-height);
-
- padding-inline-start: var(--sidebar-spacing-horizontal);
- padding-inline-end: var(--sidebar-spacing-horizontal);
- }
- }
}
[class^='sidebar_'] {
@@ -88,32 +76,28 @@ html[data-theme='dark'] {
will-change: initial !important;
margin-top: 0;
+ }
- .menu__list {
- .menu__link--sublist {
- margin-inline-start: calc(-1 * (var(--dropdown-icon-width) + var(--dropdown-icon-gap)));
+ .menu__list .menu__list .menu__link--sublist {
+ margin-inline-start: calc(-1 * (var(--dropdown-icon-width) + var(--dropdown-icon-gap)));
- &::after {
- // The chevron icon will have less opacity when it's not on the first level.
- opacity: 0.6;
- }
- }
+ &::after {
+ // The chevron icon will have less opacity when it's not on the first level.
+ opacity: 0.6;
}
+ }
- &-item {
- &:not(:first-child) {
- margin-block-start: 0;
- }
- .menu__list {
- .menu__link {
- padding-inline-start: calc(var(--dropdown-icon-width) + var(--dropdown-icon-gap));
- }
- }
- &-collapsible {
- // This allows the item to be clickable across the entire width of the sidebar.
- display: block;
- }
- }
+ .menu__list-item:not(:first-child) {
+ margin-block-start: 0;
+ }
+
+ .menu__list-item .menu__list .menu__link {
+ padding-inline-start: calc(var(--dropdown-icon-width) + var(--dropdown-icon-gap));
+ }
+
+ .menu__list-item-collapsible {
+ // This allows the item to be clickable across the entire width of the sidebar.
+ display: block;
}
.theme-doc-sidebar-item-category-level-1 > .menu__list > .menu__list-item:last-of-type {
@@ -140,12 +124,10 @@ html[data-theme='dark'] {
background: initial;
}
- &:not(.menu__link--active):not(.menu__link--sublist) {
- &:hover,
- &:active,
- &:focus {
- opacity: 0.7;
- }
+ &:not(.menu__link--active):not(.menu__link--sublist):hover,
+ &:not(.menu__link--active):not(.menu__link--sublist):active,
+ &:not(.menu__link--active):not(.menu__link--sublist):focus {
+ opacity: 0.7;
}
}
@@ -159,7 +141,7 @@ html[data-theme='dark'] {
align-items: center;
flex-direction: row-reverse;
justify-content: flex-end;
-
+
&::after {
background: var(--ifm-menu-link-sublist-icon) center / var(--dropdown-icon-width) var(--dropdown-icon-height);
background-repeat: no-repeat;
@@ -176,15 +158,11 @@ html[data-theme='dark'] {
}
}
- .theme-doc-sidebar-item-category-level-1 {
- & > .menu__list-item-collapsible {
- .menu__link {
- color: var(--sidebar-category-c);
-
- font-weight: 600;
- font-size: 0.938rem;
- line-height: 100%;
- }
- }
+ .theme-doc-sidebar-item-category-level-1 > .menu__list-item-collapsible .menu__link {
+ color: var(--sidebar-category-c);
+
+ font-weight: 600;
+ font-size: 0.938rem;
+ line-height: 100%;
}
}
diff --git a/src/styles/components/_edit-this-page.scss b/src/css/theme/EditThisPage.scss
similarity index 100%
rename from src/styles/components/_edit-this-page.scss
rename to src/css/theme/EditThisPage.scss
diff --git a/src/styles/components/_table.scss b/src/css/theme/MDXComponents/Table.scss
similarity index 69%
rename from src/styles/components/_table.scss
rename to src/css/theme/MDXComponents/Table.scss
index c7d46e881aa..c5d9604dcca 100644
--- a/src/styles/components/_table.scss
+++ b/src/css/theme/MDXComponents/Table.scss
@@ -10,10 +10,6 @@ html[data-theme='dark'] {
--ifm-table-stripe-background: var(--ifm-table-background);
}
-.table-wrapper {
- overflow-x: auto;
-}
-
table,
tr,
td,
@@ -43,23 +39,3 @@ th,
td {
line-height: 1.6;
}
-
-thead th:empty {
- display: none;
-}
-
-.reference-table {
- display: inline-table;
-}
-
-.reference-table th h3 {
- margin: 0;
-}
-
-.reference-table p {
- margin: 0;
-}
-
-.reference-table p + p {
- margin-top: 2em;
-}
diff --git a/src/css/theme/Navbar.scss b/src/css/theme/Navbar.scss
new file mode 100644
index 00000000000..098388dbe0d
--- /dev/null
+++ b/src/css/theme/Navbar.scss
@@ -0,0 +1,266 @@
+@use '../mixins';
+
+html[data-theme='light'] {
+ --navbar-link-c: var(--c-indigo-80);
+
+ --navbar-separator-bg-c: var(--c-indigo-40);
+
+ --ifm-dropdown-background-color: var(--token-secondary-bg-c);
+
+ --navbar-icon-link-c: var(--c-indigo-60);
+}
+
+html[data-theme='dark'] {
+ --navbar-link-c: var(--c-gray-0);
+
+ --navbar-separator-bg-c: var(--c-carbon-80);
+
+ --navbar-icon-link-c: var(--c-white);
+}
+
+:root {
+ --navbar-dropdown-icon: var(--ifm-menu-link-sublist-icon);
+}
+
+//overrides
+#__docusaurus {
+ .navbar {
+ &__inner {
+ width: initial;
+ flex-grow: 1;
+ flex-wrap: nowrap;
+ }
+
+ &__items {
+ min-width: auto;
+ }
+
+ &__items:not(.navbar__items--right) {
+ .navbar__link {
+ @media (max-width: 996px) {
+ display: none;
+ }
+ }
+
+ :not(.cta).navbar__link {
+ @media (min-width: 996px) {
+ display: flex;
+ }
+
+ align-self: stretch;
+ align-items: center;
+
+ position: relative;
+
+ &::after {
+ content: '';
+ position: absolute;
+ height: 2px;
+ left: var(--ifm-navbar-item-padding-horizontal);
+ right: var(--ifm-navbar-item-padding-horizontal);
+ bottom: 0;
+
+ background: rgba(0, 0, 0, 0);
+
+ transition: background-color 0.2s ease-out;
+ }
+ }
+
+ :not(.cta).navbar__link--active {
+ color: var(--ifm-link-color);
+ }
+
+ :not(.cta).navbar__link--active::after {
+ background: var(--ifm-link-color);
+ }
+ }
+
+ &__items .cta {
+ display: flex;
+ align-items: center;
+ align-self: initial;
+
+ padding: 0.375rem 0.625rem;
+
+ background: linear-gradient(90deg, #495fff 0%, #18c6ff 114.68%);
+
+ color: #fff;
+
+ border-radius: 200px;
+
+ white-space: nowrap;
+
+ font-weight: 600;
+ font-size: 0.75rem;
+ line-height: 100%;
+
+ transition: opacity 0.2s ease-out;
+
+ margin-inline-start: 0.5rem;
+
+ @media (max-width: 1400px) {
+ display: none;
+ }
+
+ &:hover,
+ &:active {
+ opacity: 0.8;
+ }
+
+ &::after {
+ @include mixins.icon-mask('../../static/icons/arrow-forward-outline.svg');
+ margin-inline-start: 0.125rem;
+ }
+ }
+
+ &__items--right {
+ flex-grow: 1;
+
+ .icon-link,
+ [class*='toggle_'] {
+ padding: 0.5rem;
+ display: flex;
+
+ transition: opacity 0.2s ease-out;
+ color: var(--navbar-icon-link-c);
+
+ &:hover,
+ &:focus,
+ &:active {
+ opacity: 0.7;
+ }
+ }
+
+ .icon-link-mask::before {
+ content: '';
+ height: 16px;
+ display: flex;
+ background-color: currentColor;
+ mask-repeat: no-repeat;
+ mask-position: center;
+ mask-size: 100% 100%;
+ }
+
+ .icon-link-github::before {
+ mask-image: url("../../static/logos/github.svg");
+ width: 17px;
+ }
+
+ .icon-link-twitter::before {
+ mask-image: url("../../static/logos/twitter.svg");
+ width: 19px;
+ }
+
+ .icon-link-discord::before {
+ mask-image: url("../../static/logos/discord.svg");
+ width: 20px;
+ }
+
+ // Version dropdown
+ div.dropdown:nth-of-type(1) {
+ @media (max-width: 996px) {
+ display: none;
+ }
+ }
+
+ // Community and support dropdowns
+ div.dropdown:nth-of-type(3),
+ div.dropdown:nth-of-type(4) {
+ @media (max-width: 1216px) {
+ display: none;
+ }
+ }
+
+ // Theme toggle
+ div:nth-last-of-type(1) {
+ order: 4;
+ }
+
+ .icon-link-twitter {
+ order: 5;
+ }
+
+ .icon-link-discord {
+ order: 6;
+ }
+
+ .icon-link-github {
+ order: 7;
+ }
+ }
+
+ &__item {
+ transition: opacity 0.2s ease-out;
+
+ display: inline-block;
+ }
+
+ &__item.dropdown {
+ align-self: stretch;
+ display: flex;
+
+ .navbar__link {
+ display: flex;
+ align-items: center;
+
+ &::after {
+ position: static;
+
+ border: none;
+
+ background: var(--ifm-menu-link-sublist-icon) 50% / 0.5rem 0.3rem;
+ background-repeat: no-repeat;
+
+ min-width: 0.5rem;
+ min-height: 0.25rem;
+
+ transform: rotate(180deg) translateY(-0.125rem);
+ }
+ }
+
+ .dropdown__menu {
+ top: 100%;
+ }
+ }
+
+ &__item:not(.navbar__link--active).navbar__link:hover {
+ opacity: 0.8;
+ }
+
+ &__link {
+ font-weight: 500;
+ font-size: 0.875rem;
+ line-height: 17px;
+
+ color: var(--navbar-link-c);
+ }
+
+ &__brand {
+ display: none;
+ }
+
+ &__logo {
+ display: none;
+ }
+
+ .separator {
+ width: 1px;
+ height: 1.75rem;
+ background: var(--navbar-separator-bg-c);
+
+ margin-inline-start: 0.5rem;
+ margin-inline-end: 0.5rem;
+ }
+
+ .language {
+ padding: 0;
+ margin-inline-start: calc(-1 * var(--ifm-navbar-item-padding-horizontal));
+ margin-inline-end: -0.25rem;
+
+ &::after {
+ // Hide the chevron icon
+ display: none;
+ }
+ }
+ }
+}
diff --git a/src/styles/components/_navbar-sidebar.scss b/src/css/theme/Navbar/MobileSidebar.scss
similarity index 63%
rename from src/styles/components/_navbar-sidebar.scss
rename to src/css/theme/Navbar/MobileSidebar.scss
index 2e542a74580..d0e201e73e1 100644
--- a/src/styles/components/_navbar-sidebar.scss
+++ b/src/css/theme/Navbar/MobileSidebar.scss
@@ -5,31 +5,28 @@
&__item {
padding: 1rem var(--ifm-navbar-padding-horizontal);
+ }
- .menu__list {
- .separator {
- display: none;
- }
- .icon-link {
- display: none;
- }
- }
+ &__item .menu__list .separator {
+ display: none;
}
- &__brand {
- .navbar__brand {
- display: flex;
- }
+ &__item .menu__list .icon-link {
+ display: none;
+ }
- .navbar__logo {
- display: block;
- height: auto;
+ &__brand .navbar__brand {
+ display: flex;
+ }
- img {
- display: block;
- height: auto;
- }
- }
+ &__brand .navbar__logo {
+ display: block;
+ height: auto;
+ }
+
+ &__brand .navbar__logo img {
+ display: block;
+ height: auto;
}
.cta {
diff --git a/src/styles/components/_search.scss b/src/css/theme/SearchBar.scss
similarity index 70%
rename from src/styles/components/_search.scss
rename to src/css/theme/SearchBar.scss
index b4c9f141eee..4a927150f64 100644
--- a/src/styles/components/_search.scss
+++ b/src/css/theme/SearchBar.scss
@@ -11,10 +11,8 @@ html[data-theme='light'] {
--search-keys-border-c: var(--c-indigo-20);
- .DocSearch-Button {
- &:hover {
- --docsearch-searchbox-shadow: inset 0 0 0 1px var(--c-indigo-50);
- }
+ .DocSearch-Button:hover {
+ --docsearch-searchbox-shadow: inset 0 0 0 1px var(--c-indigo-50);
}
}
@@ -23,14 +21,12 @@ html[data-theme='dark'] {
--search-keys-border-c: var(--c-gray-80);
- .DocSearch-Button {
- &:hover {
- --docsearch-searchbox-shadow: inset 0 0 0 1px var(--c-gray-70);
- }
+ .DocSearch-Button:hover {
+ --docsearch-searchbox-shadow: inset 0 0 0 1px var(--c-gray-70);
}
}
-//overrides
+// overrides
#__docusaurus {
[class^='navbarSearchContainer_'] {
flex-grow: 1;
@@ -63,26 +59,26 @@ html[data-theme='dark'] {
padding: 0.125rem;
border: 1px solid var(--search-keys-border-c);
border-radius: 6px;
+ }
- .DocSearch-Button-Key {
- position: static;
- margin-inline-end: 0;
- padding-block-end: 0;
+ .DocSearch-Button-Keys .DocSearch-Button-Key {
+ position: static;
+ margin-inline-end: 0;
+ padding-block-end: 0;
- width: auto;
- // DocSearch sizes these keys at 24px with its own font; keep them
- // sized to the surrounding text so the keys stay inside the field.
- height: 18px;
+ width: auto;
+ // DocSearch sizes these keys at 24px with its own font; keep them
+ // sized to the surrounding text so the keys stay inside the field.
+ height: 18px;
- color: var(--c-indigo-50);
- border-radius: 0;
+ color: var(--c-indigo-50);
+ border-radius: 0;
- font-family: inherit;
- font-size: inherit;
- font-weight: 400;
+ font-family: inherit;
+ font-size: inherit;
+ font-weight: 400;
- border: none;
- }
+ border: none;
}
.DocSearch-Search-Icon {
diff --git a/src/css/theme/TOC.scss b/src/css/theme/TOC.scss
new file mode 100644
index 00000000000..9f3fd4cb385
--- /dev/null
+++ b/src/css/theme/TOC.scss
@@ -0,0 +1,26 @@
+html[data-theme='light'] {
+ --toc-separator-c: var(--c-indigo-20);
+ --ifm-toc-link-color: var(--c-indigo-80);
+}
+
+html[data-theme='dark'] {
+ --toc-separator-c: var(--c-carbon-90);
+ --ifm-toc-link-color: var(--c-carbon-0);
+}
+
+//overrides
+#__docusaurus {
+ .theme-doc-toc-desktop {
+ position: static;
+ top: initial;
+ overflow: hidden;
+
+ max-height: initial;
+
+ padding-block-end: 1.25rem;
+
+ border-block-end: 1px solid var(--toc-separator-c);
+
+ line-height: 1.4;
+ }
+}
diff --git a/src/styles/components/_tabs.scss b/src/css/theme/Tabs.scss
similarity index 93%
rename from src/styles/components/_tabs.scss
rename to src/css/theme/Tabs.scss
index fa50e8f9923..87129063643 100644
--- a/src/styles/components/_tabs.scss
+++ b/src/css/theme/Tabs.scss
@@ -43,10 +43,10 @@ html[data-theme='dark'] {
&:hover {
background-color: inherit;
+ }
- &:not(.tabs__item--active) {
- opacity: 0.7;
- }
+ &:hover:not(.tabs__item--active) {
+ opacity: 0.7;
}
}
}
diff --git a/src/styles/README.md b/src/styles/README.md
deleted file mode 100644
index ed31fd126ca..00000000000
--- a/src/styles/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Styles folder
-
-This folder houses a global style file that is brought into the theme in [docusaurus.config.js](/docusaurus.config.js). In addition, there is a components folder that is used to style theme components instead of swizzling them.
-
-Related issue: https://github.com/facebook/docusaurus/pull/5987
-Since theme styles cannot be overridden at the moment, the base #\_\_docusaurus tag is being used to +1 the specificity of selectors.
diff --git a/src/styles/components/README.md b/src/styles/components/README.md
deleted file mode 100644
index 35572b81131..00000000000
--- a/src/styles/components/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# Components folder
-
-This folder is used to style components that are used globally across the site. A good way to setup a file is to include any themed variables at the top, and the override styles below that. All these partials are imported into the base styles with the sass `@use` rule.
-
-Light themed variables can be targeted using the following selector:
-
-```css
-html[data-theme='light'] {
- --ifm-menu-color-background-active: red;
-}
-```
-
-Dark themed variables can be targeted using the following selector:
-
-```css
-html[data-theme='dark'] {
- --ifm-menu-color-background-active: blue;
-}
-```
-
-Global variables can be overridden at root like this:
-
-```css
-:root {
- --sidebar-spacing-horizontal: 1.5rem;
-}
-```
-
-Styles can be overridden like this:
-
-```css
-#__docusaurus {
- .class-to-override {
- margin-block-start: 1rem;
- }
-}
-```
diff --git a/src/styles/components/_doc-item.scss b/src/styles/components/_doc-item.scss
deleted file mode 100644
index 188b022cab1..00000000000
--- a/src/styles/components/_doc-item.scss
+++ /dev/null
@@ -1,78 +0,0 @@
-:root {
- --doc-item-container-width: 42rem;
-}
-
-//overrides
-#__docusaurus {
- //#region ------------ DocItem -------------
- [class*='docItemCol_'] {
- max-width: initial;
- min-width: 0;
-
- @media (min-width: 997px) {
- max-width: initial !important;
- }
- }
-
- [class*='docItemContainer_'] {
- max-width: var(--doc-item-container-width);
- flex-grow: 1;
- min-width: 0;
- }
-
- [class*='docMainContainer_'] {
- .doc-demo-wrapper {
- @media (max-width: 1364px) {
- display: none;
- }
-
- .doc-demo {
- position: sticky;
- top: calc(var(--ifm-navbar-height));
-
- padding-block-end: 32px;
-
- margin-block-start: 5rem;
- overflow-y: auto;
- max-height: calc(100vh - var(--ifm-navbar-height));
- }
- }
-
- > .container {
- > .row {
- > .col {
- display: flex;
- justify-content: center;
-
- min-width: 0;
-
- // Docs Demo
- &.col--4 {
- @media (max-width: 1364px) {
- // The docs demo is hidden on mobile and tablet.
- // Since the docs demo is the only thing in the right column,
- // the column should be hidden as well.
- // Otherwise, it will be a blank column, making it
- // look like there is a lot of empty space.
- display: none;
- }
- }
- }
- }
- }
-
- .spacer {
- flex-basis: 5rem;
-
- @media (max-width: 996px) {
- display: none;
- }
- }
- }
-
- [class^='docItemCol_'] {
- margin-inline-start: auto;
- margin-inline-end: auto;
- }
- //#endregion
-}
diff --git a/src/styles/components/_doc-root.scss b/src/styles/components/_doc-root.scss
deleted file mode 100644
index a7a57df67a3..00000000000
--- a/src/styles/components/_doc-root.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-//overrides
-#__docusaurus {
- [class^='docMainContainer_'] {
- max-width: initial;
-
- > .container {
- max-width: initial;
-
- > .row {
- flex-wrap: nowrap;
- }
- }
- }
-
- [class^='docRoot_'] {
- > div {
- flex-grow: 1;
- min-width: 0;
- }
- }
-}
diff --git a/src/styles/components/_navbar.scss b/src/styles/components/_navbar.scss
deleted file mode 100644
index c526b6ee7b8..00000000000
--- a/src/styles/components/_navbar.scss
+++ /dev/null
@@ -1,300 +0,0 @@
-@use '../mixins';
-
-html[data-theme='light'] {
- --navbar-link-c: var(--c-indigo-80);
-
- --navbar-separator-bg-c: var(--c-indigo-40);
-
- --ifm-dropdown-background-color: var(--token-secondary-bg-c);
-
- --navbar-icon-link-c: var(--c-indigo-60);
-}
-
-html[data-theme='dark'] {
- --navbar-link-c: var(--c-gray-0);
-
- --navbar-separator-bg-c: var(--c-carbon-80);
-
- --navbar-icon-link-c: var(--c-white);
-}
-
-:root {
- --navbar-dropdown-icon: var(--ifm-menu-link-sublist-icon);
-}
-
-//overrides
-#__docusaurus {
-
- .navbar {
- &__inner {
- width: initial;
- flex-grow: 1;
- flex-wrap: nowrap;
- }
-
- &__items {
- min-width: auto;
-
- &:not(.navbar__items--right) {
- .navbar__link {
- @media (max-width: 996px) {
- display: none;
- }
- }
- :not(.cta) {
- &.navbar__link {
- @media (min-width: 996px) {
- display: flex;
- }
-
- align-self: stretch;
- align-items: center;
-
- position: relative;
-
- &::after {
- content: '';
- position: absolute;
- height: 2px;
- left: var(--ifm-navbar-item-padding-horizontal);
- right: var(--ifm-navbar-item-padding-horizontal);
- bottom: 0;
-
- background: rgba(0, 0, 0, 0);
-
- transition: background-color 0.2s ease-out;
- }
-
- &--active {
- color: var(--ifm-link-color);
-
- &::after {
- background: var(--ifm-link-color);
- }
- }
- }
- }
- }
-
- .cta {
- display: flex;
- align-items: center;
- align-self: initial;
-
- padding: 0.375rem 0.625rem;
-
- background: linear-gradient(90deg, #495fff 0%, #18c6ff 114.68%);
-
- color: #fff;
-
- border-radius: 200px;
-
- white-space: nowrap;
-
- font-weight: 600;
- font-size: 0.75rem;
- line-height: 100%;
-
- transition: opacity 0.2s ease-out;
-
- margin-inline-start: 0.5rem;
-
- @media (max-width: 1400px) {
- display: none;
- }
-
- &:hover,
- &:active {
- opacity: 0.8;
- }
-
- &::after {
- @include mixins.icon-mask('../../static/icons/arrow-forward-outline.svg');
- margin-inline-start: 0.125rem;
- }
-
- svg {
- margin-inline-start: 0.125rem;
-
- &[class^='iconExternalLink'] {
- display: none;
- }
- }
- }
-
- &--right {
- flex-grow: 1;
-
- .icon-link,
- [class*='toggle_'] {
- padding: 0.5rem;
- display: flex;
-
- transition: opacity 0.2s ease-out;
- color: var(--navbar-icon-link-c);
-
- &:hover,
- &:focus,
- &:active {
- opacity: 0.7;
- }
- }
-
- .icon-link {
- &-mask {
- &::before {
- content: '';
- height: 16px;
- display: flex;
- background-color: currentColor;
- mask-repeat: no-repeat;
- mask-position: center;
- mask-size: 100% 100%;
- }
- }
-
- &-github {
- &::before {
- mask-image: url("../../static/logos/github.svg");
- width: 17px;
- }
- }
-
- &-twitter {
- &::before {
- mask-image: url("../../static/logos/twitter.svg");
- width: 19px;
- }
- }
-
- &-discord {
- &::before {
- mask-image: url("../../static/logos/discord.svg");
- width: 20px;
- }
- }
- }
-
- div {
- &.dropdown {
- //version dropdown
- &:nth-of-type(1) {
- @media (max-width: 996px) {
- display: none;
- }
- }
- //community and support dropdowns
- &:nth-of-type(3),
- &:nth-of-type(4) {
- @media (max-width: 1216px) {
- display: none;
- }
- }
- }
-
- //theme toggle
- &:nth-last-of-type(1) {
- order: 4;
- }
- }
-
- //twitter icon
- .icon-link-twitter {
- order: 5;
- }
-
- //discord icon
- .icon-link-discord {
- order: 6;
- }
-
- //github icon
- .icon-link-github {
- order: 7;
- }
- }
- }
-
- &__item {
- transition: opacity 0.2s ease-out;
-
- display: inline-block;
-
- &.dropdown {
- align-self: stretch;
- display: flex;
-
- .navbar__link {
- display: flex;
- align-items: center;
-
- &::after {
- position: static;
-
- border: none;
-
- background: var(--ifm-menu-link-sublist-icon) 50% / 0.5rem 0.3rem;
- background-repeat: no-repeat;
-
- min-width: 0.5rem;
- min-height: 0.25rem;
-
- transform: rotate(180deg) translateY(-0.125rem);
- }
- }
-
- .dropdown__menu {
- top: 100%;
- }
- }
-
- &:not(.navbar__link--active) {
- &.navbar__link {
- &:hover {
- opacity: 0.8;
- }
- }
- }
-
- &:not(.dropdown):not(.cta):not(.icon-link-mask) {
-
- }
- }
-
- &__link {
- font-weight: 500;
- font-size: 0.875rem;
- line-height: 17px;
-
- color: var(--navbar-link-c);
- }
-
- &__brand {
- display: none;
- }
-
- &__logo {
- display: none;
- }
-
- .separator {
- width: 1px;
- height: 1.75rem;
- background: var(--navbar-separator-bg-c);
-
- margin-inline-start: 0.5rem;
- margin-inline-end: 0.5rem;
- }
-
- .language {
- padding: 0;
- margin-inline-start: calc(-1 * var(--ifm-navbar-item-padding-horizontal));
- margin-inline-end: -0.25rem;
-
- &::after {
- // Hide the chevron icon
- display: none;
- }
- }
- }
-}
diff --git a/src/styles/components/_pagination.scss b/src/styles/components/_pagination.scss
deleted file mode 100644
index b0ba417b7c9..00000000000
--- a/src/styles/components/_pagination.scss
+++ /dev/null
@@ -1,46 +0,0 @@
-//overrides
-#__docusaurus {
- .pagination-nav {
- &__link {
- border: none;
-
- transition: color 0.2s ease-out;
-
- //Previous item
- &--prev {
- padding-inline-start: 0;
-
- .pagination-nav__label {
- &::before {
- padding-inline-end: var(--icon-padding);
- background-color: var(--ifm-background-color);
- transform: translateX(calc(var(--icon-padding) * -1));
- content: '←';
- }
- }
- }
-
- //Next item
- &--next {
- padding-inline-end: 0;
-
- .pagination-nav__label {
- &::after {
- padding-inline-start: var(--icon-padding);
- background-color: var(--ifm-background-color);
- transform: translateX(calc(-100% + var(--icon-padding)));
- content: '→';
- }
- }
- }
- }
-
- &__label {
- --icon-padding: 0.25rem;
- }
-
- &__sublabel {
- margin-block-end: 1rem;
- }
- }
-}
diff --git a/src/styles/components/_toc.scss b/src/styles/components/_toc.scss
deleted file mode 100644
index 82e1b39f694..00000000000
--- a/src/styles/components/_toc.scss
+++ /dev/null
@@ -1,94 +0,0 @@
-html[data-theme='light'] {
- --toc-separator-c: var(--c-indigo-20);
- --ifm-toc-link-color: var(--c-indigo-80);
-}
-
-html[data-theme='dark'] {
- --toc-separator-c: var(--c-carbon-90);
- --ifm-toc-link-color: var(--c-carbon-0);
-}
-
-:root {
-}
-
-//overrides
-#__docusaurus {
- [class^='tableOfContents_'] {
- position: static;
- top: initial;
- overflow: hidden;
-
- max-height: initial;
-
- padding-block-end: 1.25rem;
-
- border-block-end: 1px solid var(--toc-separator-c);
-
- line-height: 1.4;
- }
-
- .toc-wrapper {
- overflow: auto;
- position: sticky;
- top: calc(var(--ifm-navbar-height) + 16px);
- max-height: calc(100vh - var(--ifm-navbar-height) - 16px);
-
- margin-block-start: 5rem;
-
- padding-block-end: 2rem;
-
- h2 {
- font-size: 0.625rem;
- line-height: 12px;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--c-indigo-60);
- }
-
- .table-of-contents {
- padding: 0;
- margin-inline-start: calc(-1 * var(--ifm-toc-padding-horizontal));
- margin-inline-end: calc(-1 * var(--ifm-toc-padding-horizontal));
-
- > li:first-of-type {
- margin-block-start: 0;
- }
-
- > li:last-of-type {
- margin-block-end: 0;
- }
- }
-
- .theme-edit-this-page {
- --edit-this-page-c: var(--ifm-heading-color);
-
- margin-block-start: 1.25rem;
- font-weight: 600;
- font-size: 0.875rem;
- }
- }
-
- .internal-ad {
- cursor: pointer;
-
- max-width: 148px;
- display: block;
- margin: 48px 0 0;
-
- p {
- font-size: 13px;
- line-height: 19px;
- font-weight: 400;
- letter-spacing: 0.02em;
-
- color: var(--ifm-font-color-base);
- transition: 0.2s color;
- }
- }
-
- [class^='tocCollapsible_'] {
- @media (max-width: 996px) {
- display: none;
- }
- }
-}
diff --git a/src/theme/DocItem/Layout/index.tsx b/src/theme/DocItem/Layout/index.tsx
index a06942b40b2..4b206759b31 100644
--- a/src/theme/DocItem/Layout/index.tsx
+++ b/src/theme/DocItem/Layout/index.tsx
@@ -7,6 +7,7 @@
*
* Reason for overriding:
* - Add a phone demo to the right of the page, e.g. /docs
+ * - Remove the version badge and the mobile table of contents, which the site never shows
*/
import React, {type ReactNode} from 'react';
@@ -15,14 +16,13 @@ import {useWindowSize} from '@docusaurus/theme-common';
import {useDoc} from '@docusaurus/plugin-content-docs/client';
import DocItemPaginator from '@theme/DocItem/Paginator';
import DocVersionBanner from '@theme/DocVersionBanner';
-import DocVersionBadge from '@theme/DocVersionBadge';
import DocItemFooter from '@theme/DocItem/Footer';
import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
import DocItemContent from '@theme/DocItem/Content';
import ContentVisibility from '@theme/ContentVisibility';
import type {Props} from '@theme/DocItem/Layout';
-import styles from '@docusaurus/theme-classic/lib/theme/DocItem/Layout/styles.module.css';
+import styles from './styles.module.css';
// CUSTOM CODE
import Head from '@docusaurus/Head';
@@ -90,13 +90,13 @@ export default function DocItemLayout({children, ...props}: Props): ReactNode {
{/* The banner is rendered per version based on the versions config on docusaurus.config.js */}
{/* ------- CUSTOM CODE END -------- */}
-
+ {/* CUSTOM CODE - add docItemRow */}
+
-
- {docTOC.mobile}
+ {/* CUSTOM CODE - remove and {docTOC.mobile} */}
{children}
@@ -106,8 +106,8 @@ export default function DocItemLayout({children, ...props}: Props): ReactNode {
{/* ------- CUSTOM CODE -------- */}
{/* Ideally this would only render if there is a demoUrl and the it's a mobile device. However,the `windowSize` does not provide a tablet so we have to hide it through CSS. */}
{demoUrl && (
-
-
+
diff --git a/src/theme/DocItem/Layout/styles.module.css b/src/theme/DocItem/Layout/styles.module.css
new file mode 100644
index 00000000000..f19b769db4f
--- /dev/null
+++ b/src/theme/DocItem/Layout/styles.module.css
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+.docItemContainer header + *,
+.docItemContainer article > *:first-child {
+ margin-top: 0;
+}
+
+@media (min-width: 997px) {
+ .docItemCol {
+ max-width: 75% !important;
+ }
+}
+
+/* CUSTOM CODE */
+.docItemCol {
+ max-width: initial;
+ min-width: 0;
+}
+
+@media (min-width: 997px) {
+ .docItemCol {
+ max-width: initial !important;
+ }
+}
+
+.docItemContainer {
+ max-width: var(--doc-item-container-width, 42rem);
+ flex-grow: 1;
+ min-width: 0;
+}
+
+.docItemRow {
+ flex-wrap: nowrap;
+}
+
+.docItemRow > :global(.col) {
+ display: flex;
+ justify-content: center;
+ min-width: 0;
+}
+
+/*
+ * The docs demo is hidden on mobile and tablet. It is the only thing in its
+ * column, so the column is hidden too, or it would leave a blank gap.
+ */
+@media (max-width: 1364px) {
+ .docItemRow > .docDemoCol {
+ display: none;
+ }
+}
+
+.docDemoWrapper > * {
+ position: sticky;
+ top: var(--ifm-navbar-height);
+ max-height: calc(100vh - var(--ifm-navbar-height));
+ margin-block-start: 5rem;
+ padding-block-end: 32px;
+ overflow-y: auto;
+}
+/* CUSTOM CODE END */
diff --git a/src/theme/DocRoot/Layout/Main/index.tsx b/src/theme/DocRoot/Layout/Main/index.tsx
index 1675410fc68..59babc5a002 100644
--- a/src/theme/DocRoot/Layout/Main/index.tsx
+++ b/src/theme/DocRoot/Layout/Main/index.tsx
@@ -10,9 +10,11 @@ import Main from '@theme-original/DocRoot/Layout/Main';
import Navbar from '@theme/Navbar';
import type { Props } from '@theme/DocRoot/Layout/Main';
+import styles from './styles.module.css';
+
export default function MainWrapper(props: Props): ReactNode {
return (
-
+
diff --git a/src/theme/DocRoot/Layout/Main/styles.module.css b/src/theme/DocRoot/Layout/Main/styles.module.css
new file mode 100644
index 00000000000..cabac783777
--- /dev/null
+++ b/src/theme/DocRoot/Layout/Main/styles.module.css
@@ -0,0 +1,10 @@
+.mainWrapper {
+ flex-grow: 1;
+ min-width: 0;
+}
+
+/* Let the docs content use the full width next to the sidebar. */
+.mainWrapper > main,
+.mainWrapper > main > :global(.container) {
+ max-width: initial;
+}
diff --git a/src/theme/DocSidebar/index.tsx b/src/theme/DocSidebar/index.tsx
index e3e9c290b4e..3a9f921924b 100644
--- a/src/theme/DocSidebar/index.tsx
+++ b/src/theme/DocSidebar/index.tsx
@@ -13,6 +13,8 @@ import type { Props } from '@theme/DocSidebar';
import Logo from '@theme-original/Logo';
+import styles from './styles.module.css';
+
export default function DocSidebarWrapper(props: Props): ReactNode {
const location = useLocation();
@@ -27,7 +29,7 @@ export default function DocSidebarWrapper(props: Props): ReactNode {
return (
<>
-
+
>
);
diff --git a/src/theme/DocSidebar/styles.module.css b/src/theme/DocSidebar/styles.module.css
new file mode 100644
index 00000000000..bb811789df5
--- /dev/null
+++ b/src/theme/DocSidebar/styles.module.css
@@ -0,0 +1,6 @@
+.logo {
+ display: flex;
+ align-items: center;
+ height: var(--ifm-navbar-height);
+ padding-inline: var(--sidebar-spacing-horizontal);
+}
diff --git a/src/theme/EditMetaRow/index.tsx b/src/theme/EditMetaRow/index.tsx
index 12606c9f354..c8d36250415 100644
--- a/src/theme/EditMetaRow/index.tsx
+++ b/src/theme/EditMetaRow/index.tsx
@@ -24,7 +24,6 @@ import type {Props} from '@theme/EditMetaRow';
import LastUpdated from '@theme/LastUpdated';
-import globalStyles from '@docusaurus/theme-classic/lib/theme/EditMetaRow/styles.module.css';
import styles from './styles.module.css';
export default function EditMetaRow({
@@ -50,7 +49,7 @@ export default function EditMetaRow({
{/* CUSTOM CODE — "Edit this page | Copy page" as peer links on one row */}
+ className={clsx('col', styles.noPrint, styles.editMetaActions)}>
{editUrl &&
}
+
` or ``, the deepest level this component reaches into. */
type Cell = ReactElement<{ children?: ReactNode }>;
@@ -22,7 +24,7 @@ export default function MDXTable({
const hasTheadValue = !Array.isArray(tableHeadings) || tableHeadings.every(({ props }) => props.children);
return (
-
+
);
diff --git a/src/theme/MDXComponents/Table/styles.module.css b/src/theme/MDXComponents/Table/styles.module.css
new file mode 100644
index 00000000000..34f75bb6e68
--- /dev/null
+++ b/src/theme/MDXComponents/Table/styles.module.css
@@ -0,0 +1,3 @@
+.tableWrapper {
+ overflow-x: auto;
+}
diff --git a/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx b/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
index dc5469c2383..81cf45476d1 100644
--- a/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
+++ b/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
@@ -17,8 +17,7 @@ import IconLanguage from '@theme/Icon/Language';
import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
import type {Props} from '@theme/NavbarItem/LocaleDropdownNavbarItem';
-import styles from '@docusaurus/theme-classic/lib/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css';
-import customStyles from './styles.module.css';
+import styles from './styles.module.css';
function useLocaleDropdownUtils() {
const {
@@ -129,7 +128,7 @@ export default function LocaleDropdownNavbarItem({
<>
{/* CUSTOM CODE - added span in order to hide the text */}
-
+
{dropdownLabel}
>
diff --git a/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css b/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css
index 296d3be96f6..336e50d5f37 100644
--- a/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css
+++ b/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css
@@ -1,13 +1,25 @@
-.localeVisuallyHidden {
- position: absolute;
- position: absolute !important;
- width: 1px !important;
- height: 1px !important;
- padding: 0 !important;
- margin: -1px !important;
- overflow: hidden !important;
- clip: rect(0,0,0,0) !important;
- white-space: nowrap !important;
- border: 0 !important;
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+.iconLanguage {
+ vertical-align: text-bottom;
+ margin-right: 5px;
}
+/* CUSTOM CODE */
+.localeVisuallyHidden {
+ position: absolute !important;
+ width: 1px !important;
+ height: 1px !important;
+ padding: 0 !important;
+ margin: -1px !important;
+ overflow: hidden !important;
+ clip: rect(0, 0, 0, 0) !important;
+ white-space: nowrap !important;
+ border: 0 !important;
+}
+/* CUSTOM CODE END */
diff --git a/src/theme/README.md b/src/theme/README.md
index c831a53cc71..04aceae5c4e 100644
--- a/src/theme/README.md
+++ b/src/theme/README.md
@@ -4,7 +4,17 @@ This folder is used to override the base docusaurus theme. It houses [swizzled c
Wrapped components import from `@theme-original` and are our own code, so they follow the repo's Prettier config. Ejected components are full copies of upstream, so each one is listed in `.prettierignore` by path to keep upstream's formatting so the copy can still be compared against `@docusaurus/theme-classic`. Add that entry as part of ejecting a component. Nothing in CI checks for it, so a missing entry means Prettier reformats the copy and the difference from upstream is lost without anyone noticing.
-All code updates should be marked with comments to allow more seamless version updating. The styles file for components that have been unsafely swizzled should absolutely not be edited. All styling should be done from the [component partials](/src/styles/components).
+All code updates should be marked with comments to allow more seamless version updating.
- Original theme: [`@docusaurus/theme-classic`](https://docusaurus.io/docs/api/themes/@docusaurus/theme-classic)
- [Original theme source](https://github.com/facebook/docusaurus/tree/v3.10.2/packages/docusaurus-theme-classic/src/theme)
+
+## Styles
+
+Where a component's styles live depends on who renders the markup:
+
+- **Ejected:** the markup is ours, so its styles live next to it. Keep a copy of upstream's `styles.module.css`, the same file `docusaurus swizzle --eject` creates, and add our rules between `/* CUSTOM CODE */` and `/* CUSTOM CODE END */`, leaving upstream's rules as they are.
+- **Wrapped:** the wrapper's own markup is styled in its own `styles.module.css`. The upstream markup it renders inside stays upstream's, so overrides for it go in [src/css/theme](/src/css/theme).
+- **Not swizzled:** overrides go in [src/css/theme](/src/css/theme).
+
+When a component that already has a file in `src/css/theme` gets swizzled, wrapping it leaves that file in place. Ejecting it moves the file's rules into the ejected copy's `styles.module.css` and removes the file along with its `@use` in `custom.scss`.
diff --git a/src/theme/TOC/index.tsx b/src/theme/TOC/index.tsx
index 750de6bf10a..149bbe65b58 100644
--- a/src/theme/TOC/index.tsx
+++ b/src/theme/TOC/index.tsx
@@ -19,6 +19,8 @@ import { usePluginData } from '@docusaurus/useGlobalData';
import { PrismicRichText } from '@prismicio/react';
import { useDoc } from '@docusaurus/plugin-content-docs/client';
+import styles from './styles.module.css';
+
interface TOCProps extends Props {
editUrl: string;
}
@@ -38,12 +40,12 @@ export default function TOCWrapper(props: TOCProps): ReactNode {
if (isEmpty) return null;
return (
-
+
Contents
{activeAd && (
-
+
li:first-of-type {
+ margin-block-start: 0;
+}
+
+.tocWrapper :global(.table-of-contents) > li:last-of-type {
+ margin-block-end: 0;
+}
+
+.tocWrapper :global(.theme-edit-this-page) {
+ --edit-this-page-c: var(--ifm-heading-color);
+
+ margin-block-start: 1.25rem;
+ font-weight: 600;
+ font-size: 0.875rem;
+}
+
+.internalAd {
+ cursor: pointer;
+ max-width: 148px;
+ display: block;
+ margin: 48px 0 0;
+}
+
+.internalAd p {
+ font-size: 13px;
+ line-height: 19px;
+ font-weight: 400;
+ letter-spacing: 0.02em;
+ color: var(--ifm-font-color-base);
+ transition: 0.2s color;
+}