Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit e0b96a9

Browse files
murrayeegetneil
andauthored
styles: adjust tailwind css & supports theme (#839)
* feat: add tailwind utils css * feat: add tailwind components css * feat: add tailwind bass css & color var * feat: add tailwind bass theme biz vars * feat: import tailwind css to app * feat: remove repeated config for tailwind * feat: adjust tailwind configs * feat: adjust tailwind config for theme infrastructures * feat: fix import typo error * feat: fix prettier error --------- Co-authored-by: Neil <[email protected]>
1 parent 151a52c commit e0b96a9

9 files changed

+94
-71
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ coverage/*
1414
build/*
1515
dist/*
1616
electron/dist/*
17-
svelte/build/*
17+
svelte/build/*
18+
pnpm-lock.yaml

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ copy.json
77
electron/dist
88
electrin/config.json
99
dist
10-
.env
10+
.env
11+
.idea

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ svelte/.svelte-kit
88

99
# Ignore files for PNPM, NPM and YARN
1010
package-lock.json
11+
pnpm-lock.yaml
1112
dist
1213
coverage/*
1314
**/*.plist
1415
svelte/build/*
15-
electron/dist/*
16+
electron/dist/*

svelte/postcss.config.cjs

+1-45
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,6 @@
1-
const teal = "#00ffd0";
2-
const black = "#1a1a1a";
3-
const white = "#fff";
4-
const gray = "#949494";
5-
const purple = "#8000FF";
6-
const green = "#00A517";
7-
const blue = "#013B99";
8-
91
module.exports = {
102
plugins: {
11-
tailwindcss: {
12-
content: ["./src/**/*.{html,svelte,ts,js}", "../ui/src/**/*.{html,svelte,ts,js}"],
13-
theme: {
14-
colors: {
15-
primary: teal,
16-
secondary: purple,
17-
accent: purple,
18-
green,
19-
teal,
20-
blue,
21-
purple: {
22-
700: purple,
23-
900: "#B076EC"
24-
},
25-
black,
26-
white,
27-
gray
28-
},
29-
extend: {
30-
fontFamily: {
31-
inter: ["inter", "sans-serif"],
32-
mona: ["mona-sans", "sans-serif"]
33-
},
34-
typography: {
35-
excerpt: {
36-
css: {
37-
p: {
38-
fontFamily: "font-inter",
39-
fontSize: "font-2xl"
40-
}
41-
}
42-
}
43-
}
44-
}
45-
},
46-
plugins: [require("@tailwindcss/line-clamp")]
47-
},
3+
tailwindcss: {},
484
autoprefixer: {}
495
}
506
};

svelte/src/app.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@import url(./icons/icons.css);
22

3-
@tailwind base;
4-
@tailwind components;
5-
@tailwind utilities;
3+
@import url(./styles/base.css);
4+
@import url(./styles/components.css);
5+
@import url(./styles/utilities.css);
66

77
@font-face {
88
font-family: "mona-sans";

svelte/src/styles/base.css

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@tailwind base;
2+
3+
/* base colors */
4+
@layer base {
5+
:root {
6+
--oss-app-color-teal: #00ffd0;
7+
--oss-app-color-black: #1a1a1a;
8+
--oss-app-color-white: #fff;
9+
--oss-app-color-gray: #949494;
10+
--oss-app-color-purple: #8000ff;
11+
--oss-app-color-purple-900: #b076ec;
12+
--oss-app-color-green: #00a517;
13+
--oss-app-color-blue: #013b99;
14+
}
15+
}
16+
17+
/* base theme. CSS variables with business meaning*/
18+
@layer base {
19+
:root {
20+
--oss-app-color-primary: var(--oss-app-color-teal);
21+
--oss-app-color-secondary: var(--oss-app-color-purple);
22+
--oss-app-fill-primary: var(--oss-app-color-black);
23+
}
24+
25+
/* if needed? */
26+
[data-theme="dark"] {
27+
--oss-app-color-primary: var(--oss-app-color-teal);
28+
--oss-app-color-secondary: var(--oss-app-color-purple);
29+
--oss-app-fill-primary: var(--oss-app-color-black);
30+
}
31+
}
32+
33+
/* base sizes */
34+
@layer base {
35+
:root {
36+
}
37+
}

svelte/src/styles/components.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@tailwind components;
2+
3+
@layer components {
4+
/* Define common component styles here */
5+
}

svelte/src/styles/utilities.css

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@tailwind utilities;
2+
3+
/* tailwind class congregation*/
4+
@layer utilities {
5+
.flex-center-between {
6+
@apply flex items-center justify-between;
7+
}
8+
9+
.flex-center {
10+
@apply flex items-center justify-center;
11+
}
12+
13+
.flex-row-end {
14+
@apply flex items-end justify-center;
15+
}
16+
17+
.flex-around {
18+
@apply flex items-center justify-around;
19+
}
20+
}

svelte/tailwind.config.ts

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
1-
const teal = "#00ffd0";
2-
const black = "#1a1a1a";
3-
const white = "#fff";
4-
const gray = "#949494";
5-
const purple = "#8000FF";
6-
const green = "#00A517";
7-
const blue = "#013B99";
8-
91
module.exports = {
2+
// darkMode: ['class', '[data-theme="dark"]'],
103
content: ["./src/**/*.{html,svelte,ts,js}", "../ui/src/**/*.{html,svelte,ts,js}"],
114
theme: {
125
colors: {
13-
primary: teal,
14-
secondary: purple,
15-
accent: purple,
16-
green,
17-
teal,
18-
blue,
6+
primary: "var(--oss-app-color-teal)",
7+
secondary: "var(--oss-app-color-purple)",
8+
accent: "var(--oss-app-color-purple)",
9+
green: "var(--oss-app-color-green)",
10+
teal: "var(--oss-app-color-teal)",
11+
blue: "var(--oss-app-color-blue)",
1912
purple: {
20-
700: purple,
21-
900: "#B076EC"
13+
700: "var(--oss-app-color-purple)",
14+
900: "var(--oss-app-color-purple-900)"
2215
},
23-
black,
24-
white,
25-
gray
16+
black: "var(--oss-app-color-black)",
17+
white: "var(--oss-app-color-white)",
18+
gray: "var(--oss-app-color-gray)"
2619
},
2720
extend: {
21+
colors: {},
22+
borderRadius: {},
23+
keyframes: {},
24+
animation: {},
25+
boxShadow: {},
2826
fontFamily: {
2927
inter: ["inter", "sans-serif"],
3028
mona: ["mona-sans", "sans-serif"]
@@ -40,5 +38,9 @@ module.exports = {
4038
}
4139
}
4240
}
43-
}
41+
},
42+
plugins: [
43+
// require('tailwindcss-animate'),
44+
require("@tailwindcss/line-clamp")
45+
]
4446
};

0 commit comments

Comments
 (0)