Remove HAML class syntax
sfcgeorge opened this issue · 2 comments
Looking at the code I also discovered you can use methods to add classes haml style. AKA:
div.green.round { "Hey!" } #=> <div class="green round">Hey!</div>
While excessive metaprogramming in the name of brevity is usually my kind of thing and it's kinda cool, I think this should be removed. It's too unexpected, and the corresponding haml id syntax isn't supported because it would be a Ruby syntax error: div#my_id.my_class {}
is not ok.
I imagine it complicates the implementation too, and doesn't even work properly with the all caps recommended element style: div.foo {}
works, Div.foo {}
works (why is this even a thing), DIV.foo {}
doesn't work.
I agree its just sort of 63.28% haml, leaving you frustrated for more, or wishing you had never tried it out.
Classes don't even work as you'd expect. If there are dashes in the class you have to use _
but then if there are underscores you have to use __
which is weird and seems like the wrong way round and I just bet someone will spend hours wondering why their .foo_bar
class isn't working because they didn't spot it subtly changed to foo-bar
DIV.blue_text {} #=> <div class="blue-text">
DIV.blue__text {} #=> <div class="blue_text">