Skip to content

Commit 01ae528

Browse files
committed
BUILD: Move from scssphp to sass
1 parent 5e65ebf commit 01ae528

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

.browserslistrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Browsers supported in our CSS
2+
3+
last 4 versions

build.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const sass = require('sass');
2+
const fs = require('fs');
3+
const autoprefixer = require('autoprefixer');
4+
5+
async function renderScss(filename) {
6+
const inFile = `./scss/${filename}.scss`;
7+
const outFile = `./public_html/css/${filename}.css`;
8+
9+
console.log(`Converting ${inFile} to css`);
10+
const output = sass.renderSync({
11+
outputStyle: "compressed",
12+
file: inFile,
13+
14+
});
15+
16+
console.log(`Applying autoprefixer`);
17+
const result = await autoprefixer.process(output.css, { from: undefined });
18+
19+
console.log(`Writing to ${outFile}`);
20+
fs.writeFileSync(outFile, result.css);
21+
}
22+
23+
renderScss('main_rtl');
24+
renderScss('main_ltr');

composer.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"piwik/device-detector": "^3.11",
1818
"spatie/yaml-front-matter": "^2.0",
1919
"erusev/parsedown": "^1.7",
20-
"scssphp/scssphp": "^1.2",
2120
"composer/semver": "^3.2",
2221
"phpfastcache/phpfastcache": "^8.0",
2322
"league/csv": "^9.6",
@@ -34,7 +33,6 @@
3433
"scripts": {
3534
"build-common": [
3635
"@icons",
37-
"@scss",
3836
"@localize"
3937
],
4038
"build": [
@@ -61,11 +59,6 @@
6159
"update-data": [
6260
"php include/DataUtils.php"
6361
],
64-
"scss": [
65-
"pscss -f compressed ./scss/main_ltr.scss > ./public_html/css/main_ltr.css",
66-
"pscss -f compressed ./scss/main_rtl.scss > ./public_html/css/main_rtl.css",
67-
"pscss -f compressed ./scss/pages/_mirrorbrain.scss > ./public_html/css/mirrorbrain.css"
68-
],
6962
"localize": [
7063
"php include/LocalizationUtils.php"
7164
],

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
"version": "1.0.0",
55
"dependencies": {
66
"autoprefixer": "^9.8.6",
7-
"postcss-cli": "^6.1.3"
8-
},
9-
"devDependencies": {
7+
"postcss-cli": "^6.1.3",
108
"sass": "1.26.10"
119
},
1210
"scripts": {
13-
"postinstall": "postcss ./public_html/css/*.css --use autoprefixer --no-map -r",
14-
"sass": "sass --watch ./scss:./public_html/css"
11+
"scss:watch": "sass --watch ./scss:./public_html/css",
12+
"build": "node build.js"
1513
}
1614
}

0 commit comments

Comments
 (0)