Proper arrays in Stylus
See original GitHub issueNow we have hashes and it seems obvious that we need a support or proper arrays.
Stylus already have lists, but they’re not the best fit for the job.
There are already a lot of problems with the usage of the lists as arrays, and fixing some of them would break the backwards compatibility, as some of the bugs could be misused as features for a long time.
So, I think it would make sense to create a new data type — Array.
I wonder if I should explain the details of implementation here, as it could would the same arrays work in other languages like js:
foo = [10px, 20px, 40px]
foo[1]
// => 20px
The only conflicts I can see are with attribute selectors and cases when we have an array consisting of the only number, like [10]
: but they all seem to be handable.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:6
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Add value to array in stylus lang css - Stack Overflow
I have 2 arrays. In another expression, in another mediaquery, how do I pull values from one array and insert them into another?...
Read more >Using arrays in experiment code - PsyToolkit
Sometimes, it is good to store a whole sequence of numbers. ... Arrays are also variables, but instead of storing just one number...
Read more >Chapter 8: Introducing One-Dimensional Arrays
One-dimensional arrays (also known as lists) are the fundamental data structure that allows a program to store many elements of data, using a...
Read more >8. Variables, Constants, and Arrays - FORTH, Inc.
In Forth, variables are appropriate for any value that is used inside a definition that may need to change at any time after...
Read more >Check if an array can be Arranged in Left or Right Positioned ...
An efficient solution for this problem needs little bit observation and pen-paper work. To satisfy the Left or Right Positioned Array ...
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
Still waiting on this, such a useful feature
@FranzSkuffka which version of Stylus have you used? You can use
push
function (it should work in 0.52.0):