Skip to content

Instantly share code, notes, and snippets.

@rndme
Last active April 8, 2026 03:07
Show Gist options
  • Select an option

  • Save rndme/b2f394bcef2a5bab059e022ac3baa92f to your computer and use it in GitHub Desktop.

Select an option

Save rndme/b2f394bcef2a5bab059e022ac3baa92f to your computer and use it in GitHub Desktop.
behaves like classes, but csv instead of spaces. otherwise pointless?
[data-mixin] { /* lashes attribs to animation names to load mixins in CSV list */
animation: 1ms paused --none;
animation-name: attr(data-mixin type(<custom-ident>#));
}
/* mixins are defined here, can have many rules each */
@keyframes red {from{
color:red;
}}
@keyframes big {from{
font-size: 2rem;
}}
@keyframes round {from{
border-radius: 50rem;
padding-inline: 0.5rem;
}}
@keyframes neg {from{
filter: invert(1);
}}
@keyframes bg-black {from{
background-color:black;
}}
/*@container style(--mixin){ works, but can only apply to children */
/*
example usage: <div data-mixin=big,red,round,bg-black> This is a div. </div>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment