april-ui-rust 0.1.0

April UI components for Laravel Rust and MiniJinja
Documentation
@source "./js/**/*.js";
@source "./js/**/*.ts";
@source "./js/**/*.tsx";
@source "./views/**/*.html";

@custom-variant dark (&:where(.dark, .dark *));

@theme {
    --breakpoint-2xl: 1400px;

    /* Use Tailwind's default theme engine mapping format */
    --color-border: hsl(var(--border));
    --color-input: hsl(var(--input));
    --color-ring: hsl(var(--ring));

    --color-background: hsl(var(--background));
    --color-foreground: hsl(var(--foreground));
    --color-card: hsl(var(--card));
    --color-card-foreground: hsl(var(--card-foreground));
    --color-popover: hsl(var(--popover));
    --color-popover-foreground: hsl(var(--popover-foreground));
    --color-primary: hsl(var(--primary));
    --color-primary-foreground: hsl(var(--primary-foreground));
    --color-secondary: hsl(var(--secondary));
    --color-secondary-foreground: hsl(var(--secondary-foreground));
    --color-muted: hsl(var(--muted));
    --color-muted-foreground: hsl(var(--muted-foreground));
    --color-accent: hsl(var(--accent));
    --color-accent-foreground: hsl(var(--accent-foreground));
    --color-destructive: hsl(var(--destructive));
    --color-destructive-foreground: hsl(var(--destructive-foreground));

    --color-sidebar: hsl(var(--sidebar-background));
    --color-sidebar-foreground: hsl(var(--sidebar-foreground));
    --color-sidebar-primary: hsl(var(--sidebar-primary));
    --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
    --color-sidebar-accent: hsl(var(--sidebar-accent));
    --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
    --color-sidebar-border: hsl(var(--sidebar-border));
    --color-sidebar-ring: hsl(var(--sidebar-ring));

    --radius-xl: calc(var(--radius) + 4px);
    --radius-lg: var(--radius);
    --radius-md: calc(var(--radius) - 2px);
    --radius-sm: calc(var(--radius) - 4px);

    @keyframes caret-blink {

        0%,
        70%,
        100% {
            opacity: 1;
        }

        20%,
        50% {
            opacity: 0;
        }
    }

    --animate-caret-blink: caret-blink 1.25s ease-out infinite;
    --animate-accordion-down: accordion-down 0.2s ease-out;
    --animate-accordion-up: accordion-up 0.2s ease-out;
}

@utility step {
    counter-increment: step;

    &:before {
        @apply absolute w-9 h-9 bg-muted rounded-full font-mono font-medium text-center text-base inline-flex items-center justify-center -indent-px border-4 border-background;
        @apply ml-[-50px] mt-[-4px];
        content: counter(step);
    }
}

@utility checkbox-clip-path {
    &::before {
        clip-path: polygon(25% 50%, 35% 60%, 75% 25%, 80% 30%, 35% 70%, 20% 55%);
    }
}

@utility radio-clip-path {
    &::before {
        clip-path: circle(35%);
    }
}

/* April UI's default palette: moss surfaces, a warm clay accent, and forest
   dark mode. Applications can override these semantic tokens after importing
   April UI's stylesheet. */
:root {
    --background: 105 20% 93%;
    --foreground: 145 18% 13%;
    --card: 95 14% 97%;
    --card-foreground: 145 18% 13%;
    --popover: 95 14% 98%;
    --popover-foreground: 145 18% 13%;
    --primary: 28 38% 74%;
    --primary-foreground: 28 38% 16%;
    --secondary: 100 15% 87%;
    --secondary-foreground: 145 18% 13%;
    --muted: 100 15% 87%;
    --muted-foreground: 145 8% 36%;
    --accent: 30 20% 86%;
    --accent-foreground: 145 18% 13%;
    --destructive: 0 72.22% 50.59%;
    --destructive-foreground: 0 0% 98%;
    --border: 100 10% 79%;
    --input: 100 10% 79%;
    --ring: 28 38% 74%;
    --radius: 0.5rem;
    --sidebar-background: 100 16% 89%;
    --sidebar-foreground: 145 18% 13%;
    --sidebar-primary: 28 38% 74%;
    --sidebar-primary-foreground: 35 25% 12%;
    --sidebar-accent: 100 15% 84%;
    --sidebar-accent-foreground: 145 18% 13%;
    --sidebar-border: 100 10% 79%;
    --sidebar-ring: 28 38% 74%;
    --chart-1: hsl(28 50% 22%);
    --chart-2: hsl(145 20% 23%);
    --chart-3: hsl(84 18% 38%);
    --chart-4: hsl(102 14% 50%);
    --chart-5: hsl(38 32% 55%);

    /* Sidebar sizing */
    --sidebar-width: 16rem;
    --sidebar-width-icon: 3rem;
    --sidebar-width-mobile: 18rem;
}

