Skip to content

Commit 3097718

Browse files
committed
[REF] css: remove scss files
This commit removes all SCSS files and replaces them with CSS files. The build process has been updated to bundle CSS files instead of SCSS files. This change is done as a preparation step to remove all the css in Odoo. With this commit, the dependency on the `sass` package has been removed. closes #7187 Task: 5102925 Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
1 parent e7ae2f0 commit 3097718

File tree

107 files changed

+459
-620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+459
-620
lines changed

.husky/scss_check.js renamed to .husky/css_check.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { existsSync, readFileSync } from "fs";
33
import process from "process";
44

55
const commentPattern = /\/\/.*|\/\*[\s\S]*?\*\//g;
6-
const firstLevelSelectorPattern = /^(?!(\s|\$|\}|\))).+/gm;
6+
const firstLevelSelectorPattern = /^(?!(\s|\}|:root)).+/gm;
77

8-
// Get scss files in diff
8+
// Get css files in diff
99
const files = execSync("git diff --name-only --cached")
1010
.toString()
1111
.split("\n")
12-
.filter((file) => file.endsWith(".scss"));
12+
.filter((file) => file.endsWith(".css"));
1313

1414
const faultyFiles = [];
1515

@@ -29,7 +29,7 @@ for (const file of files) {
2929
if (faultyFiles.length > 0) {
3030
const fileList = " - " + faultyFiles.join("\n - ");
3131
console.log(`\x1b[31m
32-
Some scss files are not scoped to .o-spreadsheet. Please fix them before committing.
32+
Some css files are not scoped to .o-spreadsheet. Please fix them before committing.
3333
Faulty files:
3434
3535
${fileList}

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ if [ "$HUSKY_PRE_COMMIT" != 0 ]; then
3636
fi
3737

3838
# Css wrap check
39-
node .husky/scss_check.js
39+
node .husky/css_check.js
4040
fi

package-lock.json

Lines changed: 0 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"bundle:iife": "rollup -c -m -- --format iife",
2121
"bundle:esm": "rollup -c -m -- --format esm",
2222
"bundle:xml": "node tools/bundle_xml/main.cjs",
23-
"bundle:dev": "npm-run-all build:js bundle:iife \"bundle:xml -- --outDir build\" && node tools/bundle_scss/main.cjs --out build",
24-
"dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c && npm run bundle:xml -- --outDir dist && node tools/bundle_scss/main.cjs --out dist",
23+
"bundle:dev": "npm-run-all build:js bundle:iife \"bundle:xml -- --outDir build\" && node tools/bundle_css/main.cjs --out build",
24+
"dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c && npm run bundle:xml -- --outDir dist && node tools/bundle_css/main.cjs --out dist",
2525
"monkey": "SPREADSHEET_MONKEY_COUNT=$npm_config_monkey_count jest 'tests/collaborative/collaborative_monkey_party.test.ts'",
2626
"test": "tsc --noEmit --project tsconfig.jest.json && jest",
2727
"test:watch": "jest --watch",
@@ -32,10 +32,10 @@
3232
"watch:bundle": "npm run bundle:iife -- --watch",
3333
"watch:ts": "npm run build:js -- --watch",
3434
"watch:xml": "node tools/bundle_xml/watch_xml_templates.cjs",
35-
"watch:scss": "node tools/bundle_scss/watch_scss_files.cjs",
35+
"watch:css": "node tools/bundle_css/watch_css_files.cjs",
3636
"unzipXlsx": "node tools/bundle_xlsx/unzip_xlsx_demo.cjs",
3737
"zipXlsx": "node tools/bundle_xlsx/zip_xlsx_demo.cjs",
38-
"build": "npm-run-all build:js bundle:esm \"bundle:xml -- --outDir build\" && node tools/bundle_scss/main.cjs --out build",
38+
"build": "npm-run-all build:js bundle:esm \"bundle:xml -- --outDir build\" && node tools/bundle_css/main.cjs --out build",
3939
"lint": "eslint --fix"
4040
},
4141
"browserslist": [
@@ -95,7 +95,6 @@
9595
"rollup": "^3.28.0",
9696
"rollup-plugin-dts": "^5.3.1",
9797
"rollup-plugin-typescript2": "^0.35.0",
98-
"sass": "^1.62.1",
9998
"seedrandom": "^3.0.5",
10099
"typescript": "^5.8.2",
101100
"typescript-eslint": "^8.30.1",
File renamed without changes.

src/components/autofill/autofill.scss renamed to src/components/autofill/autofill.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
position: absolute;
44
border: 1px solid white;
55
background-color: #1a73e8;
6-
height: $os-autofill-edge-length;
7-
width: $os-autofill-edge-length;
6+
height: var(--os-autofill-edge-length);
7+
width: var(--os-autofill-edge-length);
88
}
99

1010
.o-autofill-handler {
1111
position: absolute;
12-
height: $os-autofill-edge-length;
13-
width: $os-autofill-edge-length;
12+
height: var(--os-autofill-edge-length);
13+
width: var(--os-autofill-edge-length);
1414
&:hover {
1515
cursor: crosshair;
1616
}

src/components/border_editor/border_editor.scss renamed to src/components/border_editor/border_editor.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
background-color: white;
55

66
.o-divider {
7-
border-right: 1px solid $os-gray-300;
7+
border-right: 1px solid var(--os-gray-300);
88
margin: 0 6px;
99
}
1010

@@ -17,7 +17,7 @@
1717
width: 26px;
1818
height: 26px;
1919
&.active {
20-
background-color: $os-button-active-bg;
20+
background-color: var(--os-button-active-bg);
2121
}
2222
}
2323
}
@@ -55,7 +55,7 @@
5555
.o-dropdown-border-type {
5656
cursor: pointer;
5757
&:not(.o-disabled):not(.active):hover {
58-
background-color: $os-button-hover-bg;
58+
background-color: var(--os-button-hover-bg);
5959
}
6060
}
6161
.o-dropdown-border-check {

src/components/bottom_bar/bottom_bar.scss renamed to src/components/bottom_bar/bottom_bar.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
.o-spreadsheet-bottom-bar {
33
font-size: 15px;
44
border-top: 1px solid lightgrey;
5-
background-color: $os-background-gray-color;
6-
padding-left: $os-header-width;
5+
background-color: var(--os-background-gray-color);
6+
padding-left: var(--os-header-width);
77

88
.o-sheet-item {
99
cursor: pointer;

src/components/bottom_bar/bottom_bar_sheet/bottom_bar_sheet.scss renamed to src/components/bottom_bar/bottom_bar_sheet/bottom_bar_sheet.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.o-sheet {
33
padding: 0 15px;
44
padding-right: 10px;
5-
height: $os-desktop-bottombar-height;
5+
height: var(--os-desktop-bottombar-height);
66
border-left: 1px solid #c1c1c1;
77
border-right: 1px solid #c1c1c1;
88
margin-left: -1px;
@@ -12,7 +12,7 @@
1212
}
1313

1414
&.active {
15-
color: $os-action-color;
15+
color: var(--os-action-color);
1616
background-color: #ffffff;
1717
box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.15);
1818
}
@@ -48,6 +48,6 @@
4848
}
4949

5050
.o-spreadshet-mobile .o-sheet {
51-
height: $os-mobile-bottombar-height;
51+
height: var(--os-mobile-bottombar-height);
5252
}
5353
}

0 commit comments

Comments
 (0)