@hanzo/docs 16.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +249 -0
- package/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/dist/cli/build.d.ts +117 -0
- package/dist/cli/build.js +2 -0
- package/dist/content-collections/index.d.ts +1 -0
- package/dist/content-collections/index.js +2 -0
- package/dist/core/breadcrumb.d.ts +1 -0
- package/dist/core/breadcrumb.js +2 -0
- package/dist/core/content/github.d.ts +1 -0
- package/dist/core/content/github.js +2 -0
- package/dist/core/content/index.d.ts +1 -0
- package/dist/core/content/index.js +2 -0
- package/dist/core/content/toc.d.ts +1 -0
- package/dist/core/content/toc.js +2 -0
- package/dist/core/dynamic-link.d.ts +1 -0
- package/dist/core/dynamic-link.js +2 -0
- package/dist/core/framework/index.d.ts +1 -0
- package/dist/core/framework/index.js +2 -0
- package/dist/core/framework/next.d.ts +1 -0
- package/dist/core/framework/next.js +2 -0
- package/dist/core/framework/react-router.d.ts +1 -0
- package/dist/core/framework/react-router.js +2 -0
- package/dist/core/framework/tanstack.d.ts +1 -0
- package/dist/core/framework/tanstack.js +2 -0
- package/dist/core/framework/waku.d.ts +1 -0
- package/dist/core/framework/waku.js +2 -0
- package/dist/core/highlight/client.d.ts +1 -0
- package/dist/core/highlight/client.js +2 -0
- package/dist/core/highlight/index.d.ts +1 -0
- package/dist/core/highlight/index.js +2 -0
- package/dist/core/i18n/index.d.ts +1 -0
- package/dist/core/i18n/index.js +2 -0
- package/dist/core/i18n/middleware.d.ts +1 -0
- package/dist/core/i18n/middleware.js +2 -0
- package/dist/core/link.d.ts +2 -0
- package/dist/core/link.js +6 -0
- package/dist/core/mdx-plugins/codeblock-utils.d.ts +1 -0
- package/dist/core/mdx-plugins/codeblock-utils.js +2 -0
- package/dist/core/mdx-plugins/index.d.ts +1 -0
- package/dist/core/mdx-plugins/index.js +2 -0
- package/dist/core/mdx-plugins/rehype-code.d.ts +1 -0
- package/dist/core/mdx-plugins/rehype-code.js +2 -0
- package/dist/core/mdx-plugins/remark-gfm.d.ts +1 -0
- package/dist/core/mdx-plugins/remark-gfm.js +2 -0
- package/dist/core/mdx-plugins/remark-steps.d.ts +1 -0
- package/dist/core/mdx-plugins/remark-steps.js +2 -0
- package/dist/core/mdx-plugins/remark-structure.d.ts +1 -0
- package/dist/core/mdx-plugins/remark-structure.js +2 -0
- package/dist/core/negotiation.d.ts +1 -0
- package/dist/core/negotiation.js +2 -0
- package/dist/core/page-tree.d.ts +1 -0
- package/dist/core/page-tree.js +2 -0
- package/dist/core/search/algolia.d.ts +1 -0
- package/dist/core/search/algolia.js +2 -0
- package/dist/core/search/client.d.ts +1 -0
- package/dist/core/search/client.js +2 -0
- package/dist/core/search/index.d.ts +1 -0
- package/dist/core/search/index.js +2 -0
- package/dist/core/search/orama-cloud.d.ts +1 -0
- package/dist/core/search/orama-cloud.js +2 -0
- package/dist/core/search/server.d.ts +1 -0
- package/dist/core/search/server.js +2 -0
- package/dist/core/source/client.d.ts +1 -0
- package/dist/core/source/client.js +2 -0
- package/dist/core/source/index.d.ts +1 -0
- package/dist/core/source/index.js +2 -0
- package/dist/core/source/lucide-icons.d.ts +1 -0
- package/dist/core/source/lucide-icons.js +2 -0
- package/dist/core/source/schema.d.ts +1 -0
- package/dist/core/source/schema.js +2 -0
- package/dist/core/toc.d.ts +1 -0
- package/dist/core/toc.js +2 -0
- package/dist/docgen/index.d.ts +1 -0
- package/dist/docgen/index.js +2 -0
- package/dist/docgen/remark-ts2js.d.ts +1 -0
- package/dist/docgen/remark-ts2js.js +2 -0
- package/dist/mdx/bun.d.ts +1 -0
- package/dist/mdx/bun.js +2 -0
- package/dist/mdx/config.d.ts +1 -0
- package/dist/mdx/config.js +2 -0
- package/dist/mdx/index.d.ts +1 -0
- package/dist/mdx/index.js +2 -0
- package/dist/mdx/next.d.ts +1 -0
- package/dist/mdx/next.js +2 -0
- package/dist/mdx/plugins/index-file.d.ts +1 -0
- package/dist/mdx/plugins/index-file.js +2 -0
- package/dist/mdx/plugins/json-schema.d.ts +2 -0
- package/dist/mdx/plugins/json-schema.js +6 -0
- package/dist/mdx/plugins/last-modified.d.ts +2 -0
- package/dist/mdx/plugins/last-modified.js +6 -0
- package/dist/mdx/runtime/browser.d.ts +1 -0
- package/dist/mdx/runtime/browser.js +2 -0
- package/dist/mdx/runtime/dynamic.d.ts +1 -0
- package/dist/mdx/runtime/dynamic.js +2 -0
- package/dist/mdx/runtime/server.d.ts +1 -0
- package/dist/mdx/runtime/server.js +2 -0
- package/dist/mdx/runtime/types.d.ts +1 -0
- package/dist/mdx/runtime/types.js +2 -0
- package/dist/mdx/vite.d.ts +2 -0
- package/dist/mdx/vite.js +6 -0
- package/dist/mdx-remote/client.d.ts +1 -0
- package/dist/mdx-remote/client.js +2 -0
- package/dist/mdx-remote/index.d.ts +1 -0
- package/dist/mdx-remote/index.js +2 -0
- package/dist/obsidian/index.d.ts +1 -0
- package/dist/obsidian/index.js +2 -0
- package/dist/obsidian/mdx.d.ts +1 -0
- package/dist/obsidian/mdx.js +2 -0
- package/dist/obsidian/ui.d.ts +1 -0
- package/dist/obsidian/ui.js +2 -0
- package/dist/openapi/css/preset.css +1 -0
- package/dist/openapi/index.d.ts +1 -0
- package/dist/openapi/index.js +2 -0
- package/dist/openapi/server.d.ts +1 -0
- package/dist/openapi/server.js +2 -0
- package/dist/openapi/ui.d.ts +1 -0
- package/dist/openapi/ui.js +2 -0
- package/dist/press/index.d.ts +1 -0
- package/dist/press/index.js +2 -0
- package/dist/press/vite.d.ts +1 -0
- package/dist/press/vite.js +2 -0
- package/dist/python/components.d.ts +1 -0
- package/dist/python/components.js +2 -0
- package/dist/python/index.d.ts +1 -0
- package/dist/python/index.js +2 -0
- package/dist/twoslash/cache-fs.d.ts +1 -0
- package/dist/twoslash/cache-fs.js +2 -0
- package/dist/twoslash/index.d.ts +1 -0
- package/dist/twoslash/index.js +2 -0
- package/dist/twoslash/twoslash.css +225 -0
- package/dist/twoslash/ui.d.ts +1 -0
- package/dist/twoslash/ui.js +2 -0
- package/dist/typescript/index.d.ts +1 -0
- package/dist/typescript/index.js +2 -0
- package/dist/typescript/ui.d.ts +1 -0
- package/dist/typescript/ui.js +2 -0
- package/dist/ui/components/accordion.d.ts +1 -0
- package/dist/ui/components/accordion.js +2 -0
- package/dist/ui/components/banner.d.ts +1 -0
- package/dist/ui/components/banner.js +2 -0
- package/dist/ui/components/callout.d.ts +1 -0
- package/dist/ui/components/callout.js +2 -0
- package/dist/ui/components/card.d.ts +1 -0
- package/dist/ui/components/card.js +2 -0
- package/dist/ui/components/codeblock.d.ts +1 -0
- package/dist/ui/components/codeblock.js +2 -0
- package/dist/ui/components/dialog/search-algolia.d.ts +1 -0
- package/dist/ui/components/dialog/search-algolia.js +2 -0
- package/dist/ui/components/dialog/search-default.d.ts +1 -0
- package/dist/ui/components/dialog/search-default.js +2 -0
- package/dist/ui/components/dialog/search-orama.d.ts +1 -0
- package/dist/ui/components/dialog/search-orama.js +2 -0
- package/dist/ui/components/dialog/search.d.ts +1 -0
- package/dist/ui/components/dialog/search.js +2 -0
- package/dist/ui/components/dynamic-codeblock.d.ts +1 -0
- package/dist/ui/components/dynamic-codeblock.js +2 -0
- package/dist/ui/components/files.d.ts +1 -0
- package/dist/ui/components/files.js +2 -0
- package/dist/ui/components/github-info.d.ts +1 -0
- package/dist/ui/components/github-info.js +2 -0
- package/dist/ui/components/heading.d.ts +1 -0
- package/dist/ui/components/heading.js +2 -0
- package/dist/ui/components/image-zoom.d.ts +1 -0
- package/dist/ui/components/image-zoom.js +2 -0
- package/dist/ui/components/inline-toc.d.ts +1 -0
- package/dist/ui/components/inline-toc.js +2 -0
- package/dist/ui/components/sidebar/base.d.ts +1 -0
- package/dist/ui/components/sidebar/base.js +2 -0
- package/dist/ui/components/sidebar/link-item.d.ts +1 -0
- package/dist/ui/components/sidebar/link-item.js +2 -0
- package/dist/ui/components/sidebar/page-tree.d.ts +1 -0
- package/dist/ui/components/sidebar/page-tree.js +2 -0
- package/dist/ui/components/steps.d.ts +1 -0
- package/dist/ui/components/steps.js +2 -0
- package/dist/ui/components/tabs.d.ts +1 -0
- package/dist/ui/components/tabs.js +2 -0
- package/dist/ui/components/tabs.unstyled.d.ts +1 -0
- package/dist/ui/components/tabs.unstyled.js +2 -0
- package/dist/ui/components/toc/clerk.d.ts +1 -0
- package/dist/ui/components/toc/clerk.js +2 -0
- package/dist/ui/components/toc/default.d.ts +1 -0
- package/dist/ui/components/toc/default.js +2 -0
- package/dist/ui/components/toc/index.d.ts +1 -0
- package/dist/ui/components/toc/index.js +2 -0
- package/dist/ui/components/type-table.d.ts +1 -0
- package/dist/ui/components/type-table.js +2 -0
- package/dist/ui/components/ui/accordion.d.ts +1 -0
- package/dist/ui/components/ui/accordion.js +2 -0
- package/dist/ui/components/ui/button.d.ts +1 -0
- package/dist/ui/components/ui/button.js +2 -0
- package/dist/ui/components/ui/collapsible.d.ts +1 -0
- package/dist/ui/components/ui/collapsible.js +2 -0
- package/dist/ui/components/ui/navigation-menu.d.ts +1 -0
- package/dist/ui/components/ui/navigation-menu.js +2 -0
- package/dist/ui/components/ui/popover.d.ts +1 -0
- package/dist/ui/components/ui/popover.js +2 -0
- package/dist/ui/components/ui/scroll-area.d.ts +1 -0
- package/dist/ui/components/ui/scroll-area.js +2 -0
- package/dist/ui/components/ui/tabs.d.ts +1 -0
- package/dist/ui/components/ui/tabs.js +2 -0
- package/dist/ui/contexts/i18n.d.ts +1 -0
- package/dist/ui/contexts/i18n.js +2 -0
- package/dist/ui/contexts/tree.d.ts +1 -0
- package/dist/ui/contexts/tree.js +2 -0
- package/dist/ui/css/black.css +39 -0
- package/dist/ui/css/catppuccin.css +49 -0
- package/dist/ui/css/colors/index.css +51 -0
- package/dist/ui/css/dusk.css +47 -0
- package/dist/ui/css/layouts/docs.css +1 -0
- package/dist/ui/css/layouts/home.css +1 -0
- package/dist/ui/css/layouts/notebook.css +1 -0
- package/dist/ui/css/neutral.css +7 -0
- package/dist/ui/css/ocean.css +48 -0
- package/dist/ui/css/preset.css +305 -0
- package/dist/ui/css/purple.css +39 -0
- package/dist/ui/css/shadcn.css +36 -0
- package/dist/ui/css/shiki.css +90 -0
- package/dist/ui/css/solar.css +75 -0
- package/dist/ui/css/style.css +9 -0
- package/dist/ui/css/vitepress.css +77 -0
- package/dist/ui/dist/theme/typography/index.d.ts +10 -0
- package/dist/ui/dist/theme/typography/index.d.ts.map +1 -0
- package/dist/ui/dist/theme/typography/index.js +137 -0
- package/dist/ui/dist/theme/typography/styles.d.ts +93 -0
- package/dist/ui/dist/theme/typography/styles.d.ts.map +1 -0
- package/dist/ui/dist/theme/typography/styles.js +433 -0
- package/dist/ui/i18n.d.ts +1 -0
- package/dist/ui/i18n.js +2 -0
- package/dist/ui/image-zoom.css +77 -0
- package/dist/ui/layouts/docs/page.d.ts +1 -0
- package/dist/ui/layouts/docs/page.js +2 -0
- package/dist/ui/layouts/docs.d.ts +1 -0
- package/dist/ui/layouts/docs.js +2 -0
- package/dist/ui/layouts/home/navbar.d.ts +1 -0
- package/dist/ui/layouts/home/navbar.js +2 -0
- package/dist/ui/layouts/home.d.ts +1 -0
- package/dist/ui/layouts/home.js +2 -0
- package/dist/ui/layouts/notebook/page.d.ts +1 -0
- package/dist/ui/layouts/notebook/page.js +2 -0
- package/dist/ui/layouts/notebook.d.ts +1 -0
- package/dist/ui/layouts/notebook.js +2 -0
- package/dist/ui/layouts/shared.d.ts +1 -0
- package/dist/ui/layouts/shared.js +2 -0
- package/dist/ui/mdx.d.ts +2 -0
- package/dist/ui/mdx.js +6 -0
- package/dist/ui/og.d.ts +1 -0
- package/dist/ui/og.js +2 -0
- package/dist/ui/page.d.ts +1 -0
- package/dist/ui/page.js +2 -0
- package/dist/ui/provider/base.d.ts +1 -0
- package/dist/ui/provider/base.js +2 -0
- package/dist/ui/provider/next.d.ts +1 -0
- package/dist/ui/provider/next.js +2 -0
- package/dist/ui/provider/react-router.d.ts +1 -0
- package/dist/ui/provider/react-router.js +2 -0
- package/dist/ui/provider/tanstack.d.ts +1 -0
- package/dist/ui/provider/tanstack.js +2 -0
- package/dist/ui/provider/waku.d.ts +1 -0
- package/dist/ui/provider/waku.js +2 -0
- package/dist/ui/style.css +3306 -0
- package/dist/ui/utils/use-copy-button.d.ts +1 -0
- package/dist/ui/utils/use-copy-button.js +2 -0
- package/package.json +146 -0
- package/scripts/copy-css.js +57 -0
- package/scripts/generate-exports.ts +2 -0
- package/src/cli/build.ts +1 -0
- package/src/content-collections/index.ts +1 -0
- package/src/core/breadcrumb.ts +1 -0
- package/src/core/content/github.ts +1 -0
- package/src/core/content/index.ts +1 -0
- package/src/core/content/toc.ts +1 -0
- package/src/core/dynamic-link.ts +1 -0
- package/src/core/framework/index.ts +1 -0
- package/src/core/framework/next.ts +1 -0
- package/src/core/framework/react-router.ts +1 -0
- package/src/core/framework/tanstack.ts +1 -0
- package/src/core/framework/waku.ts +1 -0
- package/src/core/highlight/client.ts +1 -0
- package/src/core/highlight/index.ts +1 -0
- package/src/core/i18n/index.ts +1 -0
- package/src/core/i18n/middleware.ts +1 -0
- package/src/core/link.ts +2 -0
- package/src/core/mdx-plugins/codeblock-utils.ts +1 -0
- package/src/core/mdx-plugins/index.ts +1 -0
- package/src/core/mdx-plugins/rehype-code.ts +1 -0
- package/src/core/mdx-plugins/remark-gfm.ts +1 -0
- package/src/core/mdx-plugins/remark-steps.ts +1 -0
- package/src/core/mdx-plugins/remark-structure.ts +1 -0
- package/src/core/negotiation.ts +1 -0
- package/src/core/page-tree.ts +1 -0
- package/src/core/search/algolia.ts +1 -0
- package/src/core/search/client.ts +1 -0
- package/src/core/search/index.ts +1 -0
- package/src/core/search/orama-cloud.ts +1 -0
- package/src/core/search/server.ts +1 -0
- package/src/core/source/client.ts +1 -0
- package/src/core/source/index.ts +1 -0
- package/src/core/source/lucide-icons.ts +1 -0
- package/src/core/source/schema.ts +1 -0
- package/src/core/toc.ts +1 -0
- package/src/docgen/index.ts +1 -0
- package/src/docgen/remark-ts2js.ts +1 -0
- package/src/mdx/bun.ts +1 -0
- package/src/mdx/config.ts +1 -0
- package/src/mdx/index.ts +1 -0
- package/src/mdx/next.ts +1 -0
- package/src/mdx/plugins/index-file.ts +1 -0
- package/src/mdx/plugins/json-schema.ts +2 -0
- package/src/mdx/plugins/last-modified.ts +2 -0
- package/src/mdx/runtime/browser.ts +1 -0
- package/src/mdx/runtime/dynamic.ts +1 -0
- package/src/mdx/runtime/server.ts +1 -0
- package/src/mdx/runtime/types.ts +1 -0
- package/src/mdx/vite.ts +2 -0
- package/src/mdx-remote/client.ts +1 -0
- package/src/mdx-remote/index.ts +1 -0
- package/src/obsidian/index.ts +1 -0
- package/src/obsidian/mdx.ts +1 -0
- package/src/obsidian/ui.ts +1 -0
- package/src/openapi/index.ts +1 -0
- package/src/openapi/server.ts +1 -0
- package/src/openapi/ui.ts +1 -0
- package/src/press/index.ts +1 -0
- package/src/press/vite.ts +1 -0
- package/src/python/components.ts +1 -0
- package/src/python/index.ts +1 -0
- package/src/twoslash/cache-fs.ts +1 -0
- package/src/twoslash/index.ts +1 -0
- package/src/twoslash/ui.ts +1 -0
- package/src/typescript/index.ts +1 -0
- package/src/typescript/ui.ts +1 -0
- package/src/ui/components/accordion.ts +1 -0
- package/src/ui/components/banner.ts +1 -0
- package/src/ui/components/callout.ts +1 -0
- package/src/ui/components/card.ts +1 -0
- package/src/ui/components/codeblock.ts +1 -0
- package/src/ui/components/dialog/search-algolia.ts +1 -0
- package/src/ui/components/dialog/search-default.ts +1 -0
- package/src/ui/components/dialog/search-orama.ts +1 -0
- package/src/ui/components/dialog/search.ts +1 -0
- package/src/ui/components/dynamic-codeblock.ts +1 -0
- package/src/ui/components/files.ts +1 -0
- package/src/ui/components/github-info.ts +1 -0
- package/src/ui/components/heading.ts +1 -0
- package/src/ui/components/image-zoom.ts +1 -0
- package/src/ui/components/inline-toc.ts +1 -0
- package/src/ui/components/sidebar/base.ts +1 -0
- package/src/ui/components/sidebar/link-item.ts +1 -0
- package/src/ui/components/sidebar/page-tree.ts +1 -0
- package/src/ui/components/steps.ts +1 -0
- package/src/ui/components/tabs.ts +1 -0
- package/src/ui/components/tabs.unstyled.ts +1 -0
- package/src/ui/components/toc/clerk.ts +1 -0
- package/src/ui/components/toc/default.ts +1 -0
- package/src/ui/components/toc/index.ts +1 -0
- package/src/ui/components/type-table.ts +1 -0
- package/src/ui/components/ui/accordion.ts +1 -0
- package/src/ui/components/ui/button.ts +1 -0
- package/src/ui/components/ui/collapsible.ts +1 -0
- package/src/ui/components/ui/navigation-menu.ts +1 -0
- package/src/ui/components/ui/popover.ts +1 -0
- package/src/ui/components/ui/scroll-area.ts +1 -0
- package/src/ui/components/ui/tabs.ts +1 -0
- package/src/ui/contexts/i18n.ts +1 -0
- package/src/ui/contexts/tree.ts +1 -0
- package/src/ui/i18n.ts +1 -0
- package/src/ui/layouts/docs/page.ts +1 -0
- package/src/ui/layouts/docs.ts +1 -0
- package/src/ui/layouts/home/navbar.ts +1 -0
- package/src/ui/layouts/home.ts +1 -0
- package/src/ui/layouts/notebook/page.ts +1 -0
- package/src/ui/layouts/notebook.ts +1 -0
- package/src/ui/layouts/shared.ts +1 -0
- package/src/ui/mdx.ts +2 -0
- package/src/ui/og.ts +1 -0
- package/src/ui/page.ts +1 -0
- package/src/ui/provider/base.ts +1 -0
- package/src/ui/provider/next.ts +1 -0
- package/src/ui/provider/react-router.ts +1 -0
- package/src/ui/provider/tanstack.ts +1 -0
- package/src/ui/provider/waku.ts +1 -0
- package/src/ui/utils/use-copy-button.ts +1 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +50 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as styles from './styles.js';
|
|
2
|
+
import plugin from 'tailwindcss/plugin';
|
|
3
|
+
import merge from 'lodash.merge';
|
|
4
|
+
import parser from 'postcss-selector-parser';
|
|
5
|
+
function inWhere(selector, { className, prefix, modifier }) {
|
|
6
|
+
const prefixedNot = prefix(`.not-${className}`).slice(1);
|
|
7
|
+
const selectorPrefix = selector.startsWith('>')
|
|
8
|
+
? `${modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`} `
|
|
9
|
+
: '';
|
|
10
|
+
// Parse the selector, if every component ends in the same pseudo element(s) then move it to the end
|
|
11
|
+
const [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector);
|
|
12
|
+
if (trailingPseudo) {
|
|
13
|
+
return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`;
|
|
14
|
+
}
|
|
15
|
+
return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`;
|
|
16
|
+
}
|
|
17
|
+
function configToCss(config = {}, { className, modifier, prefix }) {
|
|
18
|
+
function updateSelector(k, v) {
|
|
19
|
+
if (Array.isArray(v)) {
|
|
20
|
+
return [k, v];
|
|
21
|
+
}
|
|
22
|
+
if (typeof v === 'object' && v !== null) {
|
|
23
|
+
const nested = Object.values(v).some((prop) => typeof prop === 'object');
|
|
24
|
+
if (nested) {
|
|
25
|
+
return [
|
|
26
|
+
inWhere(k, { className, modifier, prefix }),
|
|
27
|
+
v,
|
|
28
|
+
Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v))),
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
return [inWhere(k, { className, modifier, prefix }), v];
|
|
32
|
+
}
|
|
33
|
+
return [k, v];
|
|
34
|
+
}
|
|
35
|
+
const css = config.css ?? [];
|
|
36
|
+
return Object.fromEntries(Object.entries(merge({}, ...(Array.isArray(css) ? css : [css]))).map(([k, v]) => updateSelector(k, v)));
|
|
37
|
+
}
|
|
38
|
+
const parseSelector = parser();
|
|
39
|
+
function commonTrailingPseudos(selector) {
|
|
40
|
+
const ast = parseSelector.astSync(selector);
|
|
41
|
+
const matrix = [];
|
|
42
|
+
// Put the pseudo elements in reverse order in a sparse, column-major 2D array
|
|
43
|
+
for (const [i, sel] of ast.nodes.entries()) {
|
|
44
|
+
for (const [j, child] of [...sel.nodes].reverse().entries()) {
|
|
45
|
+
// We only care about pseudo elements
|
|
46
|
+
if (child.type !== 'pseudo' || !child.value.startsWith('::')) {
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
matrix[j] = matrix[j] || [];
|
|
50
|
+
matrix[j][i] = child;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const trailingPseudos = parser.selector({
|
|
54
|
+
value: '',
|
|
55
|
+
});
|
|
56
|
+
// At this point the pseudo elements are in a column-major 2D array
|
|
57
|
+
// This means each row contains one "column" of pseudo elements from each selector
|
|
58
|
+
// We can compare all the pseudo elements in a row to see if they are the same
|
|
59
|
+
for (const pseudos of matrix) {
|
|
60
|
+
// It's a sparse 2D array so there are going to be holes in the rows
|
|
61
|
+
// We skip those
|
|
62
|
+
if (!pseudos) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const values = new Set(pseudos.map((p) => p.value));
|
|
66
|
+
// The pseudo elements are not the same
|
|
67
|
+
if (values.size > 1) {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
pseudos.forEach((pseudo) => pseudo.remove());
|
|
71
|
+
trailingPseudos.prepend(pseudos[0]);
|
|
72
|
+
}
|
|
73
|
+
if (trailingPseudos.nodes.length) {
|
|
74
|
+
return [trailingPseudos.toString(), ast.toString()];
|
|
75
|
+
}
|
|
76
|
+
return [null, selector];
|
|
77
|
+
}
|
|
78
|
+
const SELECTORS = [
|
|
79
|
+
['headings', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'th'],
|
|
80
|
+
['h1'],
|
|
81
|
+
['h2'],
|
|
82
|
+
['h3'],
|
|
83
|
+
['h4'],
|
|
84
|
+
['h5'],
|
|
85
|
+
['h6'],
|
|
86
|
+
['p'],
|
|
87
|
+
['a'],
|
|
88
|
+
['blockquote'],
|
|
89
|
+
['figure'],
|
|
90
|
+
['figcaption'],
|
|
91
|
+
['strong'],
|
|
92
|
+
['em'],
|
|
93
|
+
['kbd'],
|
|
94
|
+
['code'],
|
|
95
|
+
['pre'],
|
|
96
|
+
['ol'],
|
|
97
|
+
['ul'],
|
|
98
|
+
['li'],
|
|
99
|
+
['table'],
|
|
100
|
+
['thead'],
|
|
101
|
+
['tr'],
|
|
102
|
+
['th'],
|
|
103
|
+
['td'],
|
|
104
|
+
['img'],
|
|
105
|
+
['video'],
|
|
106
|
+
['hr'],
|
|
107
|
+
['lead', '[class~="lead"]'],
|
|
108
|
+
];
|
|
109
|
+
export const typography = plugin.withOptions(({ className = 'prose', ...styleOptions } = {}) => {
|
|
110
|
+
return ({ addVariant, addComponents, ...rest }) => {
|
|
111
|
+
const prefix = rest.prefix;
|
|
112
|
+
for (const [name, ...values] of SELECTORS) {
|
|
113
|
+
const selectors = values.length === 0 ? [name] : values;
|
|
114
|
+
const selector = selectors.join(', ');
|
|
115
|
+
addVariant(`${className}-${name}`, `& :is(${inWhere(selector, {
|
|
116
|
+
prefix,
|
|
117
|
+
className,
|
|
118
|
+
})})`);
|
|
119
|
+
}
|
|
120
|
+
addComponents({
|
|
121
|
+
[`.${className}`]: configToCss({
|
|
122
|
+
...styles.DEFAULT,
|
|
123
|
+
css: [
|
|
124
|
+
...(styles.DEFAULT.css ?? []),
|
|
125
|
+
styleOptions.disableRoundedTable
|
|
126
|
+
? styles.normalTable
|
|
127
|
+
: styles.roundedTable,
|
|
128
|
+
],
|
|
129
|
+
}, {
|
|
130
|
+
className,
|
|
131
|
+
modifier: 'DEFAULT',
|
|
132
|
+
prefix,
|
|
133
|
+
}),
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
export default typography;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const roundedTable: {
|
|
2
|
+
table: {
|
|
3
|
+
borderCollapse: string;
|
|
4
|
+
borderSpacing: string;
|
|
5
|
+
background: string;
|
|
6
|
+
borderRadius: string;
|
|
7
|
+
border: string;
|
|
8
|
+
overflow: string;
|
|
9
|
+
};
|
|
10
|
+
th: {
|
|
11
|
+
textAlign: string;
|
|
12
|
+
padding: string;
|
|
13
|
+
'border-inline-start': string;
|
|
14
|
+
background: string;
|
|
15
|
+
};
|
|
16
|
+
'th:first-child': {
|
|
17
|
+
'border-inline-start': string;
|
|
18
|
+
};
|
|
19
|
+
'th:not(tr:last-child *), td:not(tr:last-child *)': {
|
|
20
|
+
'border-bottom': string;
|
|
21
|
+
};
|
|
22
|
+
td: {
|
|
23
|
+
textAlign: string;
|
|
24
|
+
'border-inline-start': string;
|
|
25
|
+
padding: string;
|
|
26
|
+
};
|
|
27
|
+
'td:first-child': {
|
|
28
|
+
'border-inline-start': string;
|
|
29
|
+
};
|
|
30
|
+
'tfoot th, tfoot td': {
|
|
31
|
+
borderTopWidth: string;
|
|
32
|
+
borderTopColor: string;
|
|
33
|
+
};
|
|
34
|
+
'thead th, thead td': {
|
|
35
|
+
borderBottomWidth: string;
|
|
36
|
+
borderBottomColor: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const normalTable: {
|
|
40
|
+
thead: {
|
|
41
|
+
borderBottomWidth: string;
|
|
42
|
+
borderBottomColor: string;
|
|
43
|
+
};
|
|
44
|
+
'thead th': {
|
|
45
|
+
verticalAlign: string;
|
|
46
|
+
paddingInlineEnd: string;
|
|
47
|
+
paddingBottom: string;
|
|
48
|
+
paddingInlineStart: string;
|
|
49
|
+
};
|
|
50
|
+
'thead th:first-child': {
|
|
51
|
+
paddingInlineStart: string;
|
|
52
|
+
};
|
|
53
|
+
'thead th:last-child': {
|
|
54
|
+
paddingInlineEnd: string;
|
|
55
|
+
};
|
|
56
|
+
'tbody td, tfoot td': {
|
|
57
|
+
paddingTop: string;
|
|
58
|
+
paddingInlineEnd: string;
|
|
59
|
+
paddingBottom: string;
|
|
60
|
+
paddingInlineStart: string;
|
|
61
|
+
};
|
|
62
|
+
'tbody td:first-child, tfoot td:first-child': {
|
|
63
|
+
paddingInlineStart: string;
|
|
64
|
+
};
|
|
65
|
+
'tbody td:last-child, tfoot td:last-child': {
|
|
66
|
+
paddingInlineEnd: string;
|
|
67
|
+
};
|
|
68
|
+
'tbody tr': {
|
|
69
|
+
borderBottomWidth: string;
|
|
70
|
+
borderBottomColor: string;
|
|
71
|
+
};
|
|
72
|
+
'tbody tr:last-child': {
|
|
73
|
+
borderBottomWidth: string;
|
|
74
|
+
};
|
|
75
|
+
'tbody td': {
|
|
76
|
+
verticalAlign: string;
|
|
77
|
+
};
|
|
78
|
+
tfoot: {
|
|
79
|
+
borderTopWidth: string;
|
|
80
|
+
borderTopColor: string;
|
|
81
|
+
};
|
|
82
|
+
'tfoot td': {
|
|
83
|
+
verticalAlign: string;
|
|
84
|
+
};
|
|
85
|
+
'th, td': {
|
|
86
|
+
textAlign: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export interface Config {
|
|
90
|
+
css?: Record<string, string | Record<string, string>>[];
|
|
91
|
+
}
|
|
92
|
+
export declare const DEFAULT: Config;
|
|
93
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/theme/typography/styles.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCxB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDvB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CACzD;AAED,eAAO,MAAM,OAAO,EAAE,MA+TrB,CAAC"}
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
function round(num) {
|
|
2
|
+
return num
|
|
3
|
+
.toFixed(7)
|
|
4
|
+
.replace(/(\.[0-9]+?)0+$/, '$1')
|
|
5
|
+
.replace(/\.0$/, '');
|
|
6
|
+
}
|
|
7
|
+
function rem(px) {
|
|
8
|
+
return `${round(px / 16)}rem`;
|
|
9
|
+
}
|
|
10
|
+
function em(px, base) {
|
|
11
|
+
return `${round(px / base)}em`;
|
|
12
|
+
}
|
|
13
|
+
const colors = {
|
|
14
|
+
'--tw-prose-body': 'color-mix(in oklab, var(--color-fd-foreground) 90%, transparent)',
|
|
15
|
+
'--tw-prose-headings': 'var(--color-fd-foreground)',
|
|
16
|
+
'--tw-prose-lead': `var(--color-fd-foreground)`,
|
|
17
|
+
'--tw-prose-links': `var(--color-fd-foreground)`,
|
|
18
|
+
'--tw-prose-bold': `var(--color-fd-foreground)`,
|
|
19
|
+
'--tw-prose-counters': `var(--color-fd-muted-foreground)`,
|
|
20
|
+
'--tw-prose-bullets': `var(--color-fd-muted-foreground)`,
|
|
21
|
+
'--tw-prose-hr': `var(--color-fd-border)`,
|
|
22
|
+
'--tw-prose-quotes': `var(--color-fd-foreground)`,
|
|
23
|
+
'--tw-prose-quote-borders': `var(--color-fd-border)`,
|
|
24
|
+
'--tw-prose-captions': `var(--color-fd-foreground)`,
|
|
25
|
+
'--tw-prose-code': `var(--color-fd-foreground)`,
|
|
26
|
+
'--tw-prose-th-borders': `var(--color-fd-border)`,
|
|
27
|
+
'--tw-prose-td-borders': `var(--color-fd-border)`,
|
|
28
|
+
'--tw-prose-kbd': `var(--color-fd-foreground)`,
|
|
29
|
+
'--tw-prose-kbd-shadows': `color-mix(in oklab, var(--color-fd-primary) 50%, transparent)`,
|
|
30
|
+
};
|
|
31
|
+
export const roundedTable = {
|
|
32
|
+
table: {
|
|
33
|
+
borderCollapse: 'separate',
|
|
34
|
+
borderSpacing: '0',
|
|
35
|
+
background: 'var(--color-fd-card)',
|
|
36
|
+
borderRadius: 'var(--radius-lg)',
|
|
37
|
+
border: '1px solid var(--color-fd-border)',
|
|
38
|
+
overflow: 'hidden',
|
|
39
|
+
},
|
|
40
|
+
th: {
|
|
41
|
+
textAlign: 'start',
|
|
42
|
+
padding: 'calc(var(--spacing) * 2.5)',
|
|
43
|
+
'border-inline-start': '1px solid var(--color-fd-border)',
|
|
44
|
+
background: 'var(--color-fd-muted)',
|
|
45
|
+
},
|
|
46
|
+
'th:first-child': {
|
|
47
|
+
'border-inline-start': 'none',
|
|
48
|
+
},
|
|
49
|
+
'th:not(tr:last-child *), td:not(tr:last-child *)': {
|
|
50
|
+
'border-bottom': '1px solid var(--color-fd-border)',
|
|
51
|
+
},
|
|
52
|
+
td: {
|
|
53
|
+
textAlign: 'start',
|
|
54
|
+
'border-inline-start': '1px solid var(--color-fd-border)',
|
|
55
|
+
padding: 'calc(var(--spacing) * 2.5)',
|
|
56
|
+
},
|
|
57
|
+
'td:first-child': {
|
|
58
|
+
'border-inline-start': 'none',
|
|
59
|
+
},
|
|
60
|
+
'tfoot th, tfoot td': {
|
|
61
|
+
borderTopWidth: '1px',
|
|
62
|
+
borderTopColor: 'var(--tw-prose-th-borders)',
|
|
63
|
+
},
|
|
64
|
+
'thead th, thead td': {
|
|
65
|
+
borderBottomWidth: '1px',
|
|
66
|
+
borderBottomColor: 'var(--tw-prose-th-borders)',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const normalTable = {
|
|
70
|
+
thead: {
|
|
71
|
+
borderBottomWidth: '1px',
|
|
72
|
+
borderBottomColor: 'var(--tw-prose-th-borders)',
|
|
73
|
+
},
|
|
74
|
+
'thead th': {
|
|
75
|
+
verticalAlign: 'bottom',
|
|
76
|
+
paddingInlineEnd: em(8, 14),
|
|
77
|
+
paddingBottom: em(8, 14),
|
|
78
|
+
paddingInlineStart: em(8, 14),
|
|
79
|
+
},
|
|
80
|
+
'thead th:first-child': {
|
|
81
|
+
paddingInlineStart: '0',
|
|
82
|
+
},
|
|
83
|
+
'thead th:last-child': {
|
|
84
|
+
paddingInlineEnd: '0',
|
|
85
|
+
},
|
|
86
|
+
'tbody td, tfoot td': {
|
|
87
|
+
paddingTop: em(8, 14),
|
|
88
|
+
paddingInlineEnd: em(8, 14),
|
|
89
|
+
paddingBottom: em(8, 14),
|
|
90
|
+
paddingInlineStart: em(8, 14),
|
|
91
|
+
},
|
|
92
|
+
'tbody td:first-child, tfoot td:first-child': {
|
|
93
|
+
paddingInlineStart: '0',
|
|
94
|
+
},
|
|
95
|
+
'tbody td:last-child, tfoot td:last-child': {
|
|
96
|
+
paddingInlineEnd: '0',
|
|
97
|
+
},
|
|
98
|
+
'tbody tr': {
|
|
99
|
+
borderBottomWidth: '1px',
|
|
100
|
+
borderBottomColor: 'var(--tw-prose-td-borders)',
|
|
101
|
+
},
|
|
102
|
+
'tbody tr:last-child': {
|
|
103
|
+
borderBottomWidth: '0',
|
|
104
|
+
},
|
|
105
|
+
'tbody td': {
|
|
106
|
+
verticalAlign: 'baseline',
|
|
107
|
+
},
|
|
108
|
+
tfoot: {
|
|
109
|
+
borderTopWidth: '1px',
|
|
110
|
+
borderTopColor: 'var(--tw-prose-th-borders)',
|
|
111
|
+
},
|
|
112
|
+
'tfoot td': {
|
|
113
|
+
verticalAlign: 'top',
|
|
114
|
+
},
|
|
115
|
+
'th, td': {
|
|
116
|
+
textAlign: 'start',
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
export const DEFAULT = {
|
|
120
|
+
css: [
|
|
121
|
+
{
|
|
122
|
+
color: 'var(--tw-prose-body)',
|
|
123
|
+
maxWidth: 'none',
|
|
124
|
+
fontSize: rem(16),
|
|
125
|
+
lineHeight: '1.75rem',
|
|
126
|
+
'[class~="lead"]': {
|
|
127
|
+
fontSize: em(20, 16),
|
|
128
|
+
lineHeight: round(32 / 20),
|
|
129
|
+
marginTop: em(24, 20),
|
|
130
|
+
marginBottom: em(24, 20),
|
|
131
|
+
color: 'var(--tw-prose-lead)',
|
|
132
|
+
},
|
|
133
|
+
ul: {
|
|
134
|
+
paddingInlineStart: '1rem',
|
|
135
|
+
listStyleType: 'disc',
|
|
136
|
+
marginTop: em(20, 16),
|
|
137
|
+
marginBottom: em(20, 16),
|
|
138
|
+
},
|
|
139
|
+
li: {
|
|
140
|
+
marginTop: em(8, 16),
|
|
141
|
+
marginBottom: em(8, 16),
|
|
142
|
+
},
|
|
143
|
+
'ol > li': {
|
|
144
|
+
paddingInlineStart: em(6, 16),
|
|
145
|
+
},
|
|
146
|
+
'ul > li': {
|
|
147
|
+
paddingInlineStart: '0',
|
|
148
|
+
},
|
|
149
|
+
'> ul > li p': {
|
|
150
|
+
marginTop: em(12, 16),
|
|
151
|
+
marginBottom: em(12, 16),
|
|
152
|
+
},
|
|
153
|
+
'> ul > li > p:first-child': {
|
|
154
|
+
marginTop: em(20, 16),
|
|
155
|
+
},
|
|
156
|
+
'> ul > li > p:last-child': {
|
|
157
|
+
marginBottom: em(20, 16),
|
|
158
|
+
},
|
|
159
|
+
'> ol > li > p:first-child': {
|
|
160
|
+
marginTop: em(20, 16),
|
|
161
|
+
},
|
|
162
|
+
'> ol > li > p:last-child': {
|
|
163
|
+
marginBottom: em(20, 16),
|
|
164
|
+
},
|
|
165
|
+
'ul ul, ul ol, ol ul, ol ol': {
|
|
166
|
+
marginTop: em(12, 16),
|
|
167
|
+
marginBottom: em(12, 16),
|
|
168
|
+
},
|
|
169
|
+
dl: {
|
|
170
|
+
marginTop: em(20, 16),
|
|
171
|
+
marginBottom: em(20, 16),
|
|
172
|
+
},
|
|
173
|
+
dt: {
|
|
174
|
+
color: 'var(--tw-prose-headings)',
|
|
175
|
+
fontWeight: '600',
|
|
176
|
+
marginTop: em(20, 16),
|
|
177
|
+
},
|
|
178
|
+
dd: {
|
|
179
|
+
marginTop: em(8, 16),
|
|
180
|
+
paddingInlineStart: em(26, 16),
|
|
181
|
+
},
|
|
182
|
+
hr: {
|
|
183
|
+
borderColor: 'var(--tw-prose-hr)',
|
|
184
|
+
borderTopWidth: '1px',
|
|
185
|
+
marginTop: em(48, 16),
|
|
186
|
+
marginBottom: em(48, 16),
|
|
187
|
+
},
|
|
188
|
+
p: {
|
|
189
|
+
marginTop: em(20, 16),
|
|
190
|
+
marginBottom: em(20, 16),
|
|
191
|
+
},
|
|
192
|
+
strong: {
|
|
193
|
+
color: 'var(--tw-prose-bold)',
|
|
194
|
+
fontWeight: '500',
|
|
195
|
+
},
|
|
196
|
+
'a strong': {
|
|
197
|
+
color: 'inherit',
|
|
198
|
+
},
|
|
199
|
+
'blockquote strong': {
|
|
200
|
+
color: 'inherit',
|
|
201
|
+
},
|
|
202
|
+
'thead th strong': {
|
|
203
|
+
color: 'inherit',
|
|
204
|
+
},
|
|
205
|
+
ol: {
|
|
206
|
+
listStyleType: 'decimal',
|
|
207
|
+
marginTop: em(20, 16),
|
|
208
|
+
marginBottom: em(20, 16),
|
|
209
|
+
paddingInlineStart: em(26, 16),
|
|
210
|
+
},
|
|
211
|
+
'ol[type="A"]': {
|
|
212
|
+
listStyleType: 'upper-alpha',
|
|
213
|
+
},
|
|
214
|
+
'ol[type="a"]': {
|
|
215
|
+
listStyleType: 'lower-alpha',
|
|
216
|
+
},
|
|
217
|
+
'ol[type="A" s]': {
|
|
218
|
+
listStyleType: 'upper-alpha',
|
|
219
|
+
},
|
|
220
|
+
'ol[type="a" s]': {
|
|
221
|
+
listStyleType: 'lower-alpha',
|
|
222
|
+
},
|
|
223
|
+
'ol[type="I"]': {
|
|
224
|
+
listStyleType: 'upper-roman',
|
|
225
|
+
},
|
|
226
|
+
'ol[type="i"]': {
|
|
227
|
+
listStyleType: 'lower-roman',
|
|
228
|
+
},
|
|
229
|
+
'ol[type="I" s]': {
|
|
230
|
+
listStyleType: 'upper-roman',
|
|
231
|
+
},
|
|
232
|
+
'ol[type="i" s]': {
|
|
233
|
+
listStyleType: 'lower-roman',
|
|
234
|
+
},
|
|
235
|
+
'ol[type="1"]': {
|
|
236
|
+
listStyleType: 'decimal',
|
|
237
|
+
},
|
|
238
|
+
'ol > li::marker': {
|
|
239
|
+
fontWeight: '400',
|
|
240
|
+
color: 'var(--tw-prose-counters)',
|
|
241
|
+
},
|
|
242
|
+
'ul > li::marker': {
|
|
243
|
+
color: 'var(--tw-prose-bullets)',
|
|
244
|
+
},
|
|
245
|
+
blockquote: {
|
|
246
|
+
marginTop: em(32, 20),
|
|
247
|
+
marginBottom: em(32, 20),
|
|
248
|
+
paddingInlineStart: em(20, 20),
|
|
249
|
+
fontWeight: '500',
|
|
250
|
+
fontStyle: 'italic',
|
|
251
|
+
color: 'var(--tw-prose-quotes)',
|
|
252
|
+
borderInlineStartWidth: '0.25rem',
|
|
253
|
+
borderInlineStartColor: 'var(--tw-prose-quote-borders)',
|
|
254
|
+
quotes: '"\\201C""\\201D""\\2018""\\2019"',
|
|
255
|
+
},
|
|
256
|
+
'blockquote p:first-of-type::before': {
|
|
257
|
+
content: 'open-quote',
|
|
258
|
+
},
|
|
259
|
+
'blockquote p:last-of-type::after': {
|
|
260
|
+
content: 'close-quote',
|
|
261
|
+
},
|
|
262
|
+
h1: {
|
|
263
|
+
color: 'var(--tw-prose-headings)',
|
|
264
|
+
fontWeight: '800',
|
|
265
|
+
fontSize: 'var(--text-3xl)',
|
|
266
|
+
marginTop: '0',
|
|
267
|
+
marginBottom: em(32, 36),
|
|
268
|
+
lineHeight: round(40 / 36),
|
|
269
|
+
},
|
|
270
|
+
'h1 strong': {
|
|
271
|
+
fontWeight: '900',
|
|
272
|
+
color: 'inherit',
|
|
273
|
+
},
|
|
274
|
+
h2: {
|
|
275
|
+
color: 'var(--tw-prose-headings)',
|
|
276
|
+
fontSize: em(24, 16),
|
|
277
|
+
marginTop: em(48, 24),
|
|
278
|
+
marginBottom: em(24, 24),
|
|
279
|
+
lineHeight: round(32 / 24),
|
|
280
|
+
fontWeight: '600',
|
|
281
|
+
},
|
|
282
|
+
'h2 strong': {
|
|
283
|
+
fontWeight: '800',
|
|
284
|
+
color: 'inherit',
|
|
285
|
+
},
|
|
286
|
+
h3: {
|
|
287
|
+
color: 'var(--tw-prose-headings)',
|
|
288
|
+
fontWeight: '600',
|
|
289
|
+
fontSize: em(20, 16),
|
|
290
|
+
marginTop: em(32, 20),
|
|
291
|
+
marginBottom: em(12, 20),
|
|
292
|
+
lineHeight: round(32 / 20),
|
|
293
|
+
},
|
|
294
|
+
'h3 strong': {
|
|
295
|
+
fontWeight: '700',
|
|
296
|
+
color: 'inherit',
|
|
297
|
+
},
|
|
298
|
+
h4: {
|
|
299
|
+
color: 'var(--tw-prose-headings)',
|
|
300
|
+
fontWeight: '600',
|
|
301
|
+
marginTop: em(24, 16),
|
|
302
|
+
marginBottom: em(8, 16),
|
|
303
|
+
lineHeight: round(24 / 16),
|
|
304
|
+
},
|
|
305
|
+
'h4 strong': {
|
|
306
|
+
fontWeight: '700',
|
|
307
|
+
color: 'inherit',
|
|
308
|
+
},
|
|
309
|
+
'hr + *': {
|
|
310
|
+
marginTop: '0',
|
|
311
|
+
},
|
|
312
|
+
'h2 + *': {
|
|
313
|
+
marginTop: '0',
|
|
314
|
+
},
|
|
315
|
+
'h3 + *': {
|
|
316
|
+
marginTop: '0',
|
|
317
|
+
},
|
|
318
|
+
'h4 + *': {
|
|
319
|
+
marginTop: '0',
|
|
320
|
+
},
|
|
321
|
+
img: {
|
|
322
|
+
marginTop: em(32, 16),
|
|
323
|
+
marginBottom: em(32, 16),
|
|
324
|
+
},
|
|
325
|
+
picture: {
|
|
326
|
+
display: 'block',
|
|
327
|
+
marginTop: em(32, 16),
|
|
328
|
+
marginBottom: em(32, 16),
|
|
329
|
+
},
|
|
330
|
+
'picture > img': {
|
|
331
|
+
marginTop: '0',
|
|
332
|
+
marginBottom: '0',
|
|
333
|
+
},
|
|
334
|
+
video: {
|
|
335
|
+
marginTop: em(32, 16),
|
|
336
|
+
marginBottom: em(32, 16),
|
|
337
|
+
},
|
|
338
|
+
kbd: {
|
|
339
|
+
fontSize: em(14, 16),
|
|
340
|
+
borderRadius: rem(5),
|
|
341
|
+
paddingTop: em(3, 16),
|
|
342
|
+
paddingInlineEnd: em(6, 16),
|
|
343
|
+
paddingBottom: em(3, 16),
|
|
344
|
+
paddingInlineStart: em(6, 16),
|
|
345
|
+
fontWeight: '500',
|
|
346
|
+
fontFamily: 'inherit',
|
|
347
|
+
color: 'var(--tw-prose-kbd)',
|
|
348
|
+
boxShadow: '0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows)',
|
|
349
|
+
},
|
|
350
|
+
code: {
|
|
351
|
+
padding: '3px',
|
|
352
|
+
border: 'solid 1px',
|
|
353
|
+
fontSize: '13px',
|
|
354
|
+
borderColor: `var(--color-fd-border)`,
|
|
355
|
+
borderRadius: '5px',
|
|
356
|
+
fontWeight: '400',
|
|
357
|
+
background: `var(--color-fd-muted)`,
|
|
358
|
+
color: 'var(--tw-prose-code)',
|
|
359
|
+
},
|
|
360
|
+
'a code': {
|
|
361
|
+
color: 'inherit',
|
|
362
|
+
},
|
|
363
|
+
'h1 code': {
|
|
364
|
+
color: 'inherit',
|
|
365
|
+
fontSize: 'var(--text-2xl)',
|
|
366
|
+
},
|
|
367
|
+
'h2 code': {
|
|
368
|
+
color: 'inherit',
|
|
369
|
+
fontSize: em(21, 24),
|
|
370
|
+
},
|
|
371
|
+
'h3 code': {
|
|
372
|
+
color: 'inherit',
|
|
373
|
+
fontSize: em(18, 20),
|
|
374
|
+
},
|
|
375
|
+
'h4 code': {
|
|
376
|
+
color: 'inherit',
|
|
377
|
+
},
|
|
378
|
+
'blockquote code': {
|
|
379
|
+
color: 'inherit',
|
|
380
|
+
},
|
|
381
|
+
'thead th code': {
|
|
382
|
+
color: 'inherit',
|
|
383
|
+
},
|
|
384
|
+
table: {
|
|
385
|
+
fontSize: em(14, 16),
|
|
386
|
+
lineHeight: round(24 / 14),
|
|
387
|
+
width: '100%',
|
|
388
|
+
tableLayout: 'auto',
|
|
389
|
+
marginTop: em(32, 16),
|
|
390
|
+
marginBottom: em(32, 16),
|
|
391
|
+
},
|
|
392
|
+
'thead th': {
|
|
393
|
+
color: 'var(--tw-prose-headings)',
|
|
394
|
+
fontWeight: '600',
|
|
395
|
+
},
|
|
396
|
+
figure: {
|
|
397
|
+
marginTop: em(32, 16),
|
|
398
|
+
marginBottom: em(32, 16),
|
|
399
|
+
},
|
|
400
|
+
'figure > *': {
|
|
401
|
+
marginTop: '0',
|
|
402
|
+
marginBottom: '0',
|
|
403
|
+
},
|
|
404
|
+
figcaption: {
|
|
405
|
+
color: 'var(--tw-prose-captions)',
|
|
406
|
+
fontSize: em(14, 16),
|
|
407
|
+
lineHeight: round(20 / 14),
|
|
408
|
+
marginTop: em(12, 14),
|
|
409
|
+
},
|
|
410
|
+
'a:not([data-card])': {
|
|
411
|
+
color: 'var(--tw-prose-links)',
|
|
412
|
+
transition: 'opacity .2s',
|
|
413
|
+
fontWeight: '500',
|
|
414
|
+
textDecoration: 'underline',
|
|
415
|
+
textUnderlineOffset: '3.5px',
|
|
416
|
+
textDecorationColor: 'var(--color-fd-primary)',
|
|
417
|
+
textDecorationThickness: '1.5px',
|
|
418
|
+
},
|
|
419
|
+
'a:not([data-card]):hover': {
|
|
420
|
+
opacity: '80%',
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
colors,
|
|
424
|
+
{
|
|
425
|
+
'> :first-child': {
|
|
426
|
+
marginTop: '0',
|
|
427
|
+
},
|
|
428
|
+
'> :last-child': {
|
|
429
|
+
marginBottom: '0',
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@hanzo/docs-ui/i18n';
|
package/dist/ui/i18n.js
ADDED