Skip to content

Commit 56a7ba1

Browse files
authored
Merge pull request #1126 from ReactTooltip/fix/docs-css
fix: custom css was broken on docs on production build
2 parents 30c950c + 8bffb68 commit 56a7ba1

File tree

5 files changed

+823
-185
lines changed

5 files changed

+823
-185
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ React Tooltip is proud to be sponsored by [Frigade](https://frigade.com/?source=
7272
<img alt="Dopt" style="height: 200px; width: 200px;" src="docs/static/img/sponsors/dopt.png" />
7373
</a>
7474

75+
## Powered by
76+
77+
<p>
78+
<a href="https://www.digitalocean.com/?refcode=0813b3be1161&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge">
79+
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg" width="201px">
80+
</a>
81+
</p>
82+
7583
## Usage
7684

7785
1 . Import the CSS file to set default styling.
@@ -135,14 +143,6 @@ Please check our [troubleshooting section](https://react-tooltip.com/docs/troubl
135143
If you can't find your problem here, make sure there isn't [an open issue](https://github.com/ReactTooltip/react-tooltip/issues) already covering it.
136144
If there isn't, feel free to [submit a new issue](https://github.com/ReactTooltip/react-tooltip/issues/new/choose).
137145

138-
## Powered by
139-
140-
<p>
141-
<a href="https://www.digitalocean.com/?refcode=0813b3be1161&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge">
142-
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg" width="201px">
143-
</a>
144-
</p>
145-
146146
## Article
147147

148148
[How I insert sass into react component](https://medium.com/@wwayne_me/how-i-insert-sass-into-my-npm-react-component-b46b9811c226#.gi4hxu44a)

docs/babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3-
};
3+
}

docs/docusaurus.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
/* eslint-disable @typescript-eslint/no-var-requires */
23
/* eslint-disable max-len */
34
// @ts-check
45
// Note: type annotations allow type checking and IDEs autocompletion
56

67
const lightCodeTheme = require('prism-react-renderer/themes/github')
78
const darkCodeTheme = require('prism-react-renderer/themes/dracula')
9+
const postcssPresetEnv = require('postcss-preset-env')
10+
11+
/** @return {import('@docusaurus/types').Plugin} */
12+
function customPostCssPlugin() {
13+
return {
14+
name: 'custom-postcss',
15+
configurePostCss(options) {
16+
// Append new PostCSS plugins here.
17+
options.plugins.push(postcssPresetEnv) // allow newest CSS syntax
18+
return options
19+
},
20+
}
21+
}
822

923
/** @type {import('@docusaurus/types').Config} */
1024
const config = {
@@ -29,6 +43,8 @@ const config = {
2943
locales: ['en'],
3044
},
3145

46+
plugins: [customPostCssPlugin],
47+
3248
scripts: [
3349
// {
3450
// src: 'https://securepubads.g.doubleclick.net/tag/js/gpt.js',

docs/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"typecheck": "tsc"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "^2.4.1",
19-
"@docusaurus/preset-classic": "^2.4.1",
18+
"@docusaurus/core": "2.4.3",
19+
"@docusaurus/preset-classic": "2.4.3",
2020
"@mdx-js/react": "1.6.22",
2121
"clsx": "^1.2.1",
2222
"prism-react-renderer": "^1.3.5",
@@ -28,6 +28,7 @@
2828
"devDependencies": {
2929
"@docusaurus/module-type-aliases": "^2.4.1",
3030
"@tsconfig/docusaurus": "^1.0.5",
31+
"postcss-preset-env": "^9.3.0",
3132
"typescript": "4.9.5"
3233
},
3334
"browserslist": {

0 commit comments

Comments
 (0)