Skip to content

Commit e6b2e5b

Browse files
authored
Upgrade RubyUI & Tailwind (#178)
1 parent bf7d38c commit e6b2e5b

File tree

52 files changed

+529
-1153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+529
-1153
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GIT
1414

1515
GIT
1616
remote: https://github.com/ruby-ui/ruby_ui.git
17-
revision: 67b869524eff90d2ba7b5315c45507dbad68cf88
17+
revision: 957bcffb1e393b7db30c7576734f4ad5b40bb7cf
1818
branch: main
1919
specs:
2020
ruby_ui (1.0.0.beta1)
Lines changed: 139 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,152 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
42

5-
@layer base {
6-
:root {
7-
--background: 0 0% 100%;
8-
--foreground: 240 10% 3.9%;
9-
--card: 0 0% 100%;
10-
--card-foreground: 240 10% 3.9%;
11-
--popover: 0 0% 100%;
12-
--popover-foreground: 240 10% 3.9%;
13-
--primary: 240 5.9% 10%;
14-
--primary-foreground: 0 0% 98%;
15-
--secondary: 240 4.8% 95.9%;
16-
--secondary-foreground: 240 5.9% 10%;
17-
--muted: 240 4.8% 95.9%;
18-
--muted-foreground: 240 3.8% 46.1%;
19-
--accent: 240 4.8% 95.9%;
20-
--accent-foreground: 240 5.9% 10%;
21-
--destructive: 0 84.2% 60.2%;
22-
--destructive-foreground: 0 0% 98%;
23-
--border: 240 5.9% 90%;
24-
--input: 240 5.9% 90%;
25-
--ring: 240 5.9% 10%;
26-
--radius: 0.5rem;
3+
@plugin "@tailwindcss/forms";
4+
@plugin "@tailwindcss/typography";
275

28-
/* ruby_ui especific */
29-
--warning: 38 92% 50%;
30-
--warning-foreground: 0 0% 100%;
31-
--success: 87 100% 37%;
32-
--success-foreground: 0 0% 100%;
33-
}
346

35-
.dark {
36-
--background: 240 10% 3.9%;
37-
--foreground: 0 0% 98%;
38-
--card: 240 10% 3.9%;
39-
--card-foreground: 0 0% 98%;
40-
--popover: 240 10% 3.9%;
41-
--popover-foreground: 0 0% 98%;
42-
--primary: 0 0% 98%;
43-
--primary-foreground: 240 5.9% 10%;
44-
--secondary: 240 3.7% 15.9%;
45-
--secondary-foreground: 0 0% 98%;
46-
--muted: 240 3.7% 15.9%;
47-
--muted-foreground: 240 5% 64.9%;
48-
--accent: 240 3.7% 15.9%;
49-
--accent-foreground: 0 0% 98%;
50-
--destructive: 0 62.8% 30.6%;
51-
--destructive-foreground: 0 0% 98%;
52-
--border: 240 3.7% 15.9%;
53-
--input: 240 3.7% 15.9%;
54-
--ring: 240 4.9% 83.9%;
7+
@import "tw-animate-css";
558

56-
/* ruby_ui especific */
57-
--warning: 38 92% 50%;
58-
--warning-foreground: 0 0% 100%;
59-
--success: 84 81% 44%;
60-
--success-foreground: 0 0% 100%;
61-
}
9+
10+
@custom-variant dark (&:is(.dark *));
11+
12+
:root {
13+
--background: oklch(1 0 0);
14+
--foreground: oklch(0.145 0 0);
15+
--card: oklch(1 0 0);
16+
--card-foreground: oklch(0.145 0 0);
17+
--popover: oklch(1 0 0);
18+
--popover-foreground: oklch(0.145 0 0);
19+
--primary: oklch(0.205 0 0);
20+
--primary-foreground: oklch(0.985 0 0);
21+
--secondary: oklch(0.97 0 0);
22+
--secondary-foreground: oklch(0.205 0 0);
23+
--muted: oklch(0.97 0 0);
24+
--muted-foreground: oklch(0.556 0 0);
25+
--accent: oklch(0.97 0 0);
26+
--accent-foreground: oklch(0.205 0 0);
27+
--destructive: oklch(0.577 0.245 27.325);
28+
--destructive-foreground: oklch(0.577 0.245 27.325);
29+
--border: oklch(0.922 0 0);
30+
--input: oklch(0.922 0 0);
31+
--ring: oklch(0.708 0 0);
32+
--chart-1: oklch(0.646 0.222 41.116);
33+
--chart-2: oklch(0.6 0.118 184.704);
34+
--chart-3: oklch(0.398 0.07 227.392);
35+
--chart-4: oklch(0.828 0.189 84.429);
36+
--chart-5: oklch(0.769 0.188 70.08);
37+
--radius: 0.625rem;
38+
--sidebar: oklch(0.985 0 0);
39+
--sidebar-foreground: oklch(0.145 0 0);
40+
--sidebar-primary: oklch(0.205 0 0);
41+
--sidebar-primary-foreground: oklch(0.985 0 0);
42+
--sidebar-accent: oklch(0.97 0 0);
43+
--sidebar-accent-foreground: oklch(0.205 0 0);
44+
--sidebar-border: oklch(0.922 0 0);
45+
--sidebar-ring: oklch(0.708 0 0);
46+
47+
/* ruby_ui specific */
48+
--warning: hsl(38 92% 50%);
49+
--warning-foreground: hsl(0 0% 100%);
50+
--success: hsl(87 100% 37%);
51+
--success-foreground: hsl(0 0% 100%);
52+
53+
/* Container settings */
54+
--container-center: true;
55+
--container-padding: hsl(2rem);
56+
--container-max-width-2xl: hsl(1400px);
57+
}
58+
59+
.dark {
60+
--background: oklch(0.145 0 0);
61+
--foreground: oklch(0.985 0 0);
62+
--card: oklch(0.145 0 0);
63+
--card-foreground: oklch(0.985 0 0);
64+
--popover: oklch(0.145 0 0);
65+
--popover-foreground: oklch(0.985 0 0);
66+
--primary: oklch(0.985 0 0);
67+
--primary-foreground: oklch(0.205 0 0);
68+
--secondary: oklch(0.269 0 0);
69+
--secondary-foreground: oklch(0.985 0 0);
70+
--muted: oklch(0.269 0 0);
71+
--muted-foreground: oklch(0.708 0 0);
72+
--accent: oklch(0.269 0 0);
73+
--accent-foreground: oklch(0.985 0 0);
74+
--destructive: oklch(0.396 0.141 25.723);
75+
--destructive-foreground: oklch(0.637 0.237 25.331);
76+
--border: oklch(0.269 0 0);
77+
--input: oklch(0.269 0 0);
78+
--ring: oklch(0.439 0 0);
79+
--chart-1: oklch(0.488 0.243 264.376);
80+
--chart-2: oklch(0.696 0.17 162.48);
81+
--chart-3: oklch(0.769 0.188 70.08);
82+
--chart-4: oklch(0.627 0.265 303.9);
83+
--chart-5: oklch(0.645 0.246 16.439);
84+
--sidebar: oklch(0.205 0 0);
85+
--sidebar-foreground: oklch(0.985 0 0);
86+
--sidebar-primary: oklch(0.488 0.243 264.376);
87+
--sidebar-primary-foreground: oklch(0.985 0 0);
88+
--sidebar-accent: oklch(0.269 0 0);
89+
--sidebar-accent-foreground: oklch(0.985 0 0);
90+
--sidebar-border: oklch(0.269 0 0);
91+
--sidebar-ring: oklch(0.439 0 0);
92+
93+
/* ruby_ui specific */
94+
--warning: hsl(38 92% 50%);
95+
--warning-foreground: hsl(0 0% 100%);
96+
--success: hsl(84 81% 44%);
97+
--success-foreground: hsl(0 0% 100%);
98+
}
99+
100+
@theme inline {
101+
--color-background: var(--background);
102+
--color-foreground: var(--foreground);
103+
--color-card: var(--card);
104+
--color-card-foreground: var(--card-foreground);
105+
--color-popover: var(--popover);
106+
--color-popover-foreground: var(--popover-foreground);
107+
--color-primary: var(--primary);
108+
--color-primary-foreground: var(--primary-foreground);
109+
--color-secondary: var(--secondary);
110+
--color-secondary-foreground: var(--secondary-foreground);
111+
--color-muted: var(--muted);
112+
--color-muted-foreground: var(--muted-foreground);
113+
--color-accent: var(--accent);
114+
--color-accent-foreground: var(--accent-foreground);
115+
--color-destructive: var(--destructive);
116+
--color-destructive-foreground: var(--destructive-foreground);
117+
--color-border: var(--border);
118+
--color-input: var(--input);
119+
--color-ring: var(--ring);
120+
--color-chart-1: var(--chart-1);
121+
--color-chart-2: var(--chart-2);
122+
--color-chart-3: var(--chart-3);
123+
--color-chart-4: var(--chart-4);
124+
--color-chart-5: var(--chart-5);
125+
--radius-sm: calc(var(--radius) - 4px);
126+
--radius-md: calc(var(--radius) - 2px);
127+
--radius-lg: var(--radius);
128+
--radius-xl: calc(var(--radius) + 4px);
129+
--color-sidebar: var(--sidebar);
130+
--color-sidebar-foreground: var(--sidebar-foreground);
131+
--color-sidebar-primary: var(--sidebar-primary);
132+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
133+
--color-sidebar-accent: var(--sidebar-accent);
134+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
135+
--color-sidebar-border: var(--sidebar-border);
136+
--color-sidebar-ring: var(--sidebar-ring);
137+
138+
/* ruby_ui specific */
139+
--color-warning: var(--warning);
140+
--color-warning-foreground: var(--warning-foreground);
141+
--color-success: var(--success);
142+
--color-success-foreground: var(--success-foreground);
62143
}
63144

64145
@layer base {
65146
* {
66-
@apply border-border;
147+
@apply border-border outline-ring/50;
67148
}
68-
69149
body {
70150
@apply bg-background text-foreground;
71-
font-feature-settings: "rlig" 1, "calt" 1;
72-
73-
/* docs specific */
74-
/* https://css-tricks.com/snippets/css/system-font-stack/ */
75-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
76151
}
77152
}

app/components/ruby_ui/alert_dialog/alert_dialog_content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def container(&)
2626
div(
2727
role: "alertdialog",
2828
data_state: "open",
29-
class: "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
29+
class: "flex flex-col fixed left-[50%] top-[50%] z-50 w-full max-w-lg max-h-screen overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
3030
style: "pointer-events:auto",
3131
&
3232
)

0 commit comments

Comments
 (0)