Skip to content

Commit

Permalink
Moved from CSS to SASS with gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Oct 11, 2016
1 parent 94a19f5 commit dd9d1a9
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 49 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
.vscode/

# Gulp
css

# Build
electronizr-linux-armv7l/
electronizr-linux-ia32/
electronizr-linux-x64/
electronizr-win32-ia32/
electronizr-win32-x64/
electronizr-darwin-ia32/
electronizr-darwin-x64/

# Logs
logs
*.log
Expand Down
47 changes: 47 additions & 0 deletions assets/scss/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@import 'https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i';

$background-color: transparentize(#ECEFF1, 0.05);
$text-color: #212121;
$highlight-color: #0277BD;

body{
background-color: $background-color;
margin: 0;
padding: 0;

font-family: 'Roboto', 'Segoe UI', sans-serif;
}

div.vertical-center{
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;

input{
width: 100%;
padding: 15px 0;
border: none;
outline: none;
text-align: center;
background-color: transparent;
color: $text-color;
font-size: 36px;
font-weight: 600;
}

div.result-value{
width: 100%;
min-height: 40px;
text-align: center;
color: $highlight-color;
font-size: 24px;
font-weight: 400;
}

div.result-path{
width: 100%;
display: none;
text-align: center;
}
}
43 changes: 0 additions & 43 deletions css/styles.css

This file was deleted.

24 changes: 24 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');

var filesToWatch = [
'./assets/scss/**/*.scss'
];

var sassFileToCompile = './assets/scss/app.scss';
var sassDestFolder = './css';

gulp.task('sass', function(){
return gulp
.src(sassFileToCompile)
.pipe(sass().on('error', sass.logError))
.pipe(minifyCss())
.pipe(gulp.dest(sassDestFolder));
});

gulp.task('watch', ['sass'], function(){
gulp.watch(filesToWatch, ['sass'])
});
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>electronizr</title>
<link rel="stylesheet" href="./css/styles.css">
<link rel="stylesheet" href="./css/app.css">
</head>
<body>

Expand Down
4 changes: 0 additions & 4 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,5 @@ $(function(){
searchResultIndex++;
DisplaySearchResult();
}
if(e.keyCode === 38){
searchResultIndex--;
DisplaySearchResult;
}
});
});
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"fast-levenshtein": "^2.0.5"
},
"devDependencies": {
"electron-prebuilt": "^0.35.2"
"electron-prebuilt": "^0.35.2",
"gulp": "^3.9.1",
"gulp-minify-css": "^1.2.4",
"gulp-sass": "^2.3.2"
},
"scripts": {
"start": "electron main.js"
Expand Down

0 comments on commit dd9d1a9

Please sign in to comment.