Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<style>
#scale-preview {
--theme-0-channels: 246 241 254;
--theme-1-channels: 224 208 251;
--theme-2-channels: 199 171 247;
--theme-3-channels: 174 134 244;
--theme-4-channels: 146 91 240;
--theme-5-channels: 118 49 236;
--theme-6-channels: 96 20 224;
--theme-7-channels: 80 17 187;
--theme-8-channels: 66 14 154;
--theme-9-channels: 52 11 121;
--theme-10-channels: 36 8 84;
--theme-11-channels: 20 4 47;
--theme-12-channels: 6 1 14;
}
#scale-preview {
--complement-0-channels: 254 249 240;
--complement-1-channels: 253 236 206;
--complement-2-channels: 251 220 167;
--complement-3-channels: 250 204 128;
--complement-4-channels: 248 187 84;
--complement-5-channels: 246 169 39;
--complement-6-channels: 235 151 10;
--complement-7-channels: 196 126 8;
--complement-8-channels: 162 104 7;
--complement-9-channels: 127 82 5;
--complement-10-channels: 88 57 4;
--complement-11-channels: 49 32 2;
--complement-12-channels: 15 9 1;
}
</style>
<div class="midwest-layout size-default padding-default type-default" style="--layout-grid-gap: 2rem; --layout-sidebar-width: 350px">
<div class="wrapper">
<div id="scale-preview" class="flex flex-col gap-6">
<div>
<p class="text-xs font-mono font-semibold text-gray-5 uppercase tracking-widest mb-2">Theme</p>
<div class="rounded-xl overflow-hidden flex">
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-0"></div>
<div class="py-1.5 px-2 bg-theme-0 border-t border-theme-0">
<span class="text-xs font-mono font-semibold text-theme-12">0</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-1"></div>
<div class="py-1.5 px-2 bg-theme-1 border-t border-theme-0">
<span class="text-xs font-mono font-semibold text-theme-12">1</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-2"></div>
<div class="py-1.5 px-2 bg-theme-2 border-t border-theme-1">
<span class="text-xs font-mono font-semibold text-theme-12">2</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-3"></div>
<div class="py-1.5 px-2 bg-theme-3 border-t border-theme-2">
<span class="text-xs font-mono font-semibold text-theme-12">3</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-4"></div>
<div class="py-1.5 px-2 bg-theme-4 border-t border-theme-3">
<span class="text-xs font-mono font-semibold text-theme-12">4</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-5"></div>
<div class="py-1.5 px-2 bg-theme-5 border-t border-theme-4">
<span class="text-xs font-mono font-semibold text-theme-12">5</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-6"></div>
<div class="py-1.5 px-2 bg-theme-6 border-t border-theme-5">
<span class="text-xs font-mono font-semibold text-theme-0">6</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-7"></div>
<div class="py-1.5 px-2 bg-theme-7 border-t border-theme-6">
<span class="text-xs font-mono font-semibold text-theme-0">7</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-8"></div>
<div class="py-1.5 px-2 bg-theme-8 border-t border-theme-7">
<span class="text-xs font-mono font-semibold text-theme-0">8</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-9"></div>
<div class="py-1.5 px-2 bg-theme-9 border-t border-theme-8">
<span class="text-xs font-mono font-semibold text-theme-0">9</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-10"></div>
<div class="py-1.5 px-2 bg-theme-10 border-t border-theme-9">
<span class="text-xs font-mono font-semibold text-theme-0">10</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-11"></div>
<div class="py-1.5 px-2 bg-theme-11 border-t border-theme-10">
<span class="text-xs font-mono font-semibold text-theme-0">11</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-12"></div>
<div class="py-1.5 px-2 bg-theme-12 border-t border-theme-11">
<span class="text-xs font-mono font-semibold text-theme-0">12</span>
</div>
</div>
</div>
</div>
<div>
<p class="text-xs font-mono font-semibold text-gray-5 uppercase tracking-widest mb-2">Complement</p>
<div class="rounded-xl overflow-hidden flex">
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-0"></div>
<div class="py-1.5 px-2 bg-complement-0 border-t border-complement-0">
<span class="text-xs font-mono font-semibold text-complement-12">0</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-1"></div>
<div class="py-1.5 px-2 bg-complement-1 border-t border-complement-0">
<span class="text-xs font-mono font-semibold text-complement-12">1</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-2"></div>
<div class="py-1.5 px-2 bg-complement-2 border-t border-complement-1">
<span class="text-xs font-mono font-semibold text-complement-12">2</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-3"></div>
<div class="py-1.5 px-2 bg-complement-3 border-t border-complement-2">
<span class="text-xs font-mono font-semibold text-complement-12">3</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-4"></div>
<div class="py-1.5 px-2 bg-complement-4 border-t border-complement-3">
<span class="text-xs font-mono font-semibold text-complement-12">4</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-5"></div>
<div class="py-1.5 px-2 bg-complement-5 border-t border-complement-4">
<span class="text-xs font-mono font-semibold text-complement-12">5</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-6"></div>
<div class="py-1.5 px-2 bg-complement-6 border-t border-complement-5">
<span class="text-xs font-mono font-semibold text-complement-0">6</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-7"></div>
<div class="py-1.5 px-2 bg-complement-7 border-t border-complement-6">
<span class="text-xs font-mono font-semibold text-complement-0">7</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-8"></div>
<div class="py-1.5 px-2 bg-complement-8 border-t border-complement-7">
<span class="text-xs font-mono font-semibold text-complement-0">8</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-9"></div>
<div class="py-1.5 px-2 bg-complement-9 border-t border-complement-8">
<span class="text-xs font-mono font-semibold text-complement-0">9</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-10"></div>
<div class="py-1.5 px-2 bg-complement-10 border-t border-complement-9">
<span class="text-xs font-mono font-semibold text-complement-0">10</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-11"></div>
<div class="py-1.5 px-2 bg-complement-11 border-t border-complement-10">
<span class="text-xs font-mono font-semibold text-complement-0">11</span>
</div>
</div>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-12"></div>
<div class="py-1.5 px-2 bg-complement-12 border-t border-complement-11">
<span class="text-xs font-mono font-semibold text-complement-0">12</span>
</div>
</div>
</div>
</div>
<div class="flex flex-wrap items-start gap-4">
<a class="midwest-button variant-default size-default theme-primary" name="button" href="/">
<span class="midwest-button-content">Primary</span>
<div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none">
<div class="midwest-loading-icon-inner">
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
<svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true">
<circle cx="15" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
<animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="105" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
</svg>
</div>
</div>
</a>
<a class="midwest-button variant-outline size-default theme-primary" name="button" href="/">
<span class="midwest-button-content">Secondary</span>
<div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none">
<div class="midwest-loading-icon-inner">
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
<svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true">
<circle cx="15" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
<animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="105" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
</svg>
</div>
</div>
</a>
<a class="midwest-button variant-ghost size-default theme-primary" name="button" href="/">
<span class="midwest-button-content">Ghost</span>
<div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none">
<div class="midwest-loading-icon-inner">
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
<svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true">
<circle cx="15" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
<animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="105" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
</svg>
</div>
</div>
</a>
<span theme="theme" class="midwest-badge size-default theme-primary">
<span class="value">Theme badge</span>
</span>
<span theme="complement" class="midwest-badge size-default theme-primary">
<span class="value">Complement badge</span>
</span>
</div>
</div>
</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<% hex = params[:hex].presence || "#7c3aed"
complement_hex = params[:complement_hex].presence || "#f59e0b" %>
<style>
<%= Midwest::ColorScale.to_css(hex, selector: "#scale-preview") %>
<%= Midwest::ColorScale.to_css(complement_hex, selector: "#scale-preview", target: :complement) %>
</style>
<%= midwest_layout do %>
<div id="scale-preview" class="flex flex-col gap-6">
<%# Theme scale strip %>
<div>
<p class="text-xs font-mono font-semibold text-gray-5 uppercase tracking-widest mb-2">Theme</p>
<div class="rounded-xl overflow-hidden flex">
<% 13.times do |i| %>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-theme-<%= i %>"></div>
<div class="py-1.5 px-2 bg-theme-<%= i %> border-t border-theme-<%= [i - 1, 0].max %>">
<span class="text-xs font-mono font-semibold text-theme-<%= i >= 6 ? 0 : 12 %>"><%= i %></span>
</div>
</div>
<% end %>
</div>
</div>
<%# Complement scale strip %>
<div>
<p class="text-xs font-mono font-semibold text-gray-5 uppercase tracking-widest mb-2">Complement</p>
<div class="rounded-xl overflow-hidden flex">
<% 13.times do |i| %>
<div class="flex-1 flex flex-col">
<div class="h-16 bg-complement-<%= i %>"></div>
<div class="py-1.5 px-2 bg-complement-<%= i %> border-t border-complement-<%= [i - 1, 0].max %>">
<span class="text-xs font-mono font-semibold text-complement-<%= i >= 6 ? 0 : 12 %>"><%= i %></span>
</div>
</div>
<% end %>
</div>
</div>
<%# Live UI preview %>
<div class="flex flex-wrap items-start gap-4">
<%= midwest_button("Primary") %>
<%= midwest_button("Secondary", variant: :outline) %>
<%= midwest_button("Ghost", variant: :ghost) %>
<%= midwest_badge("Theme badge", theme: :theme) %>
<%= midwest_badge("Complement badge", theme: :complement) %>
</div>
</div>
<% end %>
Param Description Input

Theme hex color

Complement hex color

No assets to display.
Add a .js or .css file alongside the component to see it here.

Accessibility

Figma embed for Color System/scale_from_hex

Annotate a preview to embed its Figma design here:

@figma "https://figma.com/..."