active-css icon indicating copy to clipboard operation
active-css copied to clipboard

New has-attribute conditional

Open bob2517 opened this issue 1 year ago • 1 comments

A current solution:

#something:click {
    body {
        toggle-attribute: data-something;
    }
    body[data-something] #something {
        render: "Not something";
    }
    body:not([data-something]) #something {
        render: "Something";
    }
}

This could then become, following the same syntax as has-class:

#something:click {
    body {
        toggle-attribute: data-something;
    }
    @if (has-attribute(body data-something)) {
        render: "Not something";
    } @else {
        render: "Something";
    }
}

No rush on this.

bob2517 avatar Jun 23 '24 10:06 bob2517

Very nice!

dragontheory avatar Jun 23 '24 13:06 dragontheory

Now on branch.

bob2517 avatar Feb 09 '25 14:02 bob2517

Excellent!

dragontheory avatar Feb 09 '25 23:02 dragontheory