.dark {
    --background: 145 20% 6%;
    --foreground: 45 28% 92%;
    --card: 145 15% 9%;
    --card-foreground: 45 28% 92%;
    --popover: 145 15% 9%;
    --popover-foreground: 45 28% 92%;
    --primary: 28 50% 22%;
    --primary-foreground: 28 50% 64%;
    --secondary: 145 12% 14%;
    --secondary-foreground: 45 28% 92%;
    --muted: 145 12% 14%;
    --muted-foreground: 90 9% 64%;
    --accent: 30 20% 15%;
    --accent-foreground: 45 28% 92%;
    /* Keep destructive text readable on dark surfaces. */
    --destructive: 0 72% 58%;
    --destructive-foreground: 0 0% 5%;
    --border: 145 10% 17%;
    --input: 145 10% 17%;
    --ring: 28 50% 22%;
    --sidebar-background: 145 22% 4%;
    --sidebar-foreground: 45 28% 92%;
    --sidebar-primary: 28 50% 22%;
    --sidebar-primary-foreground: 45 28% 92%;
    --sidebar-accent: 145 12% 14%;
    --sidebar-accent-foreground: 45 28% 92%;
    --sidebar-border: 145 10% 15%;
    --sidebar-ring: 28 50% 22%;
    --chart-1: hsl(28 50% 22%);
    --chart-2: hsl(145 22% 43%);
    --chart-3: hsl(84 22% 52%);
    --chart-4: hsl(102 18% 61%);
    --chart-5: hsl(38 38% 65%);
}

* {
    border-color: hsl(var(--border));
}

[x-cloak] {
    display: none !important;
}

[data-slot="editor-content"] .tiptap {
    min-height: 7rem;
    outline: none;
}

[data-slot="editor-content"] .tiptap p.is-editor-empty:first-child::before {
    float: left;
    height: 0;
    color: hsl(var(--muted-foreground));
    content: attr(data-placeholder);
    pointer-events: none;
}

[data-slot="editor-content"] .tiptap > * + * {
    margin-top: 0.75rem;
}

[data-slot="editor-content"] .tiptap h1,
[data-slot="editor-content"] .tiptap h2,
[data-slot="editor-content"] .tiptap h3 {
    font-weight: 600;
    line-height: 1.25;
}

[data-slot="editor-content"] .tiptap h1 {
    font-size: 1.5rem;
}

[data-slot="editor-content"] .tiptap h2 {
    font-size: 1.25rem;
}

[data-slot="editor-content"] .tiptap h3 {
    font-size: 1.125rem;
}

[data-slot="editor-content"] .tiptap ul,
[data-slot="editor-content"] .tiptap ol {
    padding-left: 1.5rem;
}

[data-slot="editor-content"] .tiptap ul {
    list-style: disc;
}

[data-slot="editor-content"] .tiptap ol {
    list-style: decimal;
}

[data-slot="editor-content"] .tiptap blockquote {
    border-left: 3px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    padding-left: 1rem;
}

[data-slot="editor-content"] .tiptap pre {
    overflow-x: auto;
    border-radius: 0.375rem;
    background: hsl(var(--muted));
    padding: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
}

[data-slot="editor-content"] .tiptap code {
    border-radius: 0.25rem;
    background: hsl(var(--muted));
    padding: 0.125rem 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
}

[data-slot="editor-content"] .tiptap pre code {
    background: transparent;
    padding: 0;
}

[data-slot="editor-content"] .tiptap a {
    color: hsl(var(--primary));
    text-decoration: underline;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
}

@media (max-width: 640px) {
    .container {
        @apply px-4;
    }
}