Merge lp:~deadlight/canonical-identity-provider/add-vanilla-and-sass into lp:~deadlight/canonical-identity-provider/vanilla

Proposed by Karl Williams
Status: Merged
Approved by: Karl Williams
Approved revision: 1688
Merged at revision: 1688
Proposed branch: lp:~deadlight/canonical-identity-provider/add-vanilla-and-sass
Merge into: lp:~deadlight/canonical-identity-provider/vanilla
Diff against target: 94 lines (+42/-10)
3 files modified
gulpfile.js (+29/-8)
package.json (+4/-2)
src/identityprovider/static_src/scss/styles.scss (+9/-0)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/add-vanilla-and-sass
Reviewer Review Type Date Requested Status
Anthony Dillon (community) Approve
Review via email: mp+370132@code.launchpad.net

Description of the change

Updated the gulp file to build sass.
Added gulp-sass as a dependency along with vanilla-framework itself.

To allow development alongside the existing styling, the existing css is still build as well as the new *.scss files, which use the vanilla-framework dependency.

----

QA

* Run gulp: ./node_modules/gulp/bin/gulp.js
* make start-db run
* Ensure that the frontend looks the same at [host]:8000
* See that the vanilla css has been generated at [host]:8000/assets/vanilla-css/styles.css

To post a comment you must log in.
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

The CSS has grown some so we may want to consider cherry-picking components in the future.

Few small suggests in the code

review: Needs Fixing
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

Also do we want to check in the CSS here? Shouldn't that be included in a build step.

Revision history for this message
Karl Williams (deadlight) wrote :

I'm not checking in the Vanilla-generated CSS, for some reason the CSS file for the existing content has changed. I'll just remove it from this build since I should be making no changes to existing styling.

Re: cherry-picking - we can do an audit of used components at the end of the project and just include css for what we're using.

1685. By Karl Williams

Add node modules directory to the includes path for sass

1686. By Karl Williams

Revert to pre-vanilla

1687. By Karl Williams

Add short path for vanilla and remove unused css

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

A few points in the code.

review: Needs Fixing
1688. By Karl Williams

Rename param variables for sass build and use autoprefixer

Revision history for this message
Karl Williams (deadlight) wrote :

Ant: This commit cleans up the issues you noted.

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gulpfile.js'
2--- gulpfile.js 2015-12-09 19:56:22 +0000
3+++ gulpfile.js 2019-07-17 10:57:06 +0000
4@@ -4,27 +4,48 @@
5 var del = require('del');
6 var gulp = require('gulp');
7 var prefix = require('gulp-autoprefixer');
8+var sass = require('gulp-sass');
9
10 var paths = {
11- css: {
12- src: ['./src/identityprovider/static_src/css/*.css'],
13- dest: './src/identityprovider/static/css/'
14- }
15+ css: {
16+ src: ['./src/identityprovider/static_src/css/*.css'],
17+ dest: './src/identityprovider/static/css/'
18+ },
19+ vanillaCss: {
20+ nodeModules: './node_modules/',
21+ src: './src/identityprovider/static_src/scss/*.scss',
22+ dest: './src/identityprovider/static/vanilla-css/'
23+ }
24 };
25
26
27-gulp.task('default', ['watch', 'css']);
28+gulp.task('default', ['watch', 'css', 'sass']);
29
30 gulp.task('watch', function () {
31- var watcher = gulp.watch(paths.css.src, ['css']);
32+ gulp.watch(paths.css.src, ['css']);
33+ gulp.watch(paths.vanillaCss.sass, ['sass']);
34 });
35
36 gulp.task('clean', function(cb) {
37- del([paths.css.dest], cb);
38+ del([paths.css.dest], cb);
39+});
40+
41+
42+gulp.task('vanilla-clean', function(cb) {
43+ del([paths.vanillaCss.dest], cb);
44+});
45+
46+gulp.task('sass', ['vanilla-clean'], function() {
47+ return gulp.src(paths.vanillaCss.src)
48+ .pipe(sass({
49+ includePaths : [paths.vanillaCss.nodeModules]
50+ }).on('error', sass.logError))
51+ .pipe(prefix())
52+ .pipe(gulp.dest(paths.vanillaCss.dest));
53 });
54
55 gulp.task('css', ['clean'], function() {
56- gulp.src(paths.css.src)
57+ gulp.src(paths.css.src)
58 .pipe(prefix(["last 2 versions"])) // https://github.com/ai/autoprefixer
59 // disabled lint until CSS is refactored
60 // .pipe(csslint('csslintrc.json'))
61
62=== modified file 'package.json' (properties changed: -x to +x)
63--- package.json 2018-12-13 16:31:16 +0000
64+++ package.json 2019-07-17 10:57:06 +0000
65@@ -2,10 +2,12 @@
66 "private": true,
67 "devDependencies": {
68 "del": "~0.1.1",
69- "gulp": "~3.8.7",
70+ "gulp": "^3.8.11",
71+ "gulp-autoprefixer": "0.0.8",
72 "gulp-concat": "~2.3.4",
73 "gulp-csslint": "~0.1.5",
74 "gulp-csso": "~0.2.9",
75- "gulp-autoprefixer": "0.0.8"
76+ "gulp-sass": "4.0.2",
77+ "vanilla-framework": "2.0.1"
78 }
79 }
80
81=== added directory 'src/identityprovider/static_src/scss'
82=== added file 'src/identityprovider/static_src/scss/styles.scss'
83--- src/identityprovider/static_src/scss/styles.scss 1970-01-01 00:00:00 +0000
84+++ src/identityprovider/static_src/scss/styles.scss 2019-07-17 10:57:06 +0000
85@@ -0,0 +1,9 @@
86+@charset "UTF-8";
87+
88+$color-navigation-background: #363636;
89+
90+@import 'vanilla-framework/scss/build';
91+
92+.p-cip-hero {
93+ background-image: linear-gradient(212deg, #E95420 0%, #C44631 6%, #A33940 12%, #8B304A 18%, #7C2B51 24%, #772953 29%, #55163B 51%, #370626 75%, #2C001E 100%);
94+}

Subscribers

People subscribed via source and target branches

to all changes: