@import "tailwindcss"; @plugin "@claas.dev/material-tailwind" { source-color: #0c1aa5; } :root { @apply bg-surface text-on-surface mx-auto overflow-clip overscroll-none; color-scheme: light dark; } [data-color-scheme="light"] { color-scheme: light; } [data-color-scheme="dark"] { color-scheme: dark; } /* Not using TSX components as these are supposed to be simple headless components and class merging requires JS to run when we have perfectly fine CSS solutions to deal with the same problem. */ @layer components { /* @apply in components is afaik not best practice but the only way to get color variables from plugins as Tailwind CSS v4 does not create variables for those and has the same behavior as in v3 */ .text-field { @apply border-outline rounded-extra-small focus-visible:outline-primary text-body-lg border px-4 py-4 leading-6 focus-visible:outline-3; &:user-invalid { @apply outline-error outline-3; } } /* TODO button states */ .button { @apply flex cursor-default items-center justify-center gap-x-2 px-6 py-4; &[data-variant="filled"] { @apply bg-primary text-on-primary justify-center rounded-full; &:disabled { @apply bg-on-surface/10 text-on-surface/38; } } &[data-variant="text"] { @apply text-primary block text-center; } &[data-variant="outlined"] { @apply border-outline-variant text-on-surface-variant rounded-full border; } } .action-button { @apply relative p-3 before:absolute before:top-1/2 before:left-1/2 before:size-[max(100%,44px)] before:-translate-1/2 data-[position=leading]:col-start-1 data-[position=trailing]:col-start-3 pointer-fine:before:hidden; } .floating-action-button { @apply rounded-medium bg-primary text-on-primary focus-within:outline-primary grid size-14 cursor-default content-center justify-items-center outline-offset-4 focus:outline-none; } .icon-button { &[data-variant="standard"] { /* Default size */ @apply fill-on-surface-variant disabled:fill-on-surface/38 hover:not-disabled:bg-on-surface-variant/8 focus-visible:bg-on-surface-variant/10 active:not-disabled:bg-on-surface-variant/10 cursor-default rounded-full p-2; } } }