Skip to content

Commit abffa5d

Browse files
committed
styles
1 parent 112b5e8 commit abffa5d

File tree

5 files changed

+3435
-70
lines changed

5 files changed

+3435
-70
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Vue Component](#vue-component)
1717
- [.Vue Files](#vue-files)
1818
- [ES6 Transpiling](#es6-transpiling)
19+
- [Styles](#styles)
1920

2021
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2122

@@ -222,3 +223,24 @@ npm install [email protected] [email protected] [email protected] babel-preset
222223
Update [.eslintrc.js](.eslintrc.js) to include babel eslint parser.
223224

224225
Finally configure babel with [.babelrc](.babelrc). This specifies for babel NOT to use modulesl because that's being handled by webpack.
226+
227+
### Styles
228+
229+
For this course, will use something smaller than Bootstrap, instead will use [Bulma](https://bulma.io/documentation/columns/basics/).
230+
231+
```shell
232+
npm install [email protected] --save
233+
```
234+
235+
Then add `<style></style>` tag to [Layout.vue](src/theme/Layout.vue)
236+
237+
This tag accepts a lang attribute to indicate what to use to pre-process css (scss or stylus).
238+
(same is true for script and template tags, for example could have `lang="coffee"` to use CoffeeScript).
239+
240+
For this course, will use sass `<style lang="scss">...</style>`.
241+
242+
Will need to add appropriate loader to webpack config to parse styles, and install deps:
243+
244+
```shell
245+
246+
```

build/webpack.base.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ const config = {
1313
loader: 'eslint-loader', // using eslint-loader
1414
exclude: /node_modules/ // do not lint node_modules folder
1515
},
16-
// vue
16+
// vue + css + sass
1717
{
1818
test: /\.vue$/,
19-
loader: 'vue-loader'
19+
loader: 'vue-loader',
20+
options: {
21+
css: 'css-loader',
22+
'scss': 'css-loader|sass-loader'
23+
}
2024
},
2125
// babel
2226
// NOTE: no check for .vue files because this rule runs AFTER vue-loader converts .vue files to .js

0 commit comments

Comments
 (0)