Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit dcbdb8c

Browse files
maximgeerinckbutlerx
authored andcommitted
Gulp should also include the fonts, they are not done automatic in th… (#46)
* Gulp should also include the fonts, they are not done automatic in this way Other solution would be using the npm of materialize correctly * Add font and margin variables Use better naming for primary color rather than the color name itsself (prevents confusion) * use https rather than http for the google fonts
1 parent cb77309 commit dcbdb8c

File tree

3 files changed

+46
-21
lines changed

3 files changed

+46
-21
lines changed

css/main.scss

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
@import url(//fonts.googleapis.com/css?family=Roboto:100,300,400);
1+
@import url(https://fonts.googleapis.com/css?family=Roboto:100,300,400);
22
@import 'variables';
33
@import '../node_modules/materialize-css/sass/materialize.scss';
44

55
body {
6-
background-color: $color-grey;
6+
background-color: $color-primary;
77
.wrapper {
88
display: flex;
99
flex-wrap: wrap;
1010
justify-content: center;
1111

1212
.title {
13-
margin: 0 32px;
13+
margin: $title-margin;
1414
text-align: center;
1515

1616
&__text {
17-
margin: .5em 0 .3em;
18-
font-size: 15vmin;
19-
font-weight: 100;
17+
margin: $text-margin;
18+
font-size: $title-font-size;
19+
font-weight: $title-font-weight;
2020

2121
&__colour {
2222
color: $color-red;
23-
font-weight: 300;
23+
font-weight: $title-colored-font-weight;
2424
}
2525

2626
a {
@@ -30,7 +30,7 @@ body {
3030

3131
.menu {
3232
list-style-type: none;
33-
margin: 8px 0;
33+
margin: $menu-margin;
3434
padding: 0;
3535
overflow: hidden;
3636
display: flex;
@@ -52,10 +52,10 @@ body {
5252
&__title {
5353
width: auto;
5454
display: inline;
55-
font-weight: 300;
55+
font-weight: $day-title-font-weight;
5656

5757
&__bold {
58-
font-weight: 500;
58+
font-weight: $day-title-font-weight-bold;
5959
}
6060
}
6161
}
@@ -66,9 +66,9 @@ body {
6666
&__time {
6767
float: left;
6868
display: inline-block;
69-
font-size: 1.5vh;
69+
font-size:$event-time-font-size;
7070
width: 15%;
71-
margin-right: 1em;
71+
margin: $event-time-margin;
7272
max-width: 5em;
7373
}
7474

@@ -85,11 +85,11 @@ body {
8585
}
8686

8787
p {
88-
font-weight: 300;
88+
font-weight: $p-font-weight;
8989
}
9090

9191
ul {
92-
margin-bottom: 2vh;
92+
margin: $ul-margin;
9393
}
9494

9595
.collapsible-header {
@@ -110,7 +110,7 @@ ul {
110110
}
111111

112112
.collapsible-body, .collapsible-header {
113-
border-top: 1px solid $color-lightish-grey;
113+
border-top: $collapsible-body-border;
114114
}
115115
}
116116

@@ -126,7 +126,7 @@ ul {
126126

127127
span {
128128
display: block;
129-
font-size: 2em;
129+
font-size: $countdown-font-size;
130130
}
131131
}
132132
}
@@ -143,10 +143,10 @@ ul {
143143

144144
.collapsible.popout > li {
145145
background-color: $color-white;
146-
margin: 0 16px;
146+
margin: $popout-element-margin;
147147

148148
&.active {
149-
margin: 0 8px;
149+
margin: $popout-element-margin-active;
150150
}
151151
}
152152

css/variables.scss

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ $large-phone: 560px;
55
// Colour variables
66
$color-red: red;
77
$color-black: black;
8-
$color-grey: #eee;
8+
$color-primary: #eee;
99
$color-lightish-grey: #ddd;
1010
$color-white: white;
11+
12+
13+
$title-font-size: 15vmin;
14+
$title-font-weight: 100;
15+
$title-colored-font-weight: 300;
16+
$day-title-font-weight: 300;
17+
$day-title-font-weight-bold: 500;
18+
$event-time-font-size: 1.5vh;
19+
$p-font-weight: 300;
20+
$countdown-font-size: 2em;
21+
22+
$title-margin: 0 32px;
23+
$text-margin: .5em 0 .3em;
24+
$menu-margin: 8px 0;
25+
$event-time-margin: 0 1em 0 0;
26+
$ul-margin: 0 0 2vh 0;
27+
$popout-element-margin: 0 16px;
28+
$popout-element-margin-active: 0 8px;
29+
$collapsible-body-border: 1px solid $color-lightish-grey;

gulpfile.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var rename = require('gulp-rename');
77
var connect = require('gulp-connect');
88
var jsonSchema = require('gulp-json-schema');
99

10-
gulp.task('dev', ['compress', 'scss', 'webserver', 'validate'], function () {
10+
gulp.task('dev', ['compress', 'scss', 'fonts', 'webserver', 'validate'], function () {
1111
gulp.watch(['./css/*.scss', './js/*.js', './**/*.html'], ['scss', 'compress', 'html']);
1212
});
1313

@@ -41,6 +41,12 @@ gulp.task('webserver', function() {
4141
});
4242
});
4343

44+
45+
gulp.task('fonts', function() {
46+
return gulp.src('./node_modules/materialize-css/fonts/**')
47+
.pipe(gulp.dest('dist/fonts'))
48+
});
49+
4450
gulp.task('html', function() {
4551
gulp.src('./**/*.html')
4652
.pipe(connect.reload());
@@ -51,4 +57,4 @@ gulp.task('validate', () => {
5157
.pipe(jsonSchema('schema.json'));
5258
});
5359

54-
gulp.task('default', ['compress', 'scss', 'validate']);
60+
gulp.task('default', ['compress', 'scss', 'fonts', 'validate']);

0 commit comments

Comments
 (0)