Skip to content

Commit

Permalink
chore: update deps and docs (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored May 7, 2019
1 parent 0b21653 commit af591a8
Show file tree
Hide file tree
Showing 5 changed files with 1,206 additions and 585 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_js:
- "6"
- "8"
- "10"
- "11"
- "12"
script: npm run travis

after_success:
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ Pass arbitrary values between your module files
```css
/* my-component.css */
/* alias paths for other values or composition */
@value colors: "./colors.css";
@value colors: "./colors.css";
/* import multiple from a single file */
@value primary, secondary from colors;
/* make local aliases to imported values */
@value small as bp-small, large as bp-large from "./breakpoints.css";
/* value as selector name */
@value selectorValue: secondary-color;

.selectorValue {
color: secondary;
}

.header {
composes: text-primary from colors;
Expand Down Expand Up @@ -74,4 +80,5 @@ ISC
- Josh Johnston

---

Glen Maddern, 2015.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"codecov.io": "^0.1.2",
"coveralls": "^3.0.2",
"eslint": "^5.9.0",
"mocha": "^5.2.0",
"nyc": "^13.1.0"
"mocha": "^6.1.4",
"nyc": "^14.1.0"
},
"dependencies": {
"icss-utils": "^4.0.0",
Expand Down
16 changes: 15 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,21 @@ describe('constants', () => {
);
});

it('should import and re-export a simple constant', () => {
it('should replace selectors within the file #1', () => {
test(
'@value colorValue red; #colorValue { color: colorValue; }',
':export {\n colorValue: red;\n}\n#red { color: red; }'
);
});

it('should replace selectors within the file #2', () => {
test(
'@value colorValue red; .colorValue > .colorValue { color: colorValue; }',
':export {\n colorValue: red;\n}\n.red > .red { color: red; }'
);
});

it.only('should import and re-export a simple constant', () => {
test(
'@value red from "./colors.css";',
':import("./colors.css") {\n i__const_red_0: red\n}\n:export {\n red: i__const_red_0\n}'
Expand Down
Loading

0 comments on commit af591a8

Please sign in to comment.