Skip to content

Commit

Permalink
0.0.297 - fix: css based on https://ui.shadcn.com/docs/tailwind-v4
Browse files Browse the repository at this point in the history
  • Loading branch information
nahoc committed Feb 27, 2025
1 parent 58e0368 commit 02985b0
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 90 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@risc0/ui",
"version": "0.0.296",
"version": "0.0.297",
"private": false,
"sideEffects": false,
"type": "module",
Expand Down
192 changes: 103 additions & 89 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@

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

@theme {
@theme inline {
--breakpoint-3xl: 1600px;

--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-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-background: var(--background);
--color-foreground: var(--foreground);

--color-primary: hsl(var(--primary));
--color-primary-foreground: hsl(var(--primary-foreground));
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);

--color-secondary: hsl(var(--secondary));
--color-secondary-foreground: hsl(var(--secondary-foreground));
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);

--color-destructive: hsl(var(--destructive));
--color-destructive-foreground: hsl(var(--destructive-foreground));
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);

--color-muted: hsl(var(--muted));
--color-muted-foreground: hsl(var(--muted-foreground));
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);

--color-accent: hsl(var(--accent));
--color-accent-foreground: hsl(var(--accent-foreground));
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);

--color-popover: hsl(var(--popover));
--color-popover-foreground: hsl(var(--popover-foreground));
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);

--color-card: hsl(var(--card));
--color-card-foreground: hsl(var(--card-foreground));
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);

--radius-lg: var(--radius);
--radius-md: calc(var(--radius) - 2px);
Expand All @@ -44,10 +44,8 @@
--animate-fade-in-up: fade-in-up 1s ease-in-out;
--animate-fade-in: fade-in 1s ease-in-out;
--animate-head-shake: head-shake 1s ease-in-out;
--animate-indeterminate1: indeterminate1 2.1s
cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
--animate-indeterminate2: indeterminate2 2.1s
cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
--animate-indeterminate1: indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
--animate-indeterminate2: indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
--animate-tilt: tilt 10s linear infinite;

--font-sans: var(--font-europa-sans), system-ui;
Expand All @@ -57,15 +55,17 @@
from {
height: 0;
}

to {
height: var(--radix-accordion-content-height);
}
}

@keyframes accordion-up {
from {
height: var(--radix-accordion-content-height);
}

to {
height: 0;
}
Expand All @@ -76,6 +76,7 @@
opacity: 0;
transform: translateY(6px);
}

to {
opacity: 1;
transform: translateY(0);
Expand All @@ -87,6 +88,7 @@
opacity: 0;
transform: translateY(-6px);
}

to {
opacity: 1;
transform: translateY(0);
Expand All @@ -98,6 +100,7 @@
opacity: 0;
transform: translateX(6px);
}

to {
opacity: 1;
transform: translateX(0);
Expand All @@ -109,6 +112,7 @@
opacity: 0;
transform: translateX(-6px);
}

to {
opacity: 1;
transform: translateX(0);
Expand All @@ -119,20 +123,24 @@
from {
opacity: 0;
}

to {
opacity: 1;
}
}

@keyframes tilt {

0%,
50%,
to {
transform: rotate(0deg);
}

25% {
transform: rotate(0.5deg);
}

75% {
transform: rotate(-0.5deg);
}
Expand All @@ -142,18 +150,23 @@
0% {
transform: translateX(0);
}

6.5% {
transform: translateX(-6px) rotateY(-9deg);
}

18.5% {
transform: translateX(5px) rotateY(7deg);
}

31.5% {
transform: translateX(-3px) rotateY(-5deg);
}

43.5% {
transform: translateX(2px) rotateY(3deg);
}

50% {
transform: translateX(0);
}
Expand All @@ -164,10 +177,12 @@
left: -35%;
right: 100%;
}

60% {
left: 100%;
right: -90%;
}

100% {
left: 100%;
right: -90%;
Expand All @@ -179,10 +194,12 @@
left: -200%;
right: 100%;
}

60% {
left: 100%;
right: -8%;
}

