back to sass

This commit is contained in:
Kyle Spearrin 2019-04-02 23:41:17 -04:00
parent 18f659de7b
commit 53aaf7caa8
11 changed files with 646 additions and 409 deletions

View file

@ -1,29 +1,33 @@
const gulp = require('gulp');
const gulpLess = require('gulp-less');
const gulpSass = require('gulp-sass');
const del = require('del');
const fs = require('fs');
gulpSass.compiler = require('node-sass');
const paths = {
css: './src/App/Css',
};
const lessFiles = [
'./src/App/Less/android.less',
'./src/App/Less/ios.less',
'./src/App/Less/dark.less',
'./src/App/Less/styles.less',
const sassFiles = [
'./src/App/Sass/android.scss',
'./src/App/Sass/ios.scss',
'./src/App/Sass/dark.scss',
'./src/App/Sass/styles.scss',
];
function less() {
return gulp.src(lessFiles).pipe(gulpLess()).pipe(gulp.dest(paths.css));
function sass() {
return gulp.src(sassFiles)
.pipe(gulpSass().on('error', gulpSass.logError))
.pipe(gulp.dest(paths.css));
}
function fixLess(cb) {
function fixSass(cb) {
fs.readdir(paths.css, (err, cssFiles) => {
cssFiles.forEach((cssFile) => {
const file = paths.css + '/' + cssFile;
let fileContents = fs.readFileSync(file, 'utf8');
fileContents = fileContents.replace(/ \^ /g, '^');
fileContents = fileContents.replace(/__/g, '^');
fs.writeFileSync(file, fileContents, 'utf8');
});
cb();
@ -34,6 +38,4 @@ function cleanCss() {
return del(paths.css);
}
exports.cleanCss = cleanCss;
exports.fixLess = fixLess;
exports.less = gulp.series(cleanCss, less, fixLess);
exports.sass = gulp.series(cleanCss, sass, fixSass);

1000
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,11 +2,12 @@
"name": "bitwarden-mobile",
"version": "1.0.0",
"scripts": {
"less": "gulp less"
"sass": "gulp sass"
},
"devDependencies": {
"del": "4.1.0",
"gulp": "4.0.0",
"gulp-less": "4.0.1"
"gulp-sass": "4.0.2",
"node-sass": "4.11.0"
}
}

View file

@ -1,3 +0,0 @@
^Label, ^Entry, ^Editor {
font-size: 16;
}

View file

@ -1,3 +0,0 @@
^Label, ^Entry, ^Editor {
font-size: 14;
}

View file

@ -1 +0,0 @@
@white: #FFFFFF;

View file

@ -0,0 +1,3 @@
__Label, __Entry, __Editor {
font-size: 16;
}

View file

@ -1,3 +1,3 @@
^contentpage {
__contentpage {
background-color: gray;
}

3
src/App/Sass/ios.scss Normal file
View file

@ -0,0 +1,3 @@
__Label, __Entry, __Editor {
font-size: 14;
}

View file

@ -1,7 +1,7 @@
@import "variables.less";
@import "variables.scss";
^ContentPage {
background-color: @white;
__ContentPage {
background-color: $white;
}
StackLayout.list-cell {

View file

@ -0,0 +1 @@
$white: #FFFFFF;