Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev: (21 commits) Fixed History for 0.54.0 History up Evaluate variables in current-media function. Fixes #2128 Undesired spaces with partial reference selector using ranges. Fixes #2133 Slightly clarified an issue with combinators at ranges in partial references, re: #2134 Validate regexp flags for match function Fix bug with evaluating default arguments Undesired spaces with partial reference selector using ranges. Fixes #2133 Fixed bug with selectors() function. Closes #2130 Don't parse empty imports Wrong errors with --include-css and --resolve-url used concurrently. Fixes #2125 misc fixes Docs and History up SelectorParser: Added initial reference selector BIFs: expose "url" function by "embedurl" Updated history Bump version BIFs: Added "index" function Updated docs that where merged incorrectly added a slice function ...
- Loading branch information
Showing
6 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var utils = require('../utils'), | ||
nodes = require('../nodes'); | ||
|
||
/** | ||
* This is a heler function for the slice method | ||
* | ||
* @param {String|Ident} vals | ||
* @param {Unit} start [0] | ||
* @param {Unit} end [vals.length] | ||
* @return {String|Literal|Null} | ||
* @api public | ||
*/ | ||
(module.exports = function slice(val, start, end) { | ||
start = start && start.nodes[0].val; | ||
end = end && end.nodes[0].val; | ||
|
||
val = utils.unwrap(val).nodes; | ||
|
||
if (val.length > 1) { | ||
return utils.coerce(val.slice(start, end), true); | ||
} | ||
|
||
var result = val[0].string.slice(start, end); | ||
|
||
return val[0] instanceof nodes.Ident | ||
? new nodes.Ident(result) | ||
: new nodes.String(result); | ||
}).raw = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.string { | ||
test0: 'ipsum'; | ||
test1: 'orem ipsum'; | ||
test2: 'm'; | ||
test3: 'orem ipsum'; | ||
test4: 'orem ipsu'; | ||
} | ||
.list { | ||
test0: 'ipsum'; | ||
test1: 'ipsum'; | ||
test2: 'ipsum' 'dolor' 'sit' 'amet,' 'consectetur' 'adipisicing' 'elit'; | ||
test3: 'elit'; | ||
test4: 'ipsum' 'dolor' 'sit' 'amet,' 'consectetur' 'adipisicing'; | ||
test5: 'ipsum' 'dolor' 'sit'; | ||
} | ||
.ident { | ||
test0: #f00; | ||
test1: solid #000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// string | ||
str_short = 'lorem ipsum' | ||
str_long = 'lorem ipsum dolor sit amet, consectetur adipisicing elit' | ||
|
||
.string | ||
test0 slice('lorem ipsum', 6) | ||
test1 slice(str_short, 1) | ||
test2 slice(str_short, -1) | ||
test3 slice(str_short, 1, 11) | ||
test4 slice(str_short, 1, -1) | ||
|
||
.list | ||
test0 slice(split(' ', str_short), 1) | ||
test1 slice(split(' ', str_short), -1) | ||
test2 slice(split(' ', str_long), 1) | ||
test3 slice(split(' ', str_long), -1) | ||
test4 slice(split(' ', str_long), 1, -1) | ||
test5 slice(split(' ', str_long), 1, 4) | ||
|
||
.ident | ||
test0 slice(rredd, 1, -1) | ||
test1 slice(1px solid black, 1) |