Element Classes Feature

CSS frameworks are big part of the development process for many, but css classes really clutter up the code when using frameworks.

This gave me the idea of allowing classes to be assigned to elements from a separate code block. I’m not sure this is a feature that needs to be native in Imba, but I really think it would be revolutionary for designing with classes. I wish we didn’t need them, but css frameworks do save tons of time.

Here’s a concept. Let me know what you guys think.

tag app-root
    def render
        <self>
            <h1> "Hello World"
            <p> "Welcome to my app"
    ### classes scoped
    app-root
        | .pt-5
        | .bg-gray-100
    h1 
        | .text-indigo-300 
    p
        | .text-gray-700
    ###

The above would compile to this

<app-root class="pt-5 bg-gray-100">
    <h1 class="text-indigo-300"> Hello World </h1>
    <p class="text-gray-700"> Welcome to my App </p>
</app-root>