100% {
left: 100%;
right: -8%;
Expand Down Expand Up @@ -212,6 +229,7 @@
color utility to any element that depends on these defaults.
*/
@layer base {

*,
::after,
::before,
Expand Down Expand Up @@ -246,74 +264,70 @@
@apply text-muted-foreground dark:text-primary hover:underline underline-offset-2;
}

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 20 14.3% 4.1%;
--card: 0 0% 100%;
--card-foreground: 20 14.3% 4.1%;
--popover: 0 0% 100%;
--popover-foreground: 20 14.3% 4.1%;
--primary: 24 9.8% 10%;
--primary-foreground: 60 9.1% 97.8%;
--secondary: 60 4.8% 95.9%;
--secondary-foreground: 24 9.8% 10%;
--muted: 60 4.8% 95.9%;
--muted-foreground: 25 5.3% 44.7%;
--accent: 60 4.8% 95.9%;
--accent-foreground: 24 9.8% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 20 5.9% 90%;
--input: 20 5.9% 90%;
--ring: 20 14.3% 4.1%;
--radius: 0.75rem;

--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
}
:root {
--background: hsl(0 0% 100%);
--foreground: hsl(20 14.3% 4.1%);
--card: hsl(0 0% 100%);
--card-foreground: hsl(20 14.3% 4.1%);
--popover: hsl(0 0% 100%);
--popover-foreground: hsl(20 14.3% 4.1%);
--primary: hsl(24 9.8% 10%);
--primary-foreground: hsl(60 9.1% 97.8%);
--secondary: hsl(60 4.8% 95.9%);
--secondary-foreground: hsl(24 9.8% 10%);
--muted: hsl(60 4.8% 95.9%);
--muted-foreground: hsl(25 5.3% 44.7%);
--accent: hsl(60 4.8% 95.9%);
--accent-foreground: hsl(24 9.8% 10%);
--destructive: hsl(0 84.2% 60.2%);
--destructive-foreground: hsl(60 9.1% 97.8%);
--border: hsl(20 5.9% 90%);
--input: hsl(20 5.9% 90%);
--ring: hsl(20 14.3% 4.1%);
--radius: 0.75rem;

--chart-1: hsl(12 76% 61%);
--chart-2: hsl(173 58% 39%);
--chart-3: hsl(197 37% 24%);
--chart-4: hsl(43 74% 66%);
--chart-5: hsl(27 87% 67%);
}

.dark {
--background: 20 14.3% 4.1%;
--foreground: 60 9.1% 97.8%;
--card: 20 14.3% 4.1%;
--card-foreground: 60 9.1% 97.8%;
--popover: 20 14.3% 4.1%;
--popover-foreground: 60 9.1% 97.8%;
--primary: 61 100% 80.8%;
--primary-foreground: 0 0% 0%;
--secondary: 12 6.5% 15.1%;
--secondary-foreground: 60 9.1% 97.8%;
--muted: 12 6.5% 15.1%;
--muted-foreground: 24 5.4% 63.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 60 9.1% 97.8%;
--destructive: 0 92.8% 70.6%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 12 6.5% 15.1%;
--input: 12 6.5% 15.1%;
--ring: 61 100% 80.8%;

--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}
.dark {
--background: hsl(20 14.3% 4.1%);
--foreground: hsl(60 9.1% 97.8%);
--card: hsl(20 14.3% 4.1%);
--card-foreground: hsl(60 9.1% 97.8%);
--popover: hsl(20 14.3% 4.1%);
--popover-foreground: hsl(60 9.1% 97.8%);
--primary: hsl(61 100% 80.8%);
--primary-foreground: hsl(0 0% 0%);
--secondary: hsl(12 6.5% 15.1%);
--secondary-foreground: hsl(60 9.1% 97.8%);
--muted: hsl(12 6.5% 15.1%);
--muted-foreground: hsl(24 5.4% 63.9%);
--accent: hsl(12 6.5% 15.1%);
--accent-foreground: hsl(60 9.1% 97.8%);
--destructive: hsl(0 92.8% 70.6%);
--destructive-foreground: hsl(60 9.1% 97.8%);
--border: hsl(12 6.5% 15.1%);
--input: hsl(12 6.5% 15.1%);
--ring: hsl(61 100% 80.8%);

--chart-1: hsl(220 70% 50%);
--chart-2: hsl(160 60% 45%);
--chart-3: hsl(30 80% 55%);
--chart-4: hsl(280 65% 60%);
--chart-5: hsl(340 75% 55%);
}

@layer base {
* {
@apply border-border;
}
* {
@apply border-border;
}

body {
@apply bg-background text-foreground min-h-dvh antialiased font-sans;
font-display: swap;
}
body {
@apply bg-background text-foreground min-h-dvh antialiased font-sans;
font-display: swap;
}

html {
Expand Down

0 comments on commit 02985b0

Please sign in to comment.