Skip to content

Commit 2999b7d

Browse files
authored
fix(docs): add babel plugin for styled components (#1001)
### 🐛 Bug Some styling is completely messed up. This is most visible in the SDK landing page for some reason. But also there is a padding missing in the docs hompage. The reason for this is that classes generated by styled-components are not being added correctly. ### 🛠️ Fix It seems that [CSS-in-JS](https://docusaurus.io/docs/styling-layout#css-in-js) is not supported by Docusaurus natively. I don't know why until now it has somehow worked and started breaking just now... In any case, by adding a babel plugin it seems that the code is now transpiled correctly and the final build works with styled-components as it should.
1 parent deeebe5 commit 2999b7d

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
plugins: ['babel-plugin-styled-components'],
34
};

package-lock.json

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@types/react": "^18.2.8",
4141
"@typescript-eslint/eslint-plugin": "^7.0.0",
4242
"@typescript-eslint/parser": "^7.0.0",
43+
"babel-plugin-styled-components": "^2.1.4",
4344
"cross-env": "^7.0.3",
4445
"eslint": "^8.46.0",
4546
"eslint-plugin-json": "^3.1.0",

0 commit comments

Comments
 (0)