Compass `
I'm trying to figure out how to turn a string into a list in Compass - this is not supported natively in SASS. For example the string "abc"
would become a list with a length of 3… essentially [a, b, c]
, excepts lists aren't actually arrays.
The _compass_list()
function appears to be exactly what I'm looking for according to the documentation: "Returns a list object from a value that was passed. This can be used to unpack a space separated list that got turned into a string by sass before it was passed to a mixin." However, in practice it simply wraps the string in a list (eg "abc"
becomes ["abc"]
).
Looking at the source, it's obvious that's exactly what's happening. Perhaps it's a bug? https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extensions/functions/lists.rb#L47
Can anyone explain the proper use of this function to me?
This function's code is identical to the next one's. The next one is said to return a single-element list.
Any advanced lists usage in SASS is a big PITA, unfortunately.
Maybe you could write your own Ruby-to-SASS function that parses a string and turns it into a list?
链接地址: http://www.djcxy.com/p/88378.html上一篇: 无法使用罗盘将CSS动画分为部分SASS
下一篇: 指南针`