Skip to content

Commit 5aed28f

Browse files
Docusaurus add tailwind (#2965)
## Summary This PR adds the same version of Tailwind CSS as the `cursorless-org` package (`3.4.14`). ## Changes - Add Tailwind CSS configuration and dependencies to the org site. ### Regression testing Used Backstop.js to compare `main` branch with `docusaurus-add-tailwind` branch. ``` Passing: 65 Failing: 3 ``` All failing tests have been the test suite not working quite right, screenshots below. <details> <summary>Backstop screenshot</summary> ## Screenshots of test suite <img width="1706" alt="image" src="https://github.com/user-attachments/assets/920239b6-6a84-487c-a248-144ce02a1703" /> <img width="1694" alt="image" src="https://github.com/user-attachments/assets/4b66ec18-10b4-4a72-82f3-e50b238d1f9f" /> ## Screenshots of the urls of failing tests ![image](https://github.com/user-attachments/assets/1a238a51-601b-41c9-b22c-cc072f7e5d5f) ![image](https://github.com/user-attachments/assets/66eddcd6-7e1d-4a93-be08-5d71976b3395) ![image](https://github.com/user-attachments/assets/af8e2275-5c12-4c39-b2d8-b3115b6b2f1d) </details> --------- Co-authored-by: Andreas Arvidsson <[email protected]>
1 parent 76068a0 commit 5aed28f

File tree

7 files changed

+553
-256
lines changed

7 files changed

+553
-256
lines changed

packages/cursorless-org-docs/docusaurus.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ const config: Config = {
146146
},
147147
],
148148
],
149+
plugins: ["./src/plugins/tailwind-plugin.js"],
149150

150151
themeConfig: {
151152
navbar: {

packages/cursorless-org-docs/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@
5858
"devDependencies": {
5959
"@docusaurus/module-type-aliases": "3.8.0",
6060
"@docusaurus/types": "3.8.0",
61+
"@tailwindcss/postcss": "4.1.8",
6162
"@tsconfig/docusaurus": "2.0.3",
6263
"@types/mdast": "4.0.4",
6364
"@types/react": "19.1.6",
65+
"postcss": "8.5.4",
66+
"tailwindcss": "3.4.14",
6467
"typescript": "5.8.3",
6568
"unified": "11.0.5"
6669
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

packages/cursorless-org-docs/src/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@tailwind components;
2+
@tailwind base;
3+
@tailwind utilities;
4+
15
/* From https://github.com/facebook/docusaurus/blob/cc0bceab9c1678303f6237f5526753edc1b12fc3/website/src/css/custom.css#L70-L86 */
26
.header-github-link:hover {
37
opacity: 0.6;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = function tailwindPlugin(context, options) {
2+
return {
3+
name: "tailwind-plugin",
4+
configurePostCss(postcssOptions) {
5+
postcssOptions.plugins.push(require("tailwindcss"));
6+
return postcssOptions;
7+
},
8+
};
9+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { fontFamily as _fontFamily } from "tailwindcss/defaultTheme";
2+
3+
/** @type {import('tailwindcss').Config} */
4+
export const content = ["./src/**/*.{js,ts,jsx,tsx}"];
5+
export const corePlugins = {
6+
preflight: false,
7+
};
8+
export const plugins = [];

0 commit comments

Comments
 (0)