space separated values interpreted as list...
See original GitHub issueI’m trying to write a function that takes a comma separated list of box-shadows and converts them to filter: drop-shadow
.
I’m having a problem, if I pass a single shadow to my function, Stylus interprets it as an array instead of a string, and then it get parsed by the for
loop.
drop-shadow($array...)
$dropShadows = ()
for $shadow in $array
push($dropShadows, 'drop-shadow(' + $shadow + ')');
filter: unquote(join(' ', $dropShadows))
drop-shadow: 0 0
$array is of type unit
, but the result is:
filter: drop-shadow(0) drop-shadow(0)
Why?
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
How to Convert Space-Separated String to List in Python
To convert a space-separated string to list in Python, split the string by empty space, convert a number string to int, add the...
Read more >Change a string of integers separated by spaces to a list of int
The most simple solution is to use .split() to create a list of strings: x = x.split(). Alternatively, you can use a list...
Read more >Convert space delimited string to a list in Python - thisPointer
Convert space delimited string to a list using split() with the strip(). The strip() method is used to remove the delimiter spaces from...
Read more >How can I add values into a list separated by a space in Python?
First off, take the input as a raw_input() in a list nums and apply spilt() function on it: ; This line stores the...
Read more >Need to take space separated inputs from users and put them ...
So, I want to be able to take inputs from users where users will input space separated strings or values and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually
0 0
is a list from the Stylus perspective. If I understand your problem correctly, you can uselist-separator
bif to check if the given list is separated by comma:Opened a dedicated bug for it https://github.com/stylus/stylus/issues/2196