Skip to content

chore: update deps and docs #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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