Skip to content
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
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="0.2.1"></a>
## <small>0.2.1 (2018-02-26)</small>

* 0.2.1 ([c69484b](https://github.com/gitscrum/postcss-map-get/commit/c69484b))
* fix: get value from params ([f0420ef](https://github.com/gitscrum/postcss-map-get/commit/f0420ef))
* test: fix test ([56c7c82](https://github.com/gitscrum/postcss-map-get/commit/56c7c82))
* build: update changelog ([39ae960](https://github.com/gitscrum/postcss-map-get/commit/39ae960))



<a name="0.2.0"></a>
## 0.2.0 (2018-02-26)

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-map-get",
"version": "0.2.0",
"version": "0.2.1",
"description": "PostCSS plugin for sass-like Map Function",
"license": "MIT",
"repository": "gitscrum/postcss-map-get",
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ export default postcss.plugin('postcss-map-get', () => {

nodes.walkAtRules(rules => {
const {params} = rules;

const start = params.indexOf(METHOD);
const end = params.lastIndexOf('))');
rules.params = `${params.substr(0, start)}${valResolve(normalize(params.substring(start, end)))}${params.substr(end + 1)}`;
const end = params.lastIndexOf(')');
rules.params = `${params.substr(0, start)}${valResolve(normalize(params.substring(start, end)))}${params.substr(end)}`;
});
};
});
3 changes: 1 addition & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test('it should return body color and min-width width fro decl', t => {

test('it should retunr width for at rule @media', t => {
const expected = '@media (min-width: 1280px) {body {overflow-x: hidden}}';
const value = '@media (min-width: map-get((xxs: 0,xs: 576px,sm: 768px,md: 992px,lg: 1280px,xl: 1360px,xxl: 1600px) !default, lg))) {body {overflow-x: hidden}}';
const value = '@media (min-width: map-get((xxs: 0,xs: 576px,sm: 768px,md: 992px,lg: 1280px,xl: 1360px,xxl: 1600px) !default, lg)) {body {overflow-x: hidden}}';
t.is(processing(value), expected);
});