Skip to content

Commit 85d42cd

Browse files
committed
working around a bug in vue-loader by putting module styles first
And removing redundant id="app" element
1 parent c9f83bc commit 85d42cd

File tree

2 files changed

+41
-42
lines changed

2 files changed

+41
-42
lines changed

fixtures/vuejs-css-modules/App.vue

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
11
<template>
2-
<div id="app" class="red large justified lowercase block" :class="[$css.italic, $scss.bold, $less.underline, $stylus.rtl, $postcss.hidden]"></div>
2+
<div class="red large justified lowercase block" :class="[$css.italic, $scss.bold, $less.underline, $stylus.rtl, $postcss.hidden]"></div>
33
</template>
44

5+
<style module="$css">
6+
.italic {
7+
font-style: italic;
8+
}
9+
</style>
10+
11+
<style lang="scss" module="$scss">
12+
.bold {
13+
font-weight: bold;
14+
}
15+
</style>
16+
17+
<style lang="less" module="$less">
18+
.underline {
19+
text-decoration: underline;
20+
}
21+
</style>
22+
23+
<style lang="styl" module="$stylus">
24+
.rtl
25+
direction: rtl;
26+
</style>
27+
28+
<style lang="postcss" module="$postcss">
29+
.hidden {
30+
visibility: hidden;
31+
}
32+
</style>
33+
534
<style>
635
.red {
736
color: red;
@@ -30,33 +59,3 @@
3059
display: block;
3160
}
3261
</style>
33-
34-
35-
<style module="$css">
36-
.italic {
37-
font-style: italic;
38-
}
39-
</style>
40-
41-
<style lang="scss" module="$scss">
42-
.bold {
43-
font-weight: bold;
44-
}
45-
</style>
46-
47-
<style lang="less" module="$less">
48-
.underline {
49-
text-decoration: underline;
50-
}
51-
</style>
52-
53-
<style lang="styl" module="$stylus">
54-
.rtl
55-
direction: rtl;
56-
</style>
57-
58-
<style lang="postcss" module="$postcss">
59-
.hidden {
60-
visibility: hidden;
61-
}
62-
</style>

test/functional.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,17 +1802,17 @@ module.exports = {
18021802
'build/main.js'
18031803
],
18041804
(browser) => {
1805-
browser.assert.hasClass('#app', 'red'); // Standard CSS
1806-
browser.assert.hasClass('#app', 'large'); // Standard SCSS
1807-
browser.assert.hasClass('#app', 'justified'); // Standard Less
1808-
browser.assert.hasClass('#app', 'lowercase'); // Standard Stylus
1809-
browser.assert.hasClass('#app', 'block'); // Standard Stylus
1810-
1811-
browser.assert.hasClass('#app', 'italic_foo'); // CSS module
1812-
browser.assert.hasClass('#app', 'bold_foo'); // SCSS module
1813-
browser.assert.hasClass('#app', 'underline_foo'); // Less module
1814-
browser.assert.hasClass('#app', 'rtl_foo'); // Stylus module
1815-
browser.assert.hasClass('#app', 'hidden_foo'); // Stylus module
1805+
browser.assert.hasClass('#app div', 'red'); // Standard CSS
1806+
browser.assert.hasClass('#app div', 'large'); // Standard SCSS
1807+
browser.assert.hasClass('#app div', 'justified'); // Standard Less
1808+
browser.assert.hasClass('#app div', 'lowercase'); // Standard Stylus
1809+
browser.assert.hasClass('#app div', 'block'); // Standard Stylus
1810+
1811+
browser.assert.hasClass('#app div', 'italic_foo'); // CSS module
1812+
browser.assert.hasClass('#app div', 'bold_foo'); // SCSS module
1813+
browser.assert.hasClass('#app div', 'underline_foo'); // Less module
1814+
browser.assert.hasClass('#app div', 'rtl_foo'); // Stylus module
1815+
browser.assert.hasClass('#app div', 'hidden_foo'); // Stylus module
18161816

18171817
done();
18181818
}

0 commit comments

Comments
 (0)