问题
I read http://learnboost.github.io/stylus/docs/hashes.html and none of the examples not working for me. For exapmle
foo = {
bar: {
baz: {
raz: 10px
}
}
}
qux = "raz"
padding
padding foo["bar"].baz[qux]
a compilation error
expected "indent", got "eos"
What did I do wrong?
回答1:
You should use colon when calling hashes' values, as otherwise Stylus couldn't differentiate between selectors and hashes. So,
foo = {
bar: {
baz: {
raz: 10px
}
}
}
qux = "raz"
padding
padding: foo["bar"].baz[qux]
should work ok.
来源:https://stackoverflow.com/questions/28415015/cant-use-hashes-from-stylus