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

Commit 0fe6abe

Browse files
authored
Fix interpolated vars (#120)
1 parent 97ec5c4 commit 0fe6abe

12 files changed

+9850
-4754
lines changed

.tool-versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 8.12.0
1+
nodejs 12.13.0

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
_The format of this document is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)._
22

3+
## [v1.3.1](https://github.com/RaspberryPiFoundation/Bits/compare/v1.3.0...v1.3.1) - 2019-11-11
4+
5+
### Fixed
6+
7+
- Fixed warnings relating to interpolation of color vars in Sass selectors
8+
- Fixed warning relating to `text-decoration-skip`
9+
10+
### Changed
11+
12+
- Update NodeJS version dependency
13+
- Updated Gulp packages and config
14+
315
## [v1.3.0](https://github.com/RaspberryPiFoundation/Bits/compare/v1.2.2...v1.3.0) - 2019-11-06
416

517
### Added

Gulpfile.js

+33-43
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
const gulp = require('gulp')
44
const pkg = require('./package.json')
55

6-
const autoprefixer = require('gulp-autoprefixer')
6+
const autoprefixer = require('autoprefixer')
77
const cssnano = require('gulp-cssnano')
88
const header = require('gulp-header')
99
const notify = require('gulp-notify')
10+
const postcss = require('gulp-postcss')
1011
const rename = require('gulp-rename')
11-
const sass = require('gulp-sass')
12+
const sass = require('gulp-dart-sass')
1213
const sourcemaps = require('gulp-sourcemaps')
1314
const stripComments = require('gulp-strip-css-comments')
1415

16+
const cssDestDir = './lib'
17+
const cssDestFile = 'Bits.css'
18+
const cssDestFileMin = 'Bits.min.css'
19+
const sassEntryFile = './src/styles/main.scss'
20+
const sassSourceDir = './src/styles'
21+
1522
// Set banner template
1623
const banner = [
1724
'/*',
@@ -27,58 +34,41 @@ const banner = [
2734
'',
2835
].join('\n')
2936

30-
// Get configuration files
31-
const assetsConfig = {
32-
stylesheets: {
33-
main: './src/styles/main.scss',
34-
destDir: './lib',
35-
buildFile: 'Bits.css',
36-
buildFileMin: 'Bits.min.css',
37-
},
38-
}
39-
40-
gulp.task('compile_all', ['compile_stylesheets'])
41-
42-
gulp.task('compile_stylesheets', () => {
43-
let config = assetsConfig.stylesheets
44-
37+
const compileScss = () => {
4538
return gulp
46-
.src([config.main])
47-
.pipe(
48-
sass().on('error', err => {
49-
return notify().write(err)
50-
}),
51-
)
52-
.pipe(stripComments())
53-
.pipe(
54-
autoprefixer({
55-
cascade: false,
56-
}),
57-
)
39+
.src(sassEntryFile)
40+
.pipe(sass().on('error', sass.logError))
5841
.pipe(
5942
header(banner, {
60-
buildFile: config.buildFile,
6143
pkg: pkg,
62-
}),
44+
})
6345
)
64-
.pipe(rename(config.buildFile))
65-
.pipe(gulp.dest(config.destDir))
46+
.pipe(rename(cssDestFile))
47+
.pipe(gulp.dest(cssDestDir))
48+
.pipe(stripComments())
6649
.pipe(sourcemaps.init())
6750
.pipe(cssnano())
51+
.pipe(
52+
postcss([
53+
autoprefixer({
54+
flexbox: true,
55+
grid: true,
56+
}),
57+
])
58+
)
6859
.pipe(
6960
header(banner, {
70-
buildFile: config.buildFile,
7161
pkg: pkg,
72-
}),
62+
})
7363
)
74-
.pipe(rename(config.buildFileMin))
64+
.pipe(rename(cssDestFileMin))
7565
.pipe(sourcemaps.write('.'))
76-
.pipe(gulp.dest(config.destDir))
77-
.pipe(notify(`${pkg.name} Gulp: stylesheets completed`))
78-
})
66+
.pipe(gulp.dest(cssDestDir))
67+
.pipe(notify('Sass compiled! ヽ(゜∇゜)ノ'))
68+
}
7969

80-
gulp.task('watch', () => {
81-
gulp.watch('./src/**/*.scss', ['compile_stylesheets'])
82-
})
70+
const watch = () => gulp.watch(sassSourceDir + '/**/*', compileScss)
8371

84-
gulp.task('default', ['compile_all', 'watch'])
72+
gulp.task('build', gulp.series(compileScss))
73+
gulp.task('start', gulp.series(watch))
74+
gulp.task('watch', gulp.series(watch))

0 commit comments

Comments
 (0)