Skip to content

Commit

Permalink
fix(variables): set default prop in sass
Browse files Browse the repository at this point in the history
  • Loading branch information
crsten committed Aug 13, 2018
1 parent a25c828 commit 9b03d7c
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 6 deletions.
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,71 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Build Status](https://travis-ci.org/ElderAS/vue-elder.svg?branch=master&style=flat-square)](https://travis-ci.org/ElderAS/vue-elder)
[![npm](https://img.shields.io/npm/dt/vue-elder.svg?style=flat-square)](https://www.npmjs.com/package/vue-elder)
[![npm](https://img.shields.io/npm/v/vue-elder.svg?style=flat-square)](https://www.npmjs.com/package/vue-elder)
![npm](https://img.shields.io/npm/l/vue-elder.svg?style=flat-square)

# vue-elder

## Setup

### Install package

```
npm install --save vue-elder
```

### Override default colors, etc...

Regular webpack

```js
// webpack.config.js -> module.rules
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
// you can also read from a file, e.g. `variables.scss`
data: `$color: red;`
}
}
]
}
```

Vue-cli

```js
//vue.config.js
module.exports = {
css: {
loaderOptions: {
sass: {
// you can also read from a file, e.g. `variables.scss`
data: `$color: red;`,
},
},
},
}
```

## Usage

```js
//Component.vue
import { ButtonComponent } from 'vue-elder'

export default {
components: {
ButtonComponent,
},
}
```

## License

[The MIT License](http://opensource.org/licenses/MIT)
Copyright (c) Elder AS
12 changes: 6 additions & 6 deletions _variables.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//Colors
$primary: #3a9acd;
$secondary: #ff773f;
$warning: #ff773f;
$success: #33ca62;
$error: #e83b35;
$primary: #3a9acd !default;
$secondary: #ff773f !default;
$warning: #ff773f !default;
$success: #33ca62 !default;
$error: #e83b35 !default;

$border-radius: 3px;
$border-radius: 3px !default;
$states: (
('primary', $primary, #ffffff),
('secondary', $secondary, #ffffff),
Expand Down
1 change: 1 addition & 0 deletions button/src/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,4 @@ export default {
}
</style>


0 comments on commit 9b03d7c

Please sign in to comment.