diff --git a/package-lock.json b/package-lock.json index e85873f64a..2364b1567a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "ai-unlimited-docs", "version": "0.0.0", "dependencies": { - "@bsahitya/react-components": "^0.0.9", + "@bsahitya/react-components": "^0.1.0", "@covalent/tokens": "^8.10.1", "@docusaurus/core": "3.2.0", "@docusaurus/preset-classic": "3.2.0", @@ -2099,9 +2099,9 @@ "integrity": "sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==" }, "node_modules/@bsahitya/react-components": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@bsahitya/react-components/-/react-components-0.0.9.tgz", - "integrity": "sha512-On4siWbXvE0Kh/jA6PgiTdIErEJUnhBfwUKvWpVKXvuET+vs75F35idBUXvf2KiHYAetzIB8y2Ehl+XOiSiR0w==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@bsahitya/react-components/-/react-components-0.1.0.tgz", + "integrity": "sha512-upRFWUHe8R3QzUJmeQm4K8pqF4eY8fd6j/rOhAvVvM4hsXYQmRPcgLJtyjN7adiLqyN1lgHPdrSFKoukIF/nmw==", "peerDependencies": { "@covalent/components": "^8.10.1", "@covalent/icons": "^8.10.1", diff --git a/package.json b/package.json index 6901e3113c..ceb69b3600 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@bsahitya/react-components": "^0.0.9", + "@bsahitya/react-components": "^0.1.0", "@covalent/tokens": "^8.10.1", "@docusaurus/core": "3.2.0", "@docusaurus/preset-classic": "3.2.0", diff --git a/src/css/custom.css b/src/css/custom.css index 8985359988..f801a10f9b 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -32,7 +32,6 @@ --ifm-color-secondary-contrast-background: var(--cv-theme-light-colors-surface-variant); --ifm-color-secondary-contrast-foreground: var(--cv-theme-light-colors-on-surface-container); - --ifm-color-success-dark: var(--cv-theme-light-colors-positive); --ifm-color-success-contrast-background: var(--cv-theme-light-colors-positive-container); --ifm-color-success-contrast-foreground: var(--cv-theme-light-colors-on-positive-container); @@ -51,6 +50,7 @@ --ifm-breadcrumb-item-background-active: none; --ifm-breadcrumb-color-active: #5e7484; --mdc-theme-surface-canvas: var(--cv-theme-surface-container); + --ifm-toc-link-color: var(--Gray-700, #333a3e); } body { @@ -77,6 +77,14 @@ aside.theme-doc-sidebar-container { border-right: none; } +.alert a:hover { + text-decoration-thickness: 1px; +} + +.alert--secondary a { + text-decoration-color: #333a3e; +} + .markdown h1:first-child { color: #00233C; @@ -179,15 +187,13 @@ html:not(.plugin-pages).plugin-search-algolia .main-wrapper { --ifm-menu-color-background-hover: none; } -.menu__list-item--collapsed { - .menu__caret:before { - transform: rotateZ(0); - margin-left: calc(var(--ifm-menu-link-padding-horizontal) / 2); - } +.menu__list-item--collapsed .menu__caret:before { + transform: rotate(0); + margin-left: calc(var(--ifm-menu-link-padding-horizontal) / 2); +} - .menu__link--sublist-caret:before { - transform: rotateZ(0); - } +.menu__list-item--collapsed .menu__link--sublist-caret:before { + transform: rotate(0); } .menu__link--sublist-caret:after { @@ -196,7 +202,7 @@ html:not(.plugin-pages).plugin-search-algolia .main-wrapper { .menu__link--sublist-caret:before { content: ''; - background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem; + background: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem; filter: var(--ifm-menu-link-sublist-icon-filter); height: 1.25rem; transform: rotate(90deg); @@ -205,7 +211,8 @@ html:not(.plugin-pages).plugin-search-algolia .main-wrapper { } .menu__caret:before { - transform: rotateZ(90deg); + background: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem; + transform: rotate(90deg); margin-left: calc(var(--ifm-menu-link-padding-horizontal) / 2); } @@ -231,6 +238,42 @@ html:not(.plugin-pages).plugin-search-algolia .main-wrapper { padding-left: 24px; } +.table-of-contents__link { + font-size: 0.75rem; + line-height: 1.25rem; +} + +.table-of-contents, +.table-of-contents ul { + padding-left: 0; +} + +.table-of-contents__left-border { + border-left: none; +} + +.table-of-contents__link--active { + color: var(--ifm-toc-link-color); + font-weight: 700; +} + +.table-of-contents ul a { + padding-left: calc(var(--ifm-toc-padding-horizontal) * 2.25); +} + +.table-of-contents li { + margin: 0; +} + +.table-of-contents__link { + padding: 0.375rem var(--ifm-toc-padding-horizontal); + border-left: 2px solid var(--cv-theme-primary-20); +} + +.table-of-contents__link--active { + border-left: 2px solid var(--cv-theme-primary); +} + .breadcrumbs__item:first-child .breadcrumbs__link { padding-left: 0; } @@ -267,6 +310,7 @@ html.plugin-search-algolia .main-wrapper .container { margin: 0 auto; width: 100%; } + html:not(.plugin-pages).plugin-search-algolia .main-wrapper { padding: 0; margin: 0 auto; @@ -281,4 +325,4 @@ html.plugin-search-algolia .main-wrapper .container { html[data-navbar='false'] .navbar { display: none; -} +} \ No newline at end of file diff --git a/src/theme/Admonition/Layout/index.tsx b/src/theme/Admonition/Layout/index.tsx new file mode 100644 index 0000000000..30c310ec55 --- /dev/null +++ b/src/theme/Admonition/Layout/index.tsx @@ -0,0 +1,61 @@ +import React, { type ReactNode } from 'react'; +import clsx from 'clsx'; +import { ThemeClassNames } from '@docusaurus/theme-common'; + +import type { Props } from '@theme/Admonition/Layout'; + +import styles from './styles.module.css'; + +function AdmonitionContainer({ + type, + className, + children, +}: Pick & { children: ReactNode }) { + return ( +
+ {children} +
+ ); +} + +function AdmonitionHeading({ icon, title }: Pick) { + return ( +
+ {icon && {icon}} + {title} +
+ ); +} + +function AdmonitionContent({ children }: Pick) { + return children ? ( +
{children}
+ ) : null; +} + +export default function AdmonitionLayout(props: Props): JSX.Element { + const { type, icon, title, children, className } = props; + return ( + + {icon} + + + {children} + + + ); +} diff --git a/src/theme/Admonition/Layout/styles.module.css b/src/theme/Admonition/Layout/styles.module.css new file mode 100644 index 0000000000..fbfc375986 --- /dev/null +++ b/src/theme/Admonition/Layout/styles.module.css @@ -0,0 +1,70 @@ +.admonition { + margin-bottom: 1em; + padding: 0 1.5rem; +} + +.admonitionHeading { + --ifm-h5-font-size: 1rem; + --ifm-heading-font-weight: 400; + + font: 400 1rem / 1.5rem var(--ifm-heading-font-family); + text-transform: capitalize; +} + +.admonitionHeading code { + text-transform: none; +} + +.admonitionIcon { + display: inline-block; + vertical-align: middle; + padding: 1.25rem 0.875rem 0 0; +} + +.admonitionIcon svg { + display: inline-block; + height: 1.4em; + width: 1.25em; + fill: var(--ifm-alert-foreground-color); +} + +.admonitionIcon:not(.admonitionTip .admonitionIcon) { + --ifm-alert-foreground-color: #00000099; +} + +.admonitionContentWrapper { + padding: 0.625rem; +} + +.admonitionContent > :last-child { + margin-bottom: 0; +} + +.admonitionContent, +.admonitionContent p { + color: var(--cv-theme-on-surface); + font-size: 0.875rem; +} + +.admonitionTip p { + color: var(--cv-theme-on-secondary); +} + +.admonitionWrapper { + --ifm-alert-border-left-width: 0; + --ifm-alert-border-radius: 12px; + + display: flex; + align-items: flex-start; +} + +.admonitionWrapper { + text-underline-offset: 2px; +} + +.admonitionTip { + --ifm-alert-background-color: var(--cv-theme-secondary); + --ifm-alert-foreground-color: var(--cv-theme-on-secondary); + --ifm-alert-border-color: var(--cv-theme-on-secondary); + --ifm-code-background: var(--cv-theme-on-secondary-container-8); +}