From 5c95a3e6af6b906f8bd43699182c7ee5af0bac71 Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Fri, 11 Sep 2020 00:56:24 +0200 Subject: [PATCH 1/3] feat(v2): add style property to theme-classic navbar --- .../src/__tests__/validateThemeConfig.test.js | 1 + .../src/theme/Navbar/index.tsx | 11 +++++++++-- .../src/validateThemeConfig.js | 1 + website/docusaurus.config.js | 1 + .../version-2.0.0-alpha.63/theme-classic.md | 18 ++++++++++++++++++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js b/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js index dd91fcabacfd..843c2d82059d 100644 --- a/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js +++ b/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js @@ -33,6 +33,7 @@ describe('themeConfig', () => { }, image: 'img/docusaurus-soc.png', navbar: { + style: 'primary', hideOnScroll: true, title: 'Docusaurus', logo: { diff --git a/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx b/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx index b44cd349c914..fe606ba63e92 100644 --- a/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx @@ -43,7 +43,12 @@ function Navbar(): JSX.Element { const { siteConfig: { themeConfig: { - navbar: {title = '', items = [], hideOnScroll = false} = {}, + navbar: { + title = '', + items = [], + hideOnScroll = false, + style = undefined, + } = {}, colorMode: {disableSwitch: disableColorModeSwitch = false} = {}, }, }, @@ -83,7 +88,9 @@ function Navbar(): JSX.Element { return (