Skip to content

Commit 76775f5

Browse files
committed
build: migrate CSS to SCSS and add sass dependencies
1 parent f3064cd commit 76775f5

File tree

11 files changed

+502
-266
lines changed

11 files changed

+502
-266
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"mini-css-extract-plugin": "^2.9.2",
3737
"prettier": "^3.5.3",
3838
"rimraf": "^6.0.1",
39+
"sass": "^1.87.0",
40+
"sass-loader": "^16.0.5",
3941
"terser-webpack-plugin": "^5.3.14",
4042
"ts-loader": "^9.5.2",
4143
"typescript": "^5.8.3",

packages/chrome-extension/config/webpack.common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const common = {
3434
},
3535
// Help webpack in understanding CSS files imported in .js files
3636
{
37-
test: /\.css$/,
38-
use: [MiniCssExtractPlugin.loader, 'css-loader'],
37+
test: /\.(css|scss|sass)$/,
38+
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
3939
},
4040
// Check for images imported in .js files and
4141
{

packages/chrome-extension/src/popup.css

Lines changed: 0 additions & 127 deletions
This file was deleted.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
*,
2+
*::before,
3+
*::after {
4+
margin: 0;
5+
padding: 0;
6+
box-sizing: border-box;
7+
}
8+
9+
:root {
10+
--primary-color: #42b883;
11+
--secondary-color: #35495e;
12+
--background-color: #f8f8f8;
13+
--text-color: #2c3e50;
14+
--border-color: #e0e0e0;
15+
--success-color: #42b883;
16+
--error-color: #ff5252;
17+
}
18+
19+
html {
20+
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
21+
}
22+
23+
body {
24+
width: 300px;
25+
color: var(--text-color);
26+
}
27+
28+
.app {
29+
display: flex;
30+
flex-direction: column;
31+
background-color: var(--background-color);
32+
min-height: 200px;
33+
overflow: hidden;
34+
}
35+
36+
header {
37+
display: flex;
38+
align-items: center;
39+
padding: 12px 16px;
40+
background-color: white;
41+
color: var(--secondary-color);
42+
border-bottom: 1px solid var(--border-color);
43+
44+
h1 {
45+
font-size: 16px;
46+
font-weight: 600;
47+
}
48+
49+
.logo {
50+
width: 24px;
51+
height: 24px;
52+
margin-right: 10px;
53+
}
54+
}
55+
56+
main {
57+
flex: 1;
58+
padding: 16px;
59+
60+
.status-container {
61+
padding: 12px;
62+
border-radius: 6px;
63+
font-size: 14px;
64+
line-height: 1.5;
65+
background-color: white;
66+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
67+
border: 1px solid var(--border-color);
68+
}
69+
70+
.status-success {
71+
border-left: 4px solid var(--success-color);
72+
}
73+
74+
.status-error {
75+
border-left: 4px solid var(--error-color);
76+
}
77+
78+
.loading {
79+
display: flex;
80+
align-items: center;
81+
gap: 10px;
82+
}
83+
84+
.version-tag {
85+
display: inline-block;
86+
padding: 2px 6px;
87+
background-color: var(--primary-color);
88+
color: white;
89+
border-radius: 4px;
90+
font-size: 12px;
91+
margin-left: 6px;
92+
}
93+
94+
.spinner {
95+
width: 16px;
96+
height: 16px;
97+
border: 2px solid rgba(66, 184, 131, 0.2);
98+
border-top-color: var(--primary-color);
99+
border-radius: 50%;
100+
animation: spin 1s linear infinite;
101+
}
102+
103+
@keyframes spin {
104+
to {
105+
transform: rotate(360deg);
106+
}
107+
}
108+
}
109+
110+
footer {
111+
padding: 10px 16px;
112+
text-align: center;
113+
font-size: 12px;
114+
border-top: 1px solid var(--border-color);
115+
116+
.github-link {
117+
color: var(--secondary-color);
118+
text-decoration: none;
119+
display: inline-flex;
120+
align-items: center;
121+
gap: 4px;
122+
}
123+
124+
.github-link:hover {
125+
text-decoration: underline;
126+
}
127+
}

packages/chrome-extension/src/popup.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@/popup.css';
1+
import '@/popup.scss';
22

33
(function () {
44
// Connect to background script
@@ -37,4 +37,14 @@ import '@/popup.css';
3737
}
3838
}
3939
});
40+
41+
document.addEventListener('DOMContentLoaded', () => {
42+
const settingsButton = document.getElementById('openSettings');
43+
if (settingsButton) {
44+
settingsButton.addEventListener('click', (e) => {
45+
e.preventDefault();
46+
chrome.runtime.openOptionsPage();
47+
});
48+
}
49+
});
4050
})();

packages/firefox-extension/config/webpack.common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const common = {
3434
},
3535
// Help webpack in understanding CSS files imported in .js files
3636
{
37-
test: /\.css$/,
38-
use: [MiniCssExtractPlugin.loader, 'css-loader'],
37+
test: /\.(css|scss|sass)$/,
38+
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
3939
},
4040
// Check for images imported in .js files and
4141
{

0 commit comments

Comments
 (0)