D
D
Deniskin Rediskin2016-02-10 20:40:59
css
Deniskin Rediskin, 2016-02-10 20:40:59

Which CSS preprocessors support map at an arbitrary location in CSS?

Which CSS preprocessors allow you to use loops (preferably maps in general) in arbitrary places in CSS, for example, in native CSS functions?
Let's say this:

background: linear-gradient(90deg, @map (hsl(60 * x % 360, 100%, 50%) 100% / 6 * x) 0 .. 6);

unfolded into the following:
background: linear-gradient(90deg,
    hsl(0, 100%, 50%) 0%,
    hsl(60, 100%, 50%) 16.6666666666667%,
    hsl(120, 100%, 50%) 33.3333333333333%,
    hsl(180, 100%, 50%) 50%,
    hsl(240, 100%, 50%) 66.6666666666667%,
    hsl(300, 100%, 50%) 83.3333333333333%,
    hsl(0, 100%, 50%) 100%
  )
/* сгенерировано:
print qq(
  background: linear-gradient(90deg,
    @{[(join ",\n    ", map {qq(hsl(@{[60 * $_ % 360]}, 100%, 50%) @{[100 / 6 * $_]}%)} 0 .. 6)]}
  )
)
*/

Does PostCSS allow this possibility?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question