diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index 8d4d06562e1e..d515fc0f3389 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -55,7 +55,6 @@ function isBlacklisted(pathname: string) { '/tests/pages/react-18', // Flaky because of hydration error '/tests/blog/archive', - '/tests/docs/tests/custom-props', '/tests/pages/code-block-tests', '/tests/pages/embeds', // Flaky because of hydration error with docusaurus serve + .html diff --git a/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx index 8adca4640afb..076235d68702 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx @@ -43,34 +43,38 @@ function useCategoryItemsPlural() { } function CardContainer({ + className, href, children, }: { + className?: string; href: string; children: ReactNode; }): ReactNode { return ( + className={clsx('card padding--lg', styles.cardContainer, className)}> {children} ); } function CardLayout({ + className, href, icon, title, description, }: { + className?: string; href: string; icon: ReactNode; title: string; description?: string; }): ReactNode { return ( - + ( - - - - - - {items.map((item, index) => ( - - - - - ))} -
Doc PageCustom Props
{item.label}{JSON.stringify(item.customProps)}
-); - - -``` diff --git a/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-className.mdx b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-className.mdx new file mode 100644 index 000000000000..5b29010366a0 --- /dev/null +++ b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-className.mdx @@ -0,0 +1,7 @@ +--- +sidebar_class_name: 'dogfood_sidebar_class_name_test' +--- + +# Doc With Sidebar Class Name + +This doc has `sidebar_label` front matter diff --git a/website/_dogfooding/_docs tests/tests/custom-props/doc-with-custom-props.mdx b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-custom-props.mdx similarity index 50% rename from website/_dogfooding/_docs tests/tests/custom-props/doc-with-custom-props.mdx rename to website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-custom-props.mdx index 486859a3557b..af7d8ab015a2 100644 --- a/website/_dogfooding/_docs tests/tests/custom-props/doc-with-custom-props.mdx +++ b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-custom-props.mdx @@ -5,6 +5,6 @@ sidebar_custom_props: boolean: true --- -# Doc with Custom Props +# Doc With Custom Props -This doc has custom props. +This doc has `sidebar_custom_props` front matter. diff --git a/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-label.mdx b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-label.mdx new file mode 100644 index 000000000000..0e4102ee2f8f --- /dev/null +++ b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-with-sidebar-label.mdx @@ -0,0 +1,7 @@ +--- +sidebar_label: Doc With Sidebar Label +--- + +# Doc with `sidebar_label` + +This doc has `sidebar_label` front matter diff --git a/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-without.mdx b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-without.mdx new file mode 100644 index 000000000000..84689d6e50a7 --- /dev/null +++ b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/doc-without.mdx @@ -0,0 +1,3 @@ +# Doc Without + +This doc doesn't have any `sidebar_` front matter diff --git a/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/index.mdx b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/index.mdx new file mode 100644 index 000000000000..3116679e175a --- /dev/null +++ b/website/_dogfooding/_docs tests/tests/sidebar-frontmatter/index.mdx @@ -0,0 +1,56 @@ +--- +sidebar_label: 'Sidebar Front Matter Tests' +sidebar_class_name: 'dogfood_sidebar_class_name_test' +--- + +# Sidebar front matter + +```mdx-code-block +import Link from '@docusaurus/Link'; +import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; +import DocCardList from '@theme/DocCardList'; + + + +--- + +## Items table + +export const DocPropsList = ({category}) => { + const items = [category, ...category.items]; + return ( + + + + + + + + + + + {items.map((item, index) => ( + + + + + + + ))} + +
+ type + + label + + customProps + + className +
{item.type} + {item.label} + {JSON.stringify(item.customProps)}{JSON.stringify(item.className)}
+ ); +}; + + +``` diff --git a/website/_dogfooding/dogfooding.css b/website/_dogfooding/dogfooding.css index 48983473fe16..54376d3d546c 100644 --- a/website/_dogfooding/dogfooding.css +++ b/website/_dogfooding/dogfooding.css @@ -24,6 +24,20 @@ html { .navbar { border-bottom: solid thin cyan; } + + .dogfood_sidebar_class_name_test { + &.theme-doc-sidebar-item-link > a { + color: cyan; + } + + &.theme-doc-sidebar-item-category > div > a { + color: cyan; + } + + &.card { + border: solid thin cyan; + } + } } &.plugin-blog.plugin-id-blog-tests {