diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index bee092a2b8..5f5b2f9c6c 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -122,9 +122,13 @@ export default class Layout extends React.Component { } setTheme = theme => { + const componentPage = /^\/?components/.test(this.props.location.pathname); if (typeof window === 'undefined') { return; } + if (!componentPage) { + return 'default'; + } if (theme !== 'dark') { const dom = document.getElementById('theme-style'); if (dom) {