Skip to content

Commit

Permalink
docs: use js polyfill for css-has-pseudo
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjennings committed Apr 7, 2024
1 parent 44c8cff commit 6214891
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion site/docusaurus.config.ts
Expand Up @@ -311,7 +311,11 @@ const config: Config = {
*/
playgroundPosition: 'bottom'
}
} as ClassicPresetThemeConfig
} as ClassicPresetThemeConfig,

clientModules: [
'./src/polyfills/css-has.js'
]
};

export default config;
Expand Down
1 change: 1 addition & 0 deletions site/src/pages/index.tsx
Expand Up @@ -5,6 +5,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures';


import styles from './index.module.css';

function HomepageHeader() {
Expand Down
5 changes: 5 additions & 0 deletions site/src/polyfills/css-has.js
@@ -0,0 +1,5 @@
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';

if (ExecutionEnvironment.canUseDOM) {
require('css-has-pseudo/browser').cssHasPseudo(document);
}

0 comments on commit 6214891

Please sign in to comment.