Skip to content

New has-attribute conditional #353

@bob2517

Description

@bob2517

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.

Metadata

Metadata

Assignees

Labels

docs to doDocumentation still needs doing before this can get releasedenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions