Ich habe folgende Stylus Codedynamische Eigenschaft Build-Funktion in Stylus gibt eine erwartete ":", bekam "["
spaces = {
none: 0,
xxx-small: .125,
xx-small: 25,
x-small: .5,
small: .75
medium: 1,
large: 1.5,
x-large: 2,
xx-large: 3
}
properties = top, right, bottom, left
types = {
m: margin,
p: padding
}
space()
for type in types
for property in properties
for space in spaces
.{type}-{property}--{space}
{types[type]}-{property}: {spaces[space]}rem
space()
ich es ausgeben etwas entlang der Linien von möchte:
.m-top--none {
margin-top: 0rem;
}
.m-top--xxx-small {
margin-top: 0.125rem;
}
etc
jedoch habe ich mit dem Fehler bin konfrontiert:
Irgendwelche Ideenexpected ":", got "["
, was ich hier falsch gemacht? Wenn ich die {spaces[space]}rem
nehme und nur mit 1000%
als ein Beispiel ersetze, scheint es zu funktionieren?
Ah ja, das hat es getan. Vielen Dank! –