Skip to content

Commit 6d1ac58

Browse files
Clean up tail wind config files
1 parent 7e1cd41 commit 6d1ac58

File tree

4 files changed

+82
-74
lines changed

4 files changed

+82
-74
lines changed

packages/cheatsheet-local/tailwind.config.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { readFileSync } from "fs";
1+
import { readFileSync } from "node:fs";
22

33
const references = JSON.parse(
44
readFileSync("tsconfig.json", "utf-8"),
55
).references.map((ref) => ref.path);
66

7-
export const content = [".", ...references].map(
8-
(dir) => `${dir}/src/**/*!(*.stories|*.spec).{ts,tsx,html}`,
9-
);
10-
export const theme = {
11-
extend: {},
7+
/** @type {import('tailwindcss').Config} */
8+
export default {
9+
content: [".", ...references].map((pkg) => `${pkg}/src/**/*.{js,ts,jsx,tsx}`),
10+
theme: {
11+
extend: {},
12+
},
13+
plugins: [],
1214
};
13-
export const plugins = [];

packages/cursorless-org-docs/tailwind.config.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
/** @type {import('tailwindcss').Config} */
1+
import { readFileSync } from "node:fs";
22

3-
export const content = ["./src/**/*.{js,ts,jsx,tsx}"];
3+
const references = JSON.parse(
4+
readFileSync("tsconfig.json", "utf-8"),
5+
).references.map((ref) => ref.path);
46

5-
export const corePlugins = {
6-
preflight: false,
7+
/** @type {import('tailwindcss').Config} */
8+
export default {
9+
content: [".", ...references].map((pkg) => `${pkg}/src/**/*.{js,ts,jsx,tsx}`),
10+
theme: {
11+
extend: {},
12+
},
13+
corePlugins: {
14+
preflight: false,
15+
},
16+
plugins: [],
717
};
8-
9-
export const plugins = [];
Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { fontFamily as _fontFamily } from "tailwindcss/defaultTheme";
2-
import { join } from "path";
3-
import { readFileSync } from "fs";
1+
import { fontFamily } from "tailwindcss/defaultTheme";
2+
import { readFileSync } from "node:fs";
43

54
const CONTENT_RATIO = 1000 / 814;
65

@@ -44,60 +43,59 @@ const {
4443
} = getScalingStrings(5, 5);
4544

4645
const references = JSON.parse(
47-
// eslint-disable-next-line unicorn/prefer-module
48-
readFileSync(join(__dirname, "tsconfig.json"), "utf-8"),
46+
readFileSync("tsconfig.json", "utf-8"),
4947
).references.map((ref) => ref.path);
5048

5149
/** @type {import('tailwindcss').Config} */
52-
export const content = [".", ...references].map(
53-
(pkg) => `${pkg}/src/**/*.{js,ts,jsx,tsx}`,
54-
);
55-
export const theme = {
56-
extend: {
57-
screens: {
58-
stretched: { raw: "(min-aspect-ratio: 2/1), (max-aspect-ratio: 1/1)" },
59-
},
60-
fontFamily: {
61-
mono: ["Inconsolata", ..._fontFamily.mono],
62-
monoWide: ["Inconsolata-SemiExpanded", ..._fontFamily.mono],
63-
},
64-
width: {
65-
smBase: smallWidth,
66-
stretchedBase: stretchedWidth,
67-
},
68-
height: {
69-
smBase: smallHeight,
70-
stretchedBase: stretchedHeight,
71-
},
72-
fontSize: {
73-
smBase: smallFontSize,
74-
stretchedBase: stretchedFontSize,
75-
xs: "1.2em",
76-
lg: "1.8em",
77-
"2xl": "2.4em",
78-
"3xl": "3.6em",
79-
},
80-
colors: {
81-
salmon: {
82-
100: "#FFFAF8",
83-
300: "#F8C9BA",
84-
400: "#FF9273",
85-
700: "#372e2a",
86-
800: "#161110",
87-
900: "#0A0707",
50+
export default {
51+
content: [".", ...references].map((pkg) => `${pkg}/src/**/*.{js,ts,jsx,tsx}`),
52+
theme: {
53+
extend: {
54+
screens: {
55+
stretched: { raw: "(min-aspect-ratio: 2/1), (max-aspect-ratio: 1/1)" },
56+
},
57+
fontFamily: {
58+
mono: ["Inconsolata", ...fontFamily.mono],
59+
monoWide: ["Inconsolata-SemiExpanded", ...fontFamily.mono],
60+
},
61+
width: {
62+
smBase: smallWidth,
63+
stretchedBase: stretchedWidth,
64+
},
65+
height: {
66+
smBase: smallHeight,
67+
stretchedBase: stretchedHeight,
68+
},
69+
fontSize: {
70+
smBase: smallFontSize,
71+
stretchedBase: stretchedFontSize,
72+
xs: "1.2em",
73+
lg: "1.8em",
74+
"2xl": "2.4em",
75+
"3xl": "3.6em",
8876
},
89-
teal: {
90-
100: "#F9FFFE",
91-
200: "#CDFFF9",
92-
300: "#99FFF3",
93-
400: "#00907F",
94-
500: "#47D4C3",
95-
600: "#0F776B",
96-
700: "#005349",
97-
800: "#00443C",
98-
900: "#00110F",
77+
colors: {
78+
salmon: {
79+
100: "#FFFAF8",
80+
300: "#F8C9BA",
81+
400: "#FF9273",
82+
700: "#372e2a",
83+
800: "#161110",
84+
900: "#0A0707",
85+
},
86+
teal: {
87+
100: "#F9FFFE",
88+
200: "#CDFFF9",
89+
300: "#99FFF3",
90+
400: "#00907F",
91+
500: "#47D4C3",
92+
600: "#0F776B",
93+
700: "#005349",
94+
800: "#00443C",
95+
900: "#00110F",
96+
},
9997
},
10098
},
10199
},
100+
plugins: [],
102101
};
103-
export const plugins = [];

packages/cursorless-vscode-tutorial-webview/tailwind.config.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import { readFileSync } from "fs";
1+
import { readFileSync } from "node:fs";
22

33
const references = JSON.parse(
44
readFileSync("tsconfig.json", "utf-8"),
55
).references.map((ref) => ref.path);
66

7-
export const content = [".", ...references].map(
8-
(dir) => `${dir}/src/**/*!(*.stories|*.spec).{ts,tsx,html}`,
9-
);
10-
export const theme = {
11-
extend: {
12-
fontSize: {
13-
["2xs"]: "0.625rem",
7+
/** @type {import('tailwindcss').Config} */
8+
export default {
9+
content: [".", ...references].map((pkg) => `${pkg}/src/**/*.{js,ts,jsx,tsx}`),
10+
theme: {
11+
extend: {
12+
fontSize: {
13+
["2xs"]: "0.625rem",
14+
},
1415
},
1516
},
17+
plugins: [],
1618
};
17-
export const plugins = [];

0 commit comments

Comments
 (0)