Element needs a lot of class attributes but I don't want them to be chucked in one line, as the line length will be too long and it would require heavy side scrolling.
Preferably, I don't want to use the delimiter syntax [class= ""]
as this syntax would be entirely inconsistent with the whole file.
I tried doing this way:
span.select2.select2-container.select2-container--default \
.select2-container--below.select2-container--focus
But the \
and the remaining class attribute names just gets rendered as text.
Is there any possible way that I can chain class attributes in slim-lang a la ruby style, like this?
span.select2.select2-container.select2-container--default
.additional-cssklass
.whatever-class
You need to use splat attribute that allows you to turn a hash into attribute/value pairs and then append a backslash to do multiline :
.first-class *{class: ["second-class", \
"third-class"]}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With