File tree Expand file tree Collapse file tree 4 files changed +30
-12
lines changed
Expand file tree Collapse file tree 4 files changed +30
-12
lines changed Original file line number Diff line number Diff line change 1+ # Browsers supported in our CSS
2+
3+ last 4 versions
Original file line number Diff line number Diff line change 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' ) ;
Original file line number Diff line number Diff line change 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" ,
3433 "scripts" : {
3534 "build-common" : [
3635 " @icons" ,
37- " @scss" ,
3836 " @localize"
3937 ],
4038 "build" : [
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 ],
Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments