Skip to content

[css-mixins-1] Consider a way for mixins to be applied with the style attribute #13077

@sorvell

Description

@sorvell

It would be useful if some form of mixins could be applied via the style attribute. This would enable use cases similar to the atomic or semi-atomic styling popularized by libraries like Tailwind.

The current design of mixins seems like it probably precludes this given that (1) they are applied with an at-rule @apply and (2) they can specify a full ruleset, including nested rules.

Perhaps there is a way to define a subset of mixins or a superset of functions that could be used for this use case. Consider something like:

<article style="apply(--flex(col, center), --gap(6), --padding(7), --rounded(2xl))">
  <section>One</section>
  <section>Two</section>
  <section>Three</section>
</article>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions