Skip to content

Commit

Permalink
Create using-css-frameworks.md
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist authored Nov 19, 2016
1 parent d57f84b commit f54ab31
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/using-css-frameworks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# CSS frameworks

You may intend to load CSS files from Bootstrap, Bulma.css, Element-UI, there're various ways to do this:

## Option 1. load in JavaScript files

```js
import '/path/to/file.css'
// or commonjs
require('/path/to/file.css')

// if you're loading something like `file.scss`
// be sure to add sass-loader in webpack config for `.scss` files
import '/path/to/file.scss'
```

## Option 2. load in single file component

This way is way more easier, since you don't need to modify webpack config, just installing the relevant loaders is enough.

```vue
<style src="/path/to/file.css"></style>
<!-- or sass with sass-loader and node-sass installed -->
<style src="/path/to/file.scss" lang="sass"></style>
<!-- for example, loading sass files and update variables in bulma css framework -->
<style lang="sass">
$blue: #72d0eb;
$pink: #ffb3b3;
$family-serif: "Georgia", serif;
@import "~bulma";
</style>
```

0 comments on commit f54ab31

Please sign in to comment.