Skip to content

Commit

Permalink
Update tests and README
Browse files Browse the repository at this point in the history
  • Loading branch information
EdMSL committed Nov 20, 2019
1 parent bfdccbd commit 892c78e
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 47 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ node_modules/
npm-debug.log
yarn-error.log
*.css
postcss.config.js
test/test.js
styles/
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ yarn.lock
yarn-error.log
postcss.config.js
test/
styles/
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ body {
}
```

Checkout [tests](test) for more examples.
Checkout [tests](test) for more examples or clone this repository and use:

```console
$ npm i
$ npm run postcss
```

Go to `test/fixtures` folder to see resault.

---

Expand Down
41 changes: 0 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"test": "mocha ./test/*.test.js",
"lint": "eslint --config ./.eslintrc-full.js **/*.js --fix",
"postcss": "postcss ./styles/*.test.{css,scss} --config ./postcss.config.js -r",
"postcss": "postcss ./test/fixtures/*.test.{css,scss} --config ./test/fixtures/postcss.config.js -r",
"pack": "npm pack",
"release": "npm publish"
},
Expand Down Expand Up @@ -50,7 +50,6 @@
"eslint-plugin-unicorn": "^12.1.0",
"mocha": "6.2.2",
"postcss-cli": "6.1.3",
"postcss-color-rebeccapurple": "4.0.1",
"postcss-scss": "2.0.0"
},
"eslintConfig": {
Expand Down
84 changes: 84 additions & 0 deletions test/fixtures/common.test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@mixin reset-list {
margin: 0;
padding: 0;
color: #567890;

list-style: none;
}

$lightMatteTurq: #2f4050;
$brightRed: #ed5564c4;
$almostBlack: rgb(62, 74, 86);
$dodgerBlue: rgba(51, 121, 183, 0.589);
$red: hsl(3, 48%, 55%);
$green: hsla(168, 75%, 37%, 0.747);

.a {
--red: red;
$darkred: rgba(102, 0, 0, 0.6);
border: 1px solid #fff457;
border-color: #fff45780;
border-right-color: rgb(255, 244, 87);
border-left-color: rgba(255, 244, 87, 0.5);
border-color: hsl(56, 100%, 67%);
border-top-color: hsla(56, 100%, 67%, 0.5);
border-bottom-color: yellow;
color: var(--red);
outline-color: $darkred;

@media (min-width: 300px) {
color: rgb(17, 34, 204);
background-color: hsl(180, 100%, 50%);
}
}

.b {
background: linear-gradient(
to bottom,
#cd56ab 10%,
#cd56ab80 20%,
rgb(68, 187, 221) 30%,
rgba(68, 188, 221, 0.5) 40%,
hsl(56, 69%, 57%) 50%,
hsla(56, 69%, 57%, 0.5) 60%,
green 100%,
);
}

.h {
color: red;
fill: blue;
}

.i {
outline: 1px solid #663399;
outline-color: rgb(244, 164, 96);
}

.k {
background-image: linear-gradient(#1122cc 0%, hsl(240, 100%, 67%) 100%);
background-color: hsla(74, 60%, 16%, 0.4);
box-shadow: 0 0 0 0 greenyellow, 0 0 0 0 springgreen;
}

.n {
font-size: 14px;
}

.x {
@include reset-indents;
margin-bottom: 30px;

color: rgb(108, 154, 240);
font-size: 20px;
line-height: 30px;
font-weight: 700;
}

.z {
display: block;
width: 300px;
height: 300px;

animation-iteration-count: infinite;
}
12 changes: 12 additions & 0 deletions test/fixtures/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const plugin = require('../../index');

module.exports = {
syntax: 'postcss-scss',
plugins: [
plugin({
outputColorFormat: 'rgb',
alwaysAlpha: false,
ignore: [],
}),
],
};

0 comments on commit 892c78e

Please sign in to comment.