Merge ~twom/launchpad:sassy-css-fix-test-imports into launchpad:master

Proposed by Tom Wardill
Status: Merged
Approved by: Tom Wardill
Approved revision: 516ceefd523f12ec25268f6d4edd4586dce6d2b7
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~twom/launchpad:sassy-css-fix-test-imports
Merge into: launchpad:master
Diff against target: 65 lines (+10/-10)
4 files modified
.gitignore (+1/-0)
Makefile (+4/-1)
lib/canonical/launchpad/icing/combo.scss (+4/-3)
lib/canonical/launchpad/icing/import.css (+1/-6)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+384954@code.launchpad.net

Commit message

Fix test CSS imports

Description of the change

The JS tests import just the base CSS and test against it.
This was broken as the .css files no longer existed.

Create 'base.css' from the 'base.scss' and import it into the tests. Compile this separate (a fast operation) so that it's always present.

Also fix the 'combo.scss' imports so we're not importing base twice.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
516ceef... by Tom Wardill

fix node version

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index b61b548..a2691e1 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -28,6 +28,7 @@ xxx-report.*
6 lib/canonical/launchpad/apidoc/wadl-development-*.xml
7 lib/canonical/launchpad/apidoc/wadl-test-playground.xml
8 lib/canonical/launchpad/icing/build/*
9+lib/canonical/launchpad/icing/base.css
10 lib/canonical/launchpad/icing/combo.css
11 bin
12 .installed.cfg
13diff --git a/Makefile b/Makefile
14index 74f285e..79025fa 100644
15--- a/Makefile
16+++ b/Makefile
17@@ -182,7 +182,10 @@ css_combine: jsbuild_widget_css
18 ${SHHH} bin/sprite-util create-image
19 ${SHHH} bin/sprite-util create-css
20 ln -sfn ../../../../yarn/node_modules/yui $(ICING)/yui
21- SASS_BINARY_PATH=$(NODE_SASS_BINARY) $(YARN) run node-sass --output-style compressed --include-path $(WD)/$(ICING) --follow --output $(WD)/$(ICING) $(WD)/$(ICING)/combo.scss
22+ # Compile the base.css file separately for tests
23+ SASS_BINARY_PATH=$(NODE_SASS_BINARY) $(YARN) run node-sass --include-path $(WD)/$(ICING) --follow --output $(WD)/$(ICING)/ $(WD)/$(ICING)/css/base.scss
24+ # Compile the combo.css for the main site
25+ SASS_BINARY_PATH=$(NODE_SASS_BINARY) $(YARN) run node-sass --include-path $(WD)/$(ICING) --follow --output $(WD)/$(ICING) $(WD)/$(ICING)/combo.scss
26
27 css_watch: jsbuild_widget_css
28 ${SHHH} bin/sprite-util create-image
29diff --git a/lib/canonical/launchpad/icing/combo.scss b/lib/canonical/launchpad/icing/combo.scss
30index 8ad09e9..efb6a77 100644
31--- a/lib/canonical/launchpad/icing/combo.scss
32+++ b/lib/canonical/launchpad/icing/combo.scss
33@@ -1,4 +1,4 @@
34-@import 'css/base',
35+@import
36 'ubuntu-webfonts',
37 'style',
38 'yui/cssreset/cssreset',
39@@ -16,8 +16,9 @@
40 'build/inline-sprites-2',
41 'build/block-sprites-1',
42 // Include our main stylesheets at the end so they
43-// take precedence over the others.
44+// take precedence over the others (except components).
45 'css/base',
46 // This shouldn't require the _index, but doesn't appear to be allowable
47-// in this version of node-sass (v4.14.4)
48+// in this version of node-sass (v4.14.1).
49+// Components are appended after base.
50 'css/components/_index';
51diff --git a/lib/canonical/launchpad/icing/import.css b/lib/canonical/launchpad/icing/import.css
52index b48ddf5..43def39 100644
53--- a/lib/canonical/launchpad/icing/import.css
54+++ b/lib/canonical/launchpad/icing/import.css
55@@ -1,9 +1,4 @@
56-@import url("css/base.css");
57-@import url("css/typography.css");
58-@import url("css/colours.css");
59-@import url("css/forms.css");
60-@import url("css/layout.css");
61-@import url("css/modifiers.css");
62+@import url("base.css");
63
64 /* We have a few files that need to include some base CSS.
65 This file is purely for that

Subscribers

People subscribed via source and target branches

to status/vote changes: