santycss 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/santy-animations.css +519 -0
- package/dist/santy-components.css +680 -0
- package/dist/santy-core.css +11336 -0
- package/dist/santy.css +12538 -0
- package/dist/santy.min.css +1 -0
- package/index.js +50 -0
- package/lib/animations.js +539 -0
- package/lib/purge-core.js +223 -0
- package/package.json +65 -0
- package/postcss/index.js +79 -0
- package/purge.js +98 -0
- package/santy-jit.js +841 -0
- package/vite-plugin-santycss.js +128 -0
package/santy-jit.js
ADDED
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SantyCSS JIT — Runtime class generation engine
|
|
3
|
+
*
|
|
4
|
+
* Drop this script instead of (or alongside) santy.css.
|
|
5
|
+
* Watches the DOM, generates only the CSS classes actually used.
|
|
6
|
+
* Supports arbitrary values: add-padding-137, set-text-19, add-border-7 ...
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <script src="santy-jit.js"></script>
|
|
10
|
+
*
|
|
11
|
+
* Or as ES module:
|
|
12
|
+
* import './santy-jit.js'
|
|
13
|
+
*
|
|
14
|
+
* Config (optional, before the script):
|
|
15
|
+
* <script>
|
|
16
|
+
* window.SantyJIT = {
|
|
17
|
+
* safelist: ['make-hidden', 'animate-spin'], // always generate
|
|
18
|
+
* nonce: 'abc123', // CSP nonce
|
|
19
|
+
* };
|
|
20
|
+
* </script>
|
|
21
|
+
*/
|
|
22
|
+
(function (root) {
|
|
23
|
+
'use strict';
|
|
24
|
+
|
|
25
|
+
// ─── Color Palette ──────────────────────────────────────────────────────────
|
|
26
|
+
var P = {
|
|
27
|
+
red: {50:'#fef2f2',100:'#fee2e2',200:'#fecaca',300:'#fca5a5',400:'#f87171',500:'#ef4444',600:'#dc2626',700:'#b91c1c',800:'#991b1b',900:'#7f1d1d'},
|
|
28
|
+
orange: {50:'#fff7ed',100:'#ffedd5',200:'#fed7aa',300:'#fdba74',400:'#fb923c',500:'#f97316',600:'#ea580c',700:'#c2410c',800:'#9a3412',900:'#7c2d12'},
|
|
29
|
+
amber: {50:'#fffbeb',100:'#fef3c7',200:'#fde68a',300:'#fcd34d',400:'#fbbf24',500:'#f59e0b',600:'#d97706',700:'#b45309',800:'#92400e',900:'#78350f'},
|
|
30
|
+
yellow: {50:'#fefce8',100:'#fef9c3',200:'#fef08a',300:'#fde047',400:'#facc15',500:'#eab308',600:'#ca8a04',700:'#a16207',800:'#854d0e',900:'#713f12'},
|
|
31
|
+
lime: {50:'#f7fee7',100:'#ecfccb',200:'#d9f99d',300:'#bef264',400:'#a3e635',500:'#84cc16',600:'#65a30d',700:'#4d7c0f',800:'#3f6212',900:'#365314'},
|
|
32
|
+
green: {50:'#f0fdf4',100:'#dcfce7',200:'#bbf7d0',300:'#86efac',400:'#4ade80',500:'#22c55e',600:'#16a34a',700:'#15803d',800:'#166534',900:'#14532d'},
|
|
33
|
+
teal: {50:'#f0fdfa',100:'#ccfbf1',200:'#99f6e4',300:'#5eead4',400:'#2dd4bf',500:'#14b8a6',600:'#0d9488',700:'#0f766e',800:'#115e59',900:'#134e4a'},
|
|
34
|
+
cyan: {50:'#ecfeff',100:'#cffafe',200:'#a5f3fc',300:'#67e8f9',400:'#22d3ee',500:'#06b6d4',600:'#0891b2',700:'#0e7490',800:'#155e75',900:'#164e63'},
|
|
35
|
+
blue: {50:'#eff6ff',100:'#dbeafe',200:'#bfdbfe',300:'#93c5fd',400:'#60a5fa',500:'#3b82f6',600:'#2563eb',700:'#1d4ed8',800:'#1e40af',900:'#1e3a8a'},
|
|
36
|
+
indigo: {50:'#eef2ff',100:'#e0e7ff',200:'#c7d2fe',300:'#a5b4fc',400:'#818cf8',500:'#6366f1',600:'#4f46e5',700:'#4338ca',800:'#3730a3',900:'#312e81'},
|
|
37
|
+
violet: {50:'#f5f3ff',100:'#ede9fe',200:'#ddd6fe',300:'#c4b5fd',400:'#a78bfa',500:'#8b5cf6',600:'#7c3aed',700:'#6d28d9',800:'#5b21b6',900:'#4c1d95'},
|
|
38
|
+
purple: {50:'#faf5ff',100:'#f3e8ff',200:'#e9d5ff',300:'#d8b4fe',400:'#c084fc',500:'#a855f7',600:'#9333ea',700:'#7e22ce',800:'#6b21a8',900:'#581c87'},
|
|
39
|
+
pink: {50:'#fdf2f8',100:'#fce7f3',200:'#fbcfe8',300:'#f9a8d4',400:'#f472b6',500:'#ec4899',600:'#db2777',700:'#be185d',800:'#9d174d',900:'#831843'},
|
|
40
|
+
rose: {50:'#fff1f2',100:'#ffe4e6',200:'#fecdd3',300:'#fda4af',400:'#fb7185',500:'#f43f5e',600:'#e11d48',700:'#be123c',800:'#9f1239',900:'#881337'},
|
|
41
|
+
slate: {50:'#f8fafc',100:'#f1f5f9',200:'#e2e8f0',300:'#cbd5e1',400:'#94a3b8',500:'#64748b',600:'#475569',700:'#334155',800:'#1e293b',900:'#0f172a'},
|
|
42
|
+
gray: {50:'#f9fafb',100:'#f3f4f6',200:'#e5e7eb',300:'#d1d5db',400:'#9ca3af',500:'#6b7280',600:'#4b5563',700:'#374151',800:'#1f2937',900:'#111827'},
|
|
43
|
+
zinc: {50:'#fafafa',100:'#f4f4f5',200:'#e4e4e7',300:'#d4d4d8',400:'#a1a1aa',500:'#71717a',600:'#52525b',700:'#3f3f46',800:'#27272a',900:'#18181b'},
|
|
44
|
+
stone: {50:'#fafaf9',100:'#f5f5f4',200:'#e7e5e4',300:'#d6d3d1',400:'#a8a29e',500:'#78716c',600:'#57534e',700:'#44403c',800:'#292524',900:'#1c1917'},
|
|
45
|
+
};
|
|
46
|
+
var NC = { white:'#fff', black:'#000', transparent:'transparent', current:'currentColor' };
|
|
47
|
+
|
|
48
|
+
function color(name, shade) {
|
|
49
|
+
if (NC[name]) return NC[name];
|
|
50
|
+
return P[name] && P[name][shade] ? P[name][shade] : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ─── Static (named) class lookup ────────────────────────────────────────────
|
|
54
|
+
var STATIC = {
|
|
55
|
+
// Display
|
|
56
|
+
'make-block':'display:block','make-inline':'display:inline','make-inline-block':'display:inline-block',
|
|
57
|
+
'make-flex':'display:flex','make-inline-flex':'display:inline-flex','make-grid':'display:grid',
|
|
58
|
+
'make-inline-grid':'display:inline-grid','make-table':'display:table','make-hidden':'display:none',
|
|
59
|
+
'make-contents':'display:contents',
|
|
60
|
+
// Visibility
|
|
61
|
+
'make-visible':'visibility:visible','make-invisible':'visibility:hidden','make-collapse':'visibility:collapse',
|
|
62
|
+
// Flex direction
|
|
63
|
+
'flex-row':'flex-direction:row','flex-row-reverse':'flex-direction:row-reverse',
|
|
64
|
+
'flex-column':'flex-direction:column','flex-column-reverse':'flex-direction:column-reverse',
|
|
65
|
+
// Flex wrap
|
|
66
|
+
'flex-wrap':'flex-wrap:wrap','flex-wrap-reverse':'flex-wrap:wrap-reverse','flex-nowrap':'flex-wrap:nowrap',
|
|
67
|
+
// Flex grow/shrink
|
|
68
|
+
'flex-grow':'flex-grow:1','flex-grow-none':'flex-grow:0','flex-shrink':'flex-shrink:1',
|
|
69
|
+
'flex-shrink-none':'flex-shrink:0','flex-auto':'flex:1 1 auto','flex-initial':'flex:0 1 auto',
|
|
70
|
+
'flex-none':'flex:none','flex-equal':'flex:1',
|
|
71
|
+
// Align items
|
|
72
|
+
'align-start':'align-items:flex-start','align-end':'align-items:flex-end',
|
|
73
|
+
'align-center':'align-items:center','align-stretch':'align-items:stretch','align-baseline':'align-items:baseline',
|
|
74
|
+
// Align self
|
|
75
|
+
'self-start':'align-self:flex-start','self-end':'align-self:flex-end','self-center':'align-self:center',
|
|
76
|
+
'self-stretch':'align-self:stretch','self-baseline':'align-self:baseline','self-auto':'align-self:auto',
|
|
77
|
+
// Align content
|
|
78
|
+
'content-start':'align-content:flex-start','content-end':'align-content:flex-end',
|
|
79
|
+
'content-center':'align-content:center','content-stretch':'align-content:stretch',
|
|
80
|
+
'content-between':'align-content:space-between','content-around':'align-content:space-around',
|
|
81
|
+
'content-evenly':'align-content:space-evenly',
|
|
82
|
+
// Justify
|
|
83
|
+
'justify-start':'justify-content:flex-start','justify-end':'justify-content:flex-end',
|
|
84
|
+
'justify-center':'justify-content:center','justify-between':'justify-content:space-between',
|
|
85
|
+
'justify-around':'justify-content:space-around','justify-evenly':'justify-content:space-evenly',
|
|
86
|
+
'justify-items-start':'justify-items:start','justify-items-end':'justify-items:end',
|
|
87
|
+
'justify-items-center':'justify-items:center','justify-items-stretch':'justify-items:stretch',
|
|
88
|
+
'justify-self-start':'justify-self:start','justify-self-end':'justify-self:end',
|
|
89
|
+
'justify-self-center':'justify-self:center','justify-self-stretch':'justify-self:stretch',
|
|
90
|
+
'justify-self-auto':'justify-self:auto',
|
|
91
|
+
'place-center':'place-items:center;place-content:center',
|
|
92
|
+
'place-stretch':'place-items:stretch',
|
|
93
|
+
// Order
|
|
94
|
+
'order-first':'order:-9999','order-last':'order:9999','order-none':'order:0',
|
|
95
|
+
// Grid cols/rows
|
|
96
|
+
'grid-cols-none':'grid-template-columns:none',
|
|
97
|
+
'grid-flow-row':'grid-auto-flow:row','grid-flow-col':'grid-auto-flow:column','grid-flow-dense':'grid-auto-flow:dense',
|
|
98
|
+
'span-col-full':'grid-column:1 / -1','span-row-full':'grid-row:1 / -1',
|
|
99
|
+
// Margin auto
|
|
100
|
+
'center-margin':'margin:0 auto','add-margin-auto':'margin:auto',
|
|
101
|
+
'add-margin-top-auto':'margin-top:auto','add-margin-bottom-auto':'margin-bottom:auto',
|
|
102
|
+
'add-margin-left-auto':'margin-left:auto','add-margin-right-auto':'margin-right:auto',
|
|
103
|
+
'add-margin-x-auto':'margin-left:auto;margin-right:auto',
|
|
104
|
+
'add-margin-y-auto':'margin-top:auto;margin-bottom:auto',
|
|
105
|
+
// Border styles
|
|
106
|
+
'border-solid':'border-style:solid','border-dashed':'border-style:dashed',
|
|
107
|
+
'border-dotted':'border-style:dotted','border-double':'border-style:double',
|
|
108
|
+
'border-hidden':'border-style:hidden','border-none':'border-style:none',
|
|
109
|
+
// Border radius named
|
|
110
|
+
'make-circle':'border-radius:50%','make-pill':'border-radius:9999px',
|
|
111
|
+
// Sizing special
|
|
112
|
+
'set-width-full':'width:100%','set-width-screen':'width:100vw','set-width-auto':'width:auto',
|
|
113
|
+
'set-width-min':'width:min-content','set-width-max':'width:max-content','set-width-fit':'width:fit-content',
|
|
114
|
+
'set-height-full':'height:100%','set-height-screen':'height:100vh','set-height-auto':'height:auto',
|
|
115
|
+
'set-height-min':'height:min-content','set-height-max':'height:max-content','set-height-fit':'height:fit-content',
|
|
116
|
+
'min-width-full':'min-width:100%','max-width-full':'max-width:100%',
|
|
117
|
+
'min-width-screen':'min-width:100vw','max-width-screen':'max-width:100vw',
|
|
118
|
+
'min-width-none':'min-width:0','max-width-none':'max-width:none',
|
|
119
|
+
'min-height-full':'min-height:100%','max-height-full':'max-height:100%',
|
|
120
|
+
'min-height-screen':'min-height:100vh','max-height-screen':'max-height:100vh',
|
|
121
|
+
// Position
|
|
122
|
+
'position-static':'position:static','position-relative':'position:relative',
|
|
123
|
+
'position-absolute':'position:absolute','position-fixed':'position:fixed','position-sticky':'position:sticky',
|
|
124
|
+
'pin-center':'top:50%;left:50%;transform:translate(-50%,-50%)',
|
|
125
|
+
'pin-center-x':'left:50%;transform:translateX(-50%)',
|
|
126
|
+
'pin-center-y':'top:50%;transform:translateY(-50%)',
|
|
127
|
+
'pin-top-full':'top:100%','pin-bottom-full':'bottom:100%',
|
|
128
|
+
'pin-left-full':'left:100%','pin-right-full':'right:100%',
|
|
129
|
+
'pin-top-auto':'top:auto','pin-bottom-auto':'bottom:auto',
|
|
130
|
+
'pin-left-auto':'left:auto','pin-right-auto':'right:auto',
|
|
131
|
+
// Overflow
|
|
132
|
+
'overflow-auto':'overflow:auto','overflow-hidden':'overflow:hidden','overflow-scroll':'overflow:scroll',
|
|
133
|
+
'overflow-visible':'overflow:visible','overflow-clip':'overflow:clip',
|
|
134
|
+
'overflow-x-auto':'overflow-x:auto','overflow-x-hidden':'overflow-x:hidden',
|
|
135
|
+
'overflow-x-scroll':'overflow-x:scroll','overflow-x-visible':'overflow-x:visible',
|
|
136
|
+
'overflow-y-auto':'overflow-y:auto','overflow-y-hidden':'overflow-y:hidden',
|
|
137
|
+
'overflow-y-scroll':'overflow-y:scroll','overflow-y-visible':'overflow-y:visible',
|
|
138
|
+
// Z-index auto
|
|
139
|
+
'layer-auto':'z-index:auto',
|
|
140
|
+
// Text
|
|
141
|
+
'text-thin':'font-weight:100','text-extra-light':'font-weight:200','text-light':'font-weight:300',
|
|
142
|
+
'text-normal':'font-weight:400','text-medium':'font-weight:500','text-semibold':'font-weight:600',
|
|
143
|
+
'text-bold':'font-weight:700','text-extra-bold':'font-weight:800','text-black-weight':'font-weight:900',
|
|
144
|
+
'text-italic':'font-style:italic','text-not-italic':'font-style:normal',
|
|
145
|
+
'font-sans':"font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif",
|
|
146
|
+
'font-serif':"font-family:ui-serif,Georgia,Cambria,'Times New Roman',Times,serif",
|
|
147
|
+
'font-mono':"font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace",
|
|
148
|
+
'text-left':'text-align:left','text-center':'text-align:center','text-right':'text-align:right',
|
|
149
|
+
'text-justify':'text-align:justify','text-start':'text-align:start','text-end':'text-align:end',
|
|
150
|
+
'text-underline':'text-decoration:underline','text-overline':'text-decoration:overline',
|
|
151
|
+
'text-strikethrough':'text-decoration:line-through','text-no-decoration':'text-decoration:none',
|
|
152
|
+
'text-uppercase':'text-transform:uppercase','text-lowercase':'text-transform:lowercase',
|
|
153
|
+
'text-capitalize':'text-transform:capitalize','text-no-transform':'text-transform:none',
|
|
154
|
+
'text-truncate':'overflow:hidden;text-overflow:ellipsis;white-space:nowrap',
|
|
155
|
+
'text-clip':'text-overflow:clip','text-ellipsis':'text-overflow:ellipsis',
|
|
156
|
+
'text-wrap':'white-space:normal','text-nowrap':'white-space:nowrap',
|
|
157
|
+
'text-pre':'white-space:pre','text-pre-wrap':'white-space:pre-wrap','text-pre-line':'white-space:pre-line',
|
|
158
|
+
'text-break-word':'word-break:break-word;overflow-wrap:break-word','text-break-all':'word-break:break-all',
|
|
159
|
+
'line-height-none':'line-height:1','line-height-tight':'line-height:1.25',
|
|
160
|
+
'line-height-snug':'line-height:1.375','line-height-normal':'line-height:1.5',
|
|
161
|
+
'line-height-relaxed':'line-height:1.625','line-height-loose':'line-height:2',
|
|
162
|
+
'letter-space-tight':'letter-spacing:-0.05em','letter-space-snug':'letter-spacing:-0.025em',
|
|
163
|
+
'letter-space-normal':'letter-spacing:0em','letter-space-wide':'letter-spacing:0.025em',
|
|
164
|
+
'letter-space-wider':'letter-spacing:0.05em','letter-space-widest':'letter-spacing:0.1em',
|
|
165
|
+
// Transforms
|
|
166
|
+
'flip-horizontal':'transform:scaleX(-1)','flip-vertical':'transform:scaleY(-1)',
|
|
167
|
+
'rotate-45':'transform:rotate(45deg)','rotate-90':'transform:rotate(90deg)',
|
|
168
|
+
'rotate-135':'transform:rotate(135deg)','rotate-180':'transform:rotate(180deg)',
|
|
169
|
+
'rotate-270':'transform:rotate(270deg)','rotate-minus-45':'transform:rotate(-45deg)',
|
|
170
|
+
'rotate-minus-90':'transform:rotate(-90deg)',
|
|
171
|
+
'scale-75':'transform:scale(0.75)','scale-90':'transform:scale(0.90)',
|
|
172
|
+
'scale-95':'transform:scale(0.95)','scale-100':'transform:scale(1)',
|
|
173
|
+
'scale-105':'transform:scale(1.05)','scale-110':'transform:scale(1.10)',
|
|
174
|
+
'scale-125':'transform:scale(1.25)','scale-150':'transform:scale(1.50)',
|
|
175
|
+
'skew-x-3':'transform:skewX(3deg)','skew-x-6':'transform:skewX(6deg)','skew-x-12':'transform:skewX(12deg)',
|
|
176
|
+
'skew-y-3':'transform:skewY(3deg)','skew-y-6':'transform:skewY(6deg)','skew-y-12':'transform:skewY(12deg)',
|
|
177
|
+
// Transitions
|
|
178
|
+
'transition-fast':'transition:all 0.15s ease','transition-normal':'transition:all 0.3s ease',
|
|
179
|
+
'transition-slow':'transition:all 0.5s ease','transition-none':'transition:none',
|
|
180
|
+
'transition-colors':'transition:color 0.3s ease,background-color 0.3s ease,border-color 0.3s ease',
|
|
181
|
+
'transition-opacity':'transition:opacity 0.3s ease','transition-transform':'transition:transform 0.3s ease',
|
|
182
|
+
// Animations
|
|
183
|
+
// Core animations
|
|
184
|
+
'animate-spin':'animation:santy-spin 1s linear infinite',
|
|
185
|
+
'animate-ping':'animation:santy-ping 1s cubic-bezier(0,0,.2,1) infinite',
|
|
186
|
+
'animate-pulse':'animation:santy-pulse 2s cubic-bezier(.4,0,.6,1) infinite',
|
|
187
|
+
'animate-bounce':'animation:santy-bounce 1s infinite',
|
|
188
|
+
// Attention seekers
|
|
189
|
+
'animate-flash':'animation:santy-flash 1s ease both',
|
|
190
|
+
'animate-rubber-band':'animation:santy-rubber-band 1s ease both',
|
|
191
|
+
'animate-shake-x':'animation:santy-shake-x 1s ease both',
|
|
192
|
+
'animate-shake-y':'animation:santy-shake-y 1s ease both',
|
|
193
|
+
'animate-shake-head':'animation:santy-shake-head 1s ease-in-out both',
|
|
194
|
+
'animate-swing':'animation:santy-swing 1s ease both;transform-origin:top center',
|
|
195
|
+
'animate-tada':'animation:santy-tada 1s ease both',
|
|
196
|
+
'animate-wobble':'animation:santy-wobble 1s ease both',
|
|
197
|
+
'animate-jelly':'animation:santy-jelly 1s ease both',
|
|
198
|
+
'animate-heartbeat':'animation:santy-heartbeat 1.3s ease-in-out both',
|
|
199
|
+
// Fade in
|
|
200
|
+
'animate-fade-in':'animation:santy-fade-in 0.5s ease both',
|
|
201
|
+
'animate-fade-in-from-top':'animation:santy-fade-in-from-top 0.5s ease both',
|
|
202
|
+
'animate-fade-in-from-bottom':'animation:santy-fade-in-from-bottom 0.5s ease both',
|
|
203
|
+
'animate-fade-in-from-left':'animation:santy-fade-in-from-left 0.5s ease both',
|
|
204
|
+
'animate-fade-in-from-right':'animation:santy-fade-in-from-right 0.5s ease both',
|
|
205
|
+
'animate-fade-in-top-left':'animation:santy-fade-in-top-left 0.5s ease both',
|
|
206
|
+
'animate-fade-in-top-right':'animation:santy-fade-in-top-right 0.5s ease both',
|
|
207
|
+
'animate-fade-in-bottom-left':'animation:santy-fade-in-bottom-left 0.5s ease both',
|
|
208
|
+
'animate-fade-in-bottom-right':'animation:santy-fade-in-bottom-right 0.5s ease both',
|
|
209
|
+
// Fade out
|
|
210
|
+
'animate-fade-out':'animation:santy-fade-out 0.5s ease both',
|
|
211
|
+
'animate-fade-out-to-top':'animation:santy-fade-out-to-top 0.5s ease both',
|
|
212
|
+
'animate-fade-out-to-bottom':'animation:santy-fade-out-to-bottom 0.5s ease both',
|
|
213
|
+
'animate-fade-out-to-left':'animation:santy-fade-out-to-left 0.5s ease both',
|
|
214
|
+
'animate-fade-out-to-right':'animation:santy-fade-out-to-right 0.5s ease both',
|
|
215
|
+
'animate-fade-out-top-left':'animation:santy-fade-out-top-left 0.5s ease both',
|
|
216
|
+
'animate-fade-out-top-right':'animation:santy-fade-out-top-right 0.5s ease both',
|
|
217
|
+
'animate-fade-out-bottom-left':'animation:santy-fade-out-bottom-left 0.5s ease both',
|
|
218
|
+
'animate-fade-out-bottom-right':'animation:santy-fade-out-bottom-right 0.5s ease both',
|
|
219
|
+
// Bounce in
|
|
220
|
+
'animate-bounce-in':'animation:santy-bounce-in 0.75s ease both',
|
|
221
|
+
'animate-bounce-in-from-top':'animation:santy-bounce-in-from-top 0.75s ease both',
|
|
222
|
+
'animate-bounce-in-from-bottom':'animation:santy-bounce-in-from-bottom 0.75s ease both',
|
|
223
|
+
'animate-bounce-in-from-left':'animation:santy-bounce-in-from-left 0.75s ease both',
|
|
224
|
+
'animate-bounce-in-from-right':'animation:santy-bounce-in-from-right 0.75s ease both',
|
|
225
|
+
// Bounce out
|
|
226
|
+
'animate-bounce-out':'animation:santy-bounce-out 0.75s ease both',
|
|
227
|
+
'animate-bounce-out-to-top':'animation:santy-bounce-out-to-top 0.75s ease both',
|
|
228
|
+
'animate-bounce-out-to-bottom':'animation:santy-bounce-out-to-bottom 0.75s ease both',
|
|
229
|
+
'animate-bounce-out-to-left':'animation:santy-bounce-out-to-left 0.75s ease both',
|
|
230
|
+
'animate-bounce-out-to-right':'animation:santy-bounce-out-to-right 0.75s ease both',
|
|
231
|
+
// Slide in
|
|
232
|
+
'animate-slide-in-from-top':'animation:santy-slide-in-from-top 0.4s ease both',
|
|
233
|
+
'animate-slide-in-from-bottom':'animation:santy-slide-in-from-bottom 0.4s ease both',
|
|
234
|
+
'animate-slide-in-from-left':'animation:santy-slide-in-from-left 0.4s ease both',
|
|
235
|
+
'animate-slide-in-from-right':'animation:santy-slide-in-from-right 0.4s ease both',
|
|
236
|
+
// Slide out
|
|
237
|
+
'animate-slide-out-to-top':'animation:santy-slide-out-to-top 0.4s ease both',
|
|
238
|
+
'animate-slide-out-to-bottom':'animation:santy-slide-out-to-bottom 0.4s ease both',
|
|
239
|
+
'animate-slide-out-to-left':'animation:santy-slide-out-to-left 0.4s ease both',
|
|
240
|
+
'animate-slide-out-to-right':'animation:santy-slide-out-to-right 0.4s ease both',
|
|
241
|
+
// Zoom in
|
|
242
|
+
'animate-zoom-in':'animation:santy-zoom-in 0.3s ease both',
|
|
243
|
+
'animate-zoom-in-from-top':'animation:santy-zoom-in-from-top 0.5s ease both',
|
|
244
|
+
'animate-zoom-in-from-bottom':'animation:santy-zoom-in-from-bottom 0.5s ease both',
|
|
245
|
+
'animate-zoom-in-from-left':'animation:santy-zoom-in-from-left 0.5s ease both',
|
|
246
|
+
'animate-zoom-in-from-right':'animation:santy-zoom-in-from-right 0.5s ease both',
|
|
247
|
+
// Zoom out
|
|
248
|
+
'animate-zoom-out':'animation:santy-zoom-out 0.3s ease both',
|
|
249
|
+
'animate-zoom-out-to-top':'animation:santy-zoom-out-to-top 0.5s ease both',
|
|
250
|
+
'animate-zoom-out-to-bottom':'animation:santy-zoom-out-to-bottom 0.5s ease both',
|
|
251
|
+
'animate-zoom-out-to-left':'animation:santy-zoom-out-to-left 0.5s ease both',
|
|
252
|
+
'animate-zoom-out-to-right':'animation:santy-zoom-out-to-right 0.5s ease both',
|
|
253
|
+
// Flip
|
|
254
|
+
'animate-flip':'animation:santy-flip 1s ease both;backface-visibility:visible',
|
|
255
|
+
'animate-flip-in-x':'animation:santy-flip-in-x 0.75s ease both;backface-visibility:visible',
|
|
256
|
+
'animate-flip-in-y':'animation:santy-flip-in-y 0.75s ease both;backface-visibility:visible',
|
|
257
|
+
'animate-flip-out-x':'animation:santy-flip-out-x 0.75s ease both;backface-visibility:visible',
|
|
258
|
+
'animate-flip-out-y':'animation:santy-flip-out-y 0.75s ease both;backface-visibility:visible',
|
|
259
|
+
// Rotate in
|
|
260
|
+
'animate-rotate-in':'animation:santy-rotate-in 0.6s ease both',
|
|
261
|
+
'animate-rotate-in-from-top-left':'animation:santy-rotate-in-from-top-left 0.6s ease both;transform-origin:left top',
|
|
262
|
+
'animate-rotate-in-from-top-right':'animation:santy-rotate-in-from-top-right 0.6s ease both;transform-origin:right top',
|
|
263
|
+
'animate-rotate-in-from-bottom-left':'animation:santy-rotate-in-from-bottom-left 0.6s ease both;transform-origin:left bottom',
|
|
264
|
+
'animate-rotate-in-from-bottom-right':'animation:santy-rotate-in-from-bottom-right 0.6s ease both;transform-origin:right bottom',
|
|
265
|
+
// Rotate out
|
|
266
|
+
'animate-rotate-out':'animation:santy-rotate-out 0.6s ease both',
|
|
267
|
+
'animate-rotate-out-to-top-left':'animation:santy-rotate-out-to-top-left 0.6s ease both;transform-origin:left top',
|
|
268
|
+
'animate-rotate-out-to-top-right':'animation:santy-rotate-out-to-top-right 0.6s ease both;transform-origin:right top',
|
|
269
|
+
'animate-rotate-out-to-bottom-left':'animation:santy-rotate-out-to-bottom-left 0.6s ease both;transform-origin:left bottom',
|
|
270
|
+
'animate-rotate-out-to-bottom-right':'animation:santy-rotate-out-to-bottom-right 0.6s ease both;transform-origin:right bottom',
|
|
271
|
+
// Back in
|
|
272
|
+
'animate-back-in-from-top':'animation:santy-back-in-from-top 0.7s ease both',
|
|
273
|
+
'animate-back-in-from-bottom':'animation:santy-back-in-from-bottom 0.7s ease both',
|
|
274
|
+
'animate-back-in-from-left':'animation:santy-back-in-from-left 0.7s ease both',
|
|
275
|
+
'animate-back-in-from-right':'animation:santy-back-in-from-right 0.7s ease both',
|
|
276
|
+
// Back out
|
|
277
|
+
'animate-back-out-to-top':'animation:santy-back-out-to-top 0.7s ease both',
|
|
278
|
+
'animate-back-out-to-bottom':'animation:santy-back-out-to-bottom 0.7s ease both',
|
|
279
|
+
'animate-back-out-to-left':'animation:santy-back-out-to-left 0.7s ease both',
|
|
280
|
+
'animate-back-out-to-right':'animation:santy-back-out-to-right 0.7s ease both',
|
|
281
|
+
// Light speed
|
|
282
|
+
'animate-speed-in-from-left':'animation:santy-speed-in-from-left 0.5s ease-out both',
|
|
283
|
+
'animate-speed-in-from-right':'animation:santy-speed-in-from-right 0.5s ease-out both',
|
|
284
|
+
'animate-speed-out-to-left':'animation:santy-speed-out-to-left 0.5s ease-in both',
|
|
285
|
+
'animate-speed-out-to-right':'animation:santy-speed-out-to-right 0.5s ease-in both',
|
|
286
|
+
// Specials
|
|
287
|
+
'animate-hinge':'animation:santy-hinge 2s ease both;transform-origin:top left',
|
|
288
|
+
'animate-jack-in-box':'animation:santy-jack-in-box 1s ease both;transform-origin:center bottom',
|
|
289
|
+
'animate-roll-in':'animation:santy-roll-in 0.6s ease both',
|
|
290
|
+
'animate-roll-out':'animation:santy-roll-out 0.6s ease both',
|
|
291
|
+
// Backwards compat aliases
|
|
292
|
+
'animate-slide-up':'animation:santy-slide-in-from-bottom 0.4s ease both',
|
|
293
|
+
'animate-slide-down':'animation:santy-slide-in-from-top 0.4s ease both',
|
|
294
|
+
// Animation helpers
|
|
295
|
+
'animation-speed-fastest':'animation-duration:0.3s',
|
|
296
|
+
'animation-speed-fast':'animation-duration:0.5s',
|
|
297
|
+
'animation-speed-normal':'animation-duration:1s',
|
|
298
|
+
'animation-speed-slow':'animation-duration:1.5s',
|
|
299
|
+
'animation-speed-slowest':'animation-duration:2s',
|
|
300
|
+
'animation-speed-glacial':'animation-duration:3s',
|
|
301
|
+
'animation-delay-100':'animation-delay:0.1s',
|
|
302
|
+
'animation-delay-200':'animation-delay:0.2s',
|
|
303
|
+
'animation-delay-300':'animation-delay:0.3s',
|
|
304
|
+
'animation-delay-400':'animation-delay:0.4s',
|
|
305
|
+
'animation-delay-500':'animation-delay:0.5s',
|
|
306
|
+
'animation-delay-600':'animation-delay:0.6s',
|
|
307
|
+
'animation-delay-700':'animation-delay:0.7s',
|
|
308
|
+
'animation-delay-800':'animation-delay:0.8s',
|
|
309
|
+
'animation-delay-900':'animation-delay:0.9s',
|
|
310
|
+
'animation-delay-1000':'animation-delay:1s',
|
|
311
|
+
'animation-delay-1500':'animation-delay:1.5s',
|
|
312
|
+
'animation-delay-2000':'animation-delay:2s',
|
|
313
|
+
'animation-delay-3000':'animation-delay:3s',
|
|
314
|
+
'animation-loop-1':'animation-iteration-count:1',
|
|
315
|
+
'animation-loop-2':'animation-iteration-count:2',
|
|
316
|
+
'animation-loop-3':'animation-iteration-count:3',
|
|
317
|
+
'animation-loop-4':'animation-iteration-count:4',
|
|
318
|
+
'animation-loop-5':'animation-iteration-count:5',
|
|
319
|
+
'animation-loop-forever':'animation-iteration-count:infinite',
|
|
320
|
+
'animation-fill-none':'animation-fill-mode:none',
|
|
321
|
+
'animation-fill-forwards':'animation-fill-mode:forwards',
|
|
322
|
+
'animation-fill-backwards':'animation-fill-mode:backwards',
|
|
323
|
+
'animation-fill-both':'animation-fill-mode:both',
|
|
324
|
+
'animation-ease':'animation-timing-function:ease',
|
|
325
|
+
'animation-ease-in':'animation-timing-function:ease-in',
|
|
326
|
+
'animation-ease-out':'animation-timing-function:ease-out',
|
|
327
|
+
'animation-ease-in-out':'animation-timing-function:ease-in-out',
|
|
328
|
+
'animation-linear':'animation-timing-function:linear',
|
|
329
|
+
'animation-running':'animation-play-state:running',
|
|
330
|
+
'animation-paused':'animation-play-state:paused','animation-none':'animation:none',
|
|
331
|
+
// Filters
|
|
332
|
+
'blur-sm':'filter:blur(4px)','blur':'filter:blur(8px)','blur-md':'filter:blur(12px)',
|
|
333
|
+
'blur-lg':'filter:blur(16px)','blur-xl':'filter:blur(24px)','blur-none':'filter:blur(0)',
|
|
334
|
+
'grayscale':'filter:grayscale(100%)','grayscale-0':'filter:grayscale(0)',
|
|
335
|
+
'sepia':'filter:sepia(100%)','sepia-0':'filter:sepia(0)',
|
|
336
|
+
'invert':'filter:invert(100%)','invert-0':'filter:invert(0)',
|
|
337
|
+
// Shadows
|
|
338
|
+
'add-shadow-sm':'box-shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06)',
|
|
339
|
+
'add-shadow':'box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06)',
|
|
340
|
+
'add-shadow-md':'box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)',
|
|
341
|
+
'add-shadow-lg':'box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)',
|
|
342
|
+
'add-shadow-xl':'box-shadow:0 25px 50px -12px rgba(0,0,0,.25)',
|
|
343
|
+
'add-shadow-inner':'box-shadow:inset 0 2px 4px 0 rgba(0,0,0,.06)',
|
|
344
|
+
'add-shadow-none':'box-shadow:none','no-shadow':'box-shadow:none',
|
|
345
|
+
'drop-shadow-sm':'filter:drop-shadow(0 1px 1px rgba(0,0,0,.05))',
|
|
346
|
+
'drop-shadow':'filter:drop-shadow(0 1px 2px rgba(0,0,0,.1))',
|
|
347
|
+
'drop-shadow-md':'filter:drop-shadow(0 4px 3px rgba(0,0,0,.07))',
|
|
348
|
+
'drop-shadow-lg':'filter:drop-shadow(0 10px 8px rgba(0,0,0,.04))',
|
|
349
|
+
'drop-shadow-none':'filter:drop-shadow(0 0 #0000)',
|
|
350
|
+
'text-shadow-sm':'text-shadow:0 1px 2px rgba(0,0,0,.2)',
|
|
351
|
+
'text-shadow':'text-shadow:0 2px 4px rgba(0,0,0,.3)',
|
|
352
|
+
'text-shadow-lg':'text-shadow:0 4px 8px rgba(0,0,0,.4)',
|
|
353
|
+
'text-shadow-none':'text-shadow:none',
|
|
354
|
+
// Cursor
|
|
355
|
+
'cursor-auto':'cursor:auto','cursor-default':'cursor:default','cursor-pointer':'cursor:pointer',
|
|
356
|
+
'cursor-wait':'cursor:wait','cursor-text':'cursor:text','cursor-move':'cursor:move',
|
|
357
|
+
'cursor-not-allowed':'cursor:not-allowed','cursor-crosshair':'cursor:crosshair',
|
|
358
|
+
'cursor-grab':'cursor:grab','cursor-grabbing':'cursor:grabbing',
|
|
359
|
+
'cursor-zoom-in':'cursor:zoom-in','cursor-zoom-out':'cursor:zoom-out',
|
|
360
|
+
'cursor-help':'cursor:help','cursor-none':'cursor:none',
|
|
361
|
+
// Object fit
|
|
362
|
+
'fit-cover':'object-fit:cover','fit-contain':'object-fit:contain',
|
|
363
|
+
'fit-fill':'object-fit:fill','fit-none':'object-fit:none','fit-scale':'object-fit:scale-down',
|
|
364
|
+
// Aspect ratio
|
|
365
|
+
'ratio-square':'aspect-ratio:1/1','ratio-video':'aspect-ratio:16/9',
|
|
366
|
+
'ratio-portrait':'aspect-ratio:9/16','ratio-4-3':'aspect-ratio:4/3',
|
|
367
|
+
'ratio-3-2':'aspect-ratio:3/2','ratio-21-9':'aspect-ratio:21/9','ratio-auto':'aspect-ratio:auto',
|
|
368
|
+
// Misc
|
|
369
|
+
'pointer-none':'pointer-events:none','pointer-auto':'pointer-events:auto','pointer-all':'pointer-events:all',
|
|
370
|
+
'select-none':'user-select:none','select-text':'user-select:text',
|
|
371
|
+
'select-all':'user-select:all','select-auto':'user-select:auto',
|
|
372
|
+
'resize-none':'resize:none','resize':'resize:both','resize-x':'resize:horizontal','resize-y':'resize:vertical',
|
|
373
|
+
'appearance-none':'appearance:none;-webkit-appearance:none','appearance-auto':'appearance:auto',
|
|
374
|
+
'outline-none':'outline:none','outline':'outline:2px solid currentColor',
|
|
375
|
+
'outline-dashed':'outline:2px dashed currentColor',
|
|
376
|
+
'outline-offset-2':'outline-offset:2px','outline-offset-4':'outline-offset:4px',
|
|
377
|
+
'list-none':'list-style-type:none;padding-left:0','list-disc':'list-style-type:disc',
|
|
378
|
+
'list-decimal':'list-style-type:decimal','list-inside':'list-style-position:inside',
|
|
379
|
+
'list-outside':'list-style-position:outside',
|
|
380
|
+
'table-auto':'table-layout:auto','table-fixed':'table-layout:fixed',
|
|
381
|
+
'border-collapse':'border-collapse:collapse','border-separate':'border-collapse:separate',
|
|
382
|
+
'sr-only':'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0',
|
|
383
|
+
'not-sr-only':'position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal',
|
|
384
|
+
'isolate':'isolation:isolate','isolation-auto':'isolation:auto',
|
|
385
|
+
'will-change-auto':'will-change:auto','will-change-scroll':'will-change:scroll-position',
|
|
386
|
+
'will-change-contents':'will-change:contents','will-change-transform':'will-change:transform',
|
|
387
|
+
// bg
|
|
388
|
+
'bg-top':'background-position:top','bg-bottom':'background-position:bottom',
|
|
389
|
+
'bg-left':'background-position:left','bg-right':'background-position:right',
|
|
390
|
+
'bg-center':'background-position:center','bg-cover':'background-size:cover',
|
|
391
|
+
'bg-contain':'background-size:contain','bg-auto':'background-size:auto',
|
|
392
|
+
'bg-repeat':'background-repeat:repeat','bg-no-repeat':'background-repeat:no-repeat',
|
|
393
|
+
'bg-fixed':'background-attachment:fixed','bg-local':'background-attachment:local',
|
|
394
|
+
'bg-clip-text':'background-clip:text;-webkit-background-clip:text',
|
|
395
|
+
// Named colors
|
|
396
|
+
'color-white':'color:#fff','color-black':'color:#000',
|
|
397
|
+
'color-transparent':'color:transparent','color-current':'color:currentColor',
|
|
398
|
+
'background-white':'background-color:#fff','background-black':'background-color:#000',
|
|
399
|
+
'background-transparent':'background-color:transparent',
|
|
400
|
+
'border-color-white':'border-color:#fff','border-color-black':'border-color:#000',
|
|
401
|
+
'border-color-transparent':'border-color:transparent',
|
|
402
|
+
// Blend modes
|
|
403
|
+
'blend-normal':'mix-blend-mode:normal','blend-multiply':'mix-blend-mode:multiply',
|
|
404
|
+
'blend-screen':'mix-blend-mode:screen','blend-overlay':'mix-blend-mode:overlay',
|
|
405
|
+
'blend-darken':'mix-blend-mode:darken','blend-lighten':'mix-blend-mode:lighten',
|
|
406
|
+
'blend-difference':'mix-blend-mode:difference','blend-exclusion':'mix-blend-mode:exclusion',
|
|
407
|
+
'blend-hue':'mix-blend-mode:hue','blend-saturation':'mix-blend-mode:saturation',
|
|
408
|
+
'blend-color':'mix-blend-mode:color','blend-luminosity':'mix-blend-mode:luminosity',
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// ─── Numeric pattern rules ────────────────────────────────────────────────
|
|
412
|
+
// Each rule: [regex, (matches...) => css_props_string | null]
|
|
413
|
+
var RULES = [
|
|
414
|
+
// Padding
|
|
415
|
+
[/^add-padding-(\d+(?:\.\d+)?)$/, function(n){ return 'padding:'+n+'px'; }],
|
|
416
|
+
[/^add-padding-top-(\d+(?:\.\d+)?)$/, function(n){ return 'padding-top:'+n+'px'; }],
|
|
417
|
+
[/^add-padding-bottom-(\d+(?:\.\d+)?)$/, function(n){ return 'padding-bottom:'+n+'px'; }],
|
|
418
|
+
[/^add-padding-left-(\d+(?:\.\d+)?)$/, function(n){ return 'padding-left:'+n+'px'; }],
|
|
419
|
+
[/^add-padding-right-(\d+(?:\.\d+)?)$/, function(n){ return 'padding-right:'+n+'px'; }],
|
|
420
|
+
[/^add-padding-x-(\d+(?:\.\d+)?)$/, function(n){ return 'padding-left:'+n+'px;padding-right:'+n+'px'; }],
|
|
421
|
+
[/^add-padding-y-(\d+(?:\.\d+)?)$/, function(n){ return 'padding-top:'+n+'px;padding-bottom:'+n+'px'; }],
|
|
422
|
+
// Margin
|
|
423
|
+
[/^add-margin-(\d+(?:\.\d+)?)$/, function(n){ return 'margin:'+n+'px'; }],
|
|
424
|
+
[/^add-margin-top-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-top:'+n+'px'; }],
|
|
425
|
+
[/^add-margin-bottom-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-bottom:'+n+'px'; }],
|
|
426
|
+
[/^add-margin-left-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-left:'+n+'px'; }],
|
|
427
|
+
[/^add-margin-right-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-right:'+n+'px'; }],
|
|
428
|
+
[/^add-margin-x-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-left:'+n+'px;margin-right:'+n+'px'; }],
|
|
429
|
+
[/^add-margin-y-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-top:'+n+'px;margin-bottom:'+n+'px'; }],
|
|
430
|
+
// Negative margin
|
|
431
|
+
[/^subtract-margin-(\d+(?:\.\d+)?)$/, function(n){ return 'margin:-'+n+'px'; }],
|
|
432
|
+
[/^subtract-margin-top-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-top:-'+n+'px'; }],
|
|
433
|
+
[/^subtract-margin-bottom-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-bottom:-'+n+'px'; }],
|
|
434
|
+
[/^subtract-margin-left-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-left:-'+n+'px'; }],
|
|
435
|
+
[/^subtract-margin-right-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-right:-'+n+'px'; }],
|
|
436
|
+
[/^subtract-margin-x-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-left:-'+n+'px;margin-right:-'+n+'px'; }],
|
|
437
|
+
[/^subtract-margin-y-(\d+(?:\.\d+)?)$/, function(n){ return 'margin-top:-'+n+'px;margin-bottom:-'+n+'px'; }],
|
|
438
|
+
// Gap
|
|
439
|
+
[/^gap-(\d+(?:\.\d+)?)$/, function(n){ return 'gap:'+n+'px'; }],
|
|
440
|
+
[/^gap-x-(\d+(?:\.\d+)?)$/, function(n){ return 'column-gap:'+n+'px'; }],
|
|
441
|
+
[/^gap-y-(\d+(?:\.\d+)?)$/, function(n){ return 'row-gap:'+n+'px'; }],
|
|
442
|
+
// Border width
|
|
443
|
+
[/^add-border-(\d+(?:\.\d+)?)$/, function(n){ return 'border:'+n+'px solid'; }],
|
|
444
|
+
[/^add-border-top-(\d+(?:\.\d+)?)$/, function(n){ return 'border-top:'+n+'px solid'; }],
|
|
445
|
+
[/^add-border-bottom-(\d+(?:\.\d+)?)$/, function(n){ return 'border-bottom:'+n+'px solid'; }],
|
|
446
|
+
[/^add-border-left-(\d+(?:\.\d+)?)$/, function(n){ return 'border-left:'+n+'px solid'; }],
|
|
447
|
+
[/^add-border-right-(\d+(?:\.\d+)?)$/, function(n){ return 'border-right:'+n+'px solid'; }],
|
|
448
|
+
[/^add-border-x-(\d+(?:\.\d+)?)$/, function(n){ return 'border-left:'+n+'px solid;border-right:'+n+'px solid'; }],
|
|
449
|
+
[/^add-border-y-(\d+(?:\.\d+)?)$/, function(n){ return 'border-top:'+n+'px solid;border-bottom:'+n+'px solid'; }],
|
|
450
|
+
// Border radius
|
|
451
|
+
[/^round-corners-(\d+(?:\.\d+)?)$/, function(n){ return 'border-radius:'+n+'px'; }],
|
|
452
|
+
[/^round-top-(\d+(?:\.\d+)?)$/, function(n){ return 'border-top-left-radius:'+n+'px;border-top-right-radius:'+n+'px'; }],
|
|
453
|
+
[/^round-bottom-(\d+(?:\.\d+)?)$/, function(n){ return 'border-bottom-left-radius:'+n+'px;border-bottom-right-radius:'+n+'px'; }],
|
|
454
|
+
[/^round-left-(\d+(?:\.\d+)?)$/, function(n){ return 'border-top-left-radius:'+n+'px;border-bottom-left-radius:'+n+'px'; }],
|
|
455
|
+
[/^round-right-(\d+(?:\.\d+)?)$/, function(n){ return 'border-top-right-radius:'+n+'px;border-bottom-right-radius:'+n+'px'; }],
|
|
456
|
+
// Sizing
|
|
457
|
+
[/^set-width-(\d+(?:\.\d+)?)$/, function(n){ return 'width:'+n+'px'; }],
|
|
458
|
+
[/^set-height-(\d+(?:\.\d+)?)$/, function(n){ return 'height:'+n+'px'; }],
|
|
459
|
+
[/^min-width-(\d+(?:\.\d+)?)$/, function(n){ return 'min-width:'+n+'px'; }],
|
|
460
|
+
[/^max-width-(\d+(?:\.\d+)?)$/, function(n){ return 'max-width:'+n+'px'; }],
|
|
461
|
+
[/^min-height-(\d+(?:\.\d+)?)$/, function(n){ return 'min-height:'+n+'px'; }],
|
|
462
|
+
[/^max-height-(\d+(?:\.\d+)?)$/, function(n){ return 'max-height:'+n+'px'; }],
|
|
463
|
+
// Fractional widths set-width-1-of-3
|
|
464
|
+
[/^set-width-(\d+)-of-(\d+)$/, function(n,d){
|
|
465
|
+
var pct = (parseInt(n,10)/parseInt(d,10)*100).toFixed(6).replace(/\.?0+$/,'');
|
|
466
|
+
return 'width:'+pct+'%';
|
|
467
|
+
}],
|
|
468
|
+
[/^set-height-(\d+)-of-(\d+)$/, function(n,d){
|
|
469
|
+
var pct = (parseInt(n,10)/parseInt(d,10)*100).toFixed(6).replace(/\.?0+$/,'');
|
|
470
|
+
return 'height:'+pct+'%';
|
|
471
|
+
}],
|
|
472
|
+
// Font size
|
|
473
|
+
[/^set-text-(\d+(?:\.\d+)?)$/, function(n){ return 'font-size:'+n+'px'; }],
|
|
474
|
+
// Opacity
|
|
475
|
+
[/^opacity-(\d+(?:\.\d+)?)$/, function(n){ return 'opacity:'+parseFloat(n)/100; }],
|
|
476
|
+
// Z-index (layer)
|
|
477
|
+
[/^layer-(-?\d+)$/, function(n){ return 'z-index:'+n; }],
|
|
478
|
+
// Positioning
|
|
479
|
+
[/^pin-top-(\d+(?:\.\d+)?)$/, function(n){ return 'top:'+n+'px'; }],
|
|
480
|
+
[/^pin-bottom-(\d+(?:\.\d+)?)$/, function(n){ return 'bottom:'+n+'px'; }],
|
|
481
|
+
[/^pin-left-(\d+(?:\.\d+)?)$/, function(n){ return 'left:'+n+'px'; }],
|
|
482
|
+
[/^pin-right-(\d+(?:\.\d+)?)$/, function(n){ return 'right:'+n+'px'; }],
|
|
483
|
+
[/^pin-all-(\d+(?:\.\d+)?)$/, function(n){ return 'top:'+n+'px;right:'+n+'px;bottom:'+n+'px;left:'+n+'px'; }],
|
|
484
|
+
// Letter spacing
|
|
485
|
+
[/^add-letter-space-(\d+(?:\.\d+)?)$/, function(n){ return 'letter-spacing:'+n+'px'; }],
|
|
486
|
+
[/^subtract-letter-space-(\d+(?:\.\d+)?)$/, function(n){ return 'letter-spacing:-'+n+'px'; }],
|
|
487
|
+
// Grid
|
|
488
|
+
[/^grid-cols-(\d+)$/, function(n){ return 'grid-template-columns:repeat('+n+',minmax(0,1fr))'; }],
|
|
489
|
+
[/^grid-rows-(\d+)$/, function(n){ return 'grid-template-rows:repeat('+n+',minmax(0,1fr))'; }],
|
|
490
|
+
[/^span-col-(\d+)$/, function(n){ return 'grid-column:span '+n+' / span '+n; }],
|
|
491
|
+
[/^span-row-(\d+)$/, function(n){ return 'grid-row:span '+n+' / span '+n; }],
|
|
492
|
+
[/^order-(\d+)$/, function(n){ return 'order:'+n; }],
|
|
493
|
+
[/^columns-(\d+)$/, function(n){ return 'columns:'+n; }],
|
|
494
|
+
// Colors
|
|
495
|
+
[/^color-([a-z]+)-(\d+)$/, function(name,shade){
|
|
496
|
+
var c = color(name, parseInt(shade,10));
|
|
497
|
+
return c ? 'color:'+c : null;
|
|
498
|
+
}],
|
|
499
|
+
[/^background-([a-z]+)-(\d+)$/, function(name,shade){
|
|
500
|
+
var c = color(name, parseInt(shade,10));
|
|
501
|
+
return c ? 'background-color:'+c : null;
|
|
502
|
+
}],
|
|
503
|
+
[/^border-color-([a-z]+)-(\d+)$/, function(name,shade){
|
|
504
|
+
var c = color(name, parseInt(shade,10));
|
|
505
|
+
return c ? 'border-color:'+c : null;
|
|
506
|
+
}],
|
|
507
|
+
[/^fill-([a-z]+)-(\d+)$/, function(name,shade){
|
|
508
|
+
var c = color(name, parseInt(shade,10));
|
|
509
|
+
return c ? 'fill:'+c : null;
|
|
510
|
+
}],
|
|
511
|
+
[/^stroke-([a-z]+)-(\d+)$/, function(name,shade){
|
|
512
|
+
var c = color(name, parseInt(shade,10));
|
|
513
|
+
return c ? 'stroke:'+c : null;
|
|
514
|
+
}],
|
|
515
|
+
// Filter shorthands
|
|
516
|
+
[/^brightness-(\d+)$/, function(n){ return 'filter:brightness('+parseFloat(n)/100+')'; }],
|
|
517
|
+
[/^contrast-(\d+)$/, function(n){ return 'filter:contrast('+parseFloat(n)/100+')'; }],
|
|
518
|
+
[/^saturate-(\d+)$/, function(n){ return 'filter:saturate('+parseFloat(n)/100+')'; }],
|
|
519
|
+
[/^hue-rotate-(\d+)$/, function(n){ return 'filter:hue-rotate('+n+'deg)'; }],
|
|
520
|
+
// Scale (arbitrary)
|
|
521
|
+
[/^scale-(\d+)$/, function(n){ return 'transform:scale('+parseFloat(n)/100+')'; }],
|
|
522
|
+
// Rotate (arbitrary)
|
|
523
|
+
[/^rotate-(\d+)$/, function(n){ return 'transform:rotate('+n+'deg)'; }],
|
|
524
|
+
// Line height (numeric)
|
|
525
|
+
[/^line-height-(\d+(?:-\d+)?)$/, function(n){ return 'line-height:'+n.replace('-','.'); }],
|
|
526
|
+
];
|
|
527
|
+
|
|
528
|
+
// ─── State variant map ────────────────────────────────────────────────────
|
|
529
|
+
var STATES = {
|
|
530
|
+
'on-hover': function(sel,props){ return '.'+sel+':hover{'+props+'}'; },
|
|
531
|
+
'on-focus': function(sel,props){ return '.'+sel+':focus{'+props+'}'; },
|
|
532
|
+
'on-active': function(sel,props){ return '.'+sel+':active{'+props+'}'; },
|
|
533
|
+
'on-disabled': function(sel,props){ return '.'+sel+':disabled{'+props+'}'; },
|
|
534
|
+
'on-checked': function(sel,props){ return '.'+sel+':checked{'+props+'}'; },
|
|
535
|
+
'on-first': function(sel,props){ return '.'+sel+':first-child{'+props+'}'; },
|
|
536
|
+
'on-last': function(sel,props){ return '.'+sel+':last-child{'+props+'}'; },
|
|
537
|
+
'on-odd': function(sel,props){ return '.'+sel+':nth-child(odd){'+props+'}'; },
|
|
538
|
+
'on-even': function(sel,props){ return '.'+sel+':nth-child(even){'+props+'}'; },
|
|
539
|
+
'on-placeholder': function(sel,props){ return '.'+sel+'::placeholder{'+props+'}'; },
|
|
540
|
+
'on-focus-within': function(sel,props){ return '.'+sel+':focus-within{'+props+'}'; },
|
|
541
|
+
'on-focus-visible':function(sel,props){ return '.'+sel+':focus-visible{'+props+'}'; },
|
|
542
|
+
'group-hover': function(sel,props){ return '.group:hover .'+sel+'{'+props+'}'; },
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
// ─── Responsive variant map ───────────────────────────────────────────────
|
|
546
|
+
var RESPONSIVE = {
|
|
547
|
+
'on-mobile': '@media (max-width:639px)',
|
|
548
|
+
'on-tablet': '@media (min-width:640px) and (max-width:1023px)',
|
|
549
|
+
'on-desktop': '@media (min-width:1024px)',
|
|
550
|
+
'on-wide': '@media (min-width:1280px)',
|
|
551
|
+
'on-ultra': '@media (min-width:1536px)',
|
|
552
|
+
'sm': '@media (min-width:640px)',
|
|
553
|
+
'md': '@media (min-width:768px)',
|
|
554
|
+
'lg': '@media (min-width:1024px)',
|
|
555
|
+
'xl': '@media (min-width:1280px)',
|
|
556
|
+
'xxl': '@media (min-width:1536px)',
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
// ─── Escape CSS selector ──────────────────────────────────────────────────
|
|
560
|
+
function esc(cls) {
|
|
561
|
+
return cls.replace(/[:\[\]\/%.]/g, function(c){ return '\\'+c; });
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// ─── Generate CSS props for a base class ─────────────────────────────────
|
|
565
|
+
function baseProps(cls) {
|
|
566
|
+
if (STATIC[cls]) return STATIC[cls];
|
|
567
|
+
for (var i = 0; i < RULES.length; i++) {
|
|
568
|
+
var m = cls.match(RULES[i][0]);
|
|
569
|
+
if (m) {
|
|
570
|
+
var result = RULES[i][1].apply(null, m.slice(1));
|
|
571
|
+
if (result) return result;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// ─── Generate a full CSS rule string for a class name ────────────────────
|
|
578
|
+
function generateRule(cls) {
|
|
579
|
+
// Dark mode
|
|
580
|
+
if (cls.startsWith('dark:')) {
|
|
581
|
+
var inner = cls.slice(5);
|
|
582
|
+
var props = baseProps(inner);
|
|
583
|
+
if (!props) return null;
|
|
584
|
+
return '@media (prefers-color-scheme:dark){.'+esc(cls)+'{'+props+'}}';
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// State variants (on-hover:, on-focus:, group-hover:, etc.)
|
|
588
|
+
for (var state in STATES) {
|
|
589
|
+
if (cls.startsWith(state+':')) {
|
|
590
|
+
var inner = cls.slice(state.length+1);
|
|
591
|
+
var props = baseProps(inner);
|
|
592
|
+
if (!props) return null;
|
|
593
|
+
return STATES[state](esc(cls), props);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// Responsive variants
|
|
598
|
+
for (var bp in RESPONSIVE) {
|
|
599
|
+
if (cls.startsWith(bp+':')) {
|
|
600
|
+
var inner = cls.slice(bp.length+1);
|
|
601
|
+
var props = baseProps(inner);
|
|
602
|
+
if (!props) return null;
|
|
603
|
+
return RESPONSIVE[bp]+'{.'+esc(cls)+'{'+props+'}}';
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// Base class
|
|
608
|
+
var props = baseProps(cls);
|
|
609
|
+
if (!props) return null;
|
|
610
|
+
return '.'+esc(cls)+'{'+props+'}';
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// ─── Keyframes (injected once) ────────────────────────────────────────────
|
|
614
|
+
var KEYFRAMES =
|
|
615
|
+
// Core
|
|
616
|
+
'@keyframes santy-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}'+
|
|
617
|
+
'@keyframes santy-ping{75%,100%{transform:scale(2);opacity:0}}'+
|
|
618
|
+
'@keyframes santy-pulse{0%,100%{opacity:1}50%{opacity:.5}}'+
|
|
619
|
+
'@keyframes santy-bounce{0%,100%{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0,0,.2,1)}}'+
|
|
620
|
+
'@keyframes santy-skeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}'+
|
|
621
|
+
// Attention seekers
|
|
622
|
+
'@keyframes santy-flash{from,50%,to{opacity:1}25%,75%{opacity:0}}'+
|
|
623
|
+
'@keyframes santy-rubber-band{from{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}to{transform:scale3d(1,1,1)}}'+
|
|
624
|
+
'@keyframes santy-shake-x{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-10px,0,0)}20%,40%,60%,80%{transform:translate3d(10px,0,0)}}'+
|
|
625
|
+
'@keyframes santy-shake-y{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(0,-10px,0)}20%,40%,60%,80%{transform:translate3d(0,10px,0)}}'+
|
|
626
|
+
'@keyframes santy-shake-head{0%{transform:rotateY(0)}6.5%{transform:rotateY(-9deg)}18.5%{transform:rotateY(7deg)}31.5%{transform:rotateY(-5deg)}43.5%{transform:rotateY(3deg)}50%{transform:rotateY(0)}}'+
|
|
627
|
+
'@keyframes santy-swing{20%{transform:rotate3d(0,0,1,15deg)}40%{transform:rotate3d(0,0,1,-10deg)}60%{transform:rotate3d(0,0,1,5deg)}80%{transform:rotate3d(0,0,1,-5deg)}to{transform:rotate3d(0,0,1,0deg)}}'+
|
|
628
|
+
'@keyframes santy-tada{from{transform:scale3d(1,1,1)}10%,20%{transform:scale3d(.9,.9,.9) rotate3d(0,0,1,-3deg)}30%,50%,70%,90%{transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,3deg)}40%,60%,80%{transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,-3deg)}to{transform:scale3d(1,1,1)}}'+
|
|
629
|
+
'@keyframes santy-wobble{from{transform:translate3d(0,0,0)}15%{transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg)}30%{transform:translate3d(20%,0,0) rotate3d(0,0,1,3deg)}45%{transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg)}60%{transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg)}75%{transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg)}to{transform:translate3d(0,0,0)}}'+
|
|
630
|
+
'@keyframes santy-jelly{from,11.1%,to{transform:translate3d(0,0,0)}22.2%{transform:skewX(-12.5deg) skewY(-12.5deg)}33.3%{transform:skewX(6.25deg) skewY(6.25deg)}44.4%{transform:skewX(-3.125deg) skewY(-3.125deg)}55.5%{transform:skewX(1.5625deg) skewY(1.5625deg)}66.6%{transform:skewX(-.78125deg) skewY(-.78125deg)}77.7%{transform:skewX(.390625deg) skewY(.390625deg)}88.8%{transform:skewX(-.1953125deg) skewY(-.1953125deg)}}'+
|
|
631
|
+
'@keyframes santy-heartbeat{from{transform:scale(1);animation-timing-function:ease-out}10%{transform:scale(1.12);animation-timing-function:ease-in}17%{transform:scale(1.08);animation-timing-function:ease-out}33%{transform:scale(1.18);animation-timing-function:ease-in}45%{transform:scale(1);animation-timing-function:ease-out}}'+
|
|
632
|
+
// Fade in
|
|
633
|
+
'@keyframes santy-fade-in{from{opacity:0}to{opacity:1}}'+
|
|
634
|
+
'@keyframes santy-fade-in-from-top{from{opacity:0;transform:translate3d(0,-30px,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
635
|
+
'@keyframes santy-fade-in-from-bottom{from{opacity:0;transform:translate3d(0,30px,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
636
|
+
'@keyframes santy-fade-in-from-left{from{opacity:0;transform:translate3d(-30px,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
637
|
+
'@keyframes santy-fade-in-from-right{from{opacity:0;transform:translate3d(30px,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
638
|
+
'@keyframes santy-fade-in-top-left{from{opacity:0;transform:translate3d(-30px,-30px,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
639
|
+
'@keyframes santy-fade-in-top-right{from{opacity:0;transform:translate3d(30px,-30px,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
640
|
+
'@keyframes santy-fade-in-bottom-left{from{opacity:0;transform:translate3d(-30px,30px,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
641
|
+
'@keyframes santy-fade-in-bottom-right{from{opacity:0;transform:translate3d(30px,30px,0)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
642
|
+
// Fade out
|
|
643
|
+
'@keyframes santy-fade-out{from{opacity:1}to{opacity:0}}'+
|
|
644
|
+
'@keyframes santy-fade-out-to-top{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(0,-30px,0)}}'+
|
|
645
|
+
'@keyframes santy-fade-out-to-bottom{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(0,30px,0)}}'+
|
|
646
|
+
'@keyframes santy-fade-out-to-left{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(-30px,0,0)}}'+
|
|
647
|
+
'@keyframes santy-fade-out-to-right{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(30px,0,0)}}'+
|
|
648
|
+
'@keyframes santy-fade-out-top-left{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(-30px,-30px,0)}}'+
|
|
649
|
+
'@keyframes santy-fade-out-top-right{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(30px,-30px,0)}}'+
|
|
650
|
+
'@keyframes santy-fade-out-bottom-left{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(-30px,30px,0)}}'+
|
|
651
|
+
'@keyframes santy-fade-out-bottom-right{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(30px,30px,0)}}'+
|
|
652
|
+
// Bounce in
|
|
653
|
+
'@keyframes santy-bounce-in{from,20%,40%,60%,80%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}'+
|
|
654
|
+
'@keyframes santy-bounce-in-from-top{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0) scaleY(3)}60%{opacity:1;transform:translate3d(0,25px,0) scaleY(.9)}75%{transform:translate3d(0,-10px,0) scaleY(.95)}90%{transform:translate3d(0,5px,0) scaleY(.985)}to{transform:translate3d(0,0,0)}}'+
|
|
655
|
+
'@keyframes santy-bounce-in-from-bottom{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0) scaleY(5)}60%{opacity:1;transform:translate3d(0,-20px,0) scaleY(.9)}75%{transform:translate3d(0,10px,0) scaleY(.95)}90%{transform:translate3d(0,-5px,0) scaleY(.985)}to{transform:translate3d(0,0,0)}}'+
|
|
656
|
+
'@keyframes santy-bounce-in-from-left{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0) scaleX(3)}60%{opacity:1;transform:translate3d(25px,0,0) scaleX(1)}75%{transform:translate3d(-10px,0,0) scaleX(.98)}90%{transform:translate3d(5px,0,0) scaleX(.995)}to{transform:translate3d(0,0,0)}}'+
|
|
657
|
+
'@keyframes santy-bounce-in-from-right{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0) scaleX(3)}60%{opacity:1;transform:translate3d(-25px,0,0) scaleX(1)}75%{transform:translate3d(10px,0,0) scaleX(.98)}90%{transform:translate3d(-5px,0,0) scaleX(.995)}to{transform:translate3d(0,0,0)}}'+
|
|
658
|
+
// Bounce out
|
|
659
|
+
'@keyframes santy-bounce-out{20%{transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}'+
|
|
660
|
+
'@keyframes santy-bounce-out-to-top{20%{transform:translate3d(0,-10px,0) scaleY(.985)}40%,45%{opacity:1;transform:translate3d(0,20px,0) scaleY(.9)}to{opacity:0;transform:translate3d(0,-2000px,0) scaleY(3)}}'+
|
|
661
|
+
'@keyframes santy-bounce-out-to-bottom{20%{transform:translate3d(0,10px,0) scaleY(.985)}40%,45%{opacity:1;transform:translate3d(0,-20px,0) scaleY(.9)}to{opacity:0;transform:translate3d(0,2000px,0) scaleY(5)}}'+
|
|
662
|
+
'@keyframes santy-bounce-out-to-left{20%{opacity:1;transform:translate3d(20px,0,0) scaleX(.9)}to{opacity:0;transform:translate3d(-2000px,0,0) scaleX(2)}}'+
|
|
663
|
+
'@keyframes santy-bounce-out-to-right{20%{opacity:1;transform:translate3d(-20px,0,0) scaleX(.9)}to{opacity:0;transform:translate3d(2000px,0,0) scaleX(2)}}'+
|
|
664
|
+
// Slide in / out
|
|
665
|
+
'@keyframes santy-slide-in-from-top{from{visibility:visible;transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}'+
|
|
666
|
+
'@keyframes santy-slide-in-from-bottom{from{visibility:visible;transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}'+
|
|
667
|
+
'@keyframes santy-slide-in-from-left{from{visibility:visible;transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}'+
|
|
668
|
+
'@keyframes santy-slide-in-from-right{from{visibility:visible;transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}'+
|
|
669
|
+
'@keyframes santy-slide-out-to-top{from{transform:translate3d(0,0,0)}to{visibility:hidden;transform:translate3d(0,-100%,0)}}'+
|
|
670
|
+
'@keyframes santy-slide-out-to-bottom{from{transform:translate3d(0,0,0)}to{visibility:hidden;transform:translate3d(0,100%,0)}}'+
|
|
671
|
+
'@keyframes santy-slide-out-to-left{from{transform:translate3d(0,0,0)}to{visibility:hidden;transform:translate3d(-100%,0,0)}}'+
|
|
672
|
+
'@keyframes santy-slide-out-to-right{from{transform:translate3d(0,0,0)}to{visibility:hidden;transform:translate3d(100%,0,0)}}'+
|
|
673
|
+
// Zoom in / out
|
|
674
|
+
'@keyframes santy-zoom-in{from{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}'+
|
|
675
|
+
'@keyframes santy-zoom-in-from-top{from{opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}'+
|
|
676
|
+
'@keyframes santy-zoom-in-from-bottom{from{opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}'+
|
|
677
|
+
'@keyframes santy-zoom-in-from-left{from{opacity:0;transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(10px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}'+
|
|
678
|
+
'@keyframes santy-zoom-in-from-right{from{opacity:0;transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}'+
|
|
679
|
+
'@keyframes santy-zoom-out{from{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}'+
|
|
680
|
+
'@keyframes santy-zoom-out-to-top{40%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}to{opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}}'+
|
|
681
|
+
'@keyframes santy-zoom-out-to-bottom{40%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}to{opacity:0;transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}}'+
|
|
682
|
+
'@keyframes santy-zoom-out-to-left{40%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(42px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}to{opacity:0;transform:scale3d(.1,.1,.1) translate3d(-2000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}}'+
|
|
683
|
+
'@keyframes santy-zoom-out-to-right{40%{opacity:1;transform:scale3d(.475,.475,.475) translate3d(-42px,0,0);animation-timing-function:cubic-bezier(.175,.885,.32,1)}to{opacity:0;transform:scale3d(.1,.1,.1) translate3d(2000px,0,0);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}}'+
|
|
684
|
+
// Flip
|
|
685
|
+
'@keyframes santy-flip{from{transform:perspective(400px) scale3d(1,1,1) rotate3d(0,1,0,-360deg);animation-timing-function:ease-out}40%{transform:perspective(400px) scale3d(1,1,.5) translate3d(0,0,150px) rotate3d(0,1,0,-190deg);animation-timing-function:ease-out}50%{transform:perspective(400px) scale3d(1,1,.5) translate3d(0,0,150px) rotate3d(0,1,0,-170deg);animation-timing-function:ease-in}80%{transform:perspective(400px) scale3d(.95,1,1) rotate3d(0,1,0,0deg);animation-timing-function:ease-in}to{transform:perspective(400px) scale3d(1,1,1) rotate3d(0,1,0,0deg);animation-timing-function:ease-in}}'+
|
|
686
|
+
'@keyframes santy-flip-in-x{from{transform:perspective(400px) rotate3d(1,0,0,90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotate3d(1,0,0,-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{transform:perspective(400px) rotate3d(1,0,0,-5deg)}to{transform:perspective(400px)}}'+
|
|
687
|
+
'@keyframes santy-flip-in-y{from{transform:perspective(400px) rotate3d(0,1,0,90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotate3d(0,1,0,-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}80%{transform:perspective(400px) rotate3d(0,1,0,-5deg)}to{transform:perspective(400px)}}'+
|
|
688
|
+
'@keyframes santy-flip-out-x{from{transform:perspective(400px)}30%{transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}to{transform:perspective(400px) rotate3d(1,0,0,90deg);opacity:0}}'+
|
|
689
|
+
'@keyframes santy-flip-out-y{from{transform:perspective(400px)}30%{transform:perspective(400px) rotate3d(0,1,0,-15deg);opacity:1}to{transform:perspective(400px) rotate3d(0,1,0,90deg);opacity:0}}'+
|
|
690
|
+
// Rotate in / out
|
|
691
|
+
'@keyframes santy-rotate-in{from{transform:rotate3d(0,0,1,-200deg);opacity:0}to{transform:translate3d(0,0,0);opacity:1}}'+
|
|
692
|
+
'@keyframes santy-rotate-in-from-top-left{from{transform:rotate3d(0,0,1,-45deg);opacity:0}to{transform:translate3d(0,0,0);opacity:1}}'+
|
|
693
|
+
'@keyframes santy-rotate-in-from-top-right{from{transform:rotate3d(0,0,1,45deg);opacity:0}to{transform:translate3d(0,0,0);opacity:1}}'+
|
|
694
|
+
'@keyframes santy-rotate-in-from-bottom-left{from{transform:rotate3d(0,0,1,45deg);opacity:0}to{transform:translate3d(0,0,0);opacity:1}}'+
|
|
695
|
+
'@keyframes santy-rotate-in-from-bottom-right{from{transform:rotate3d(0,0,1,-90deg);opacity:0}to{transform:translate3d(0,0,0);opacity:1}}'+
|
|
696
|
+
'@keyframes santy-rotate-out{from{opacity:1}to{transform:rotate3d(0,0,1,200deg);opacity:0}}'+
|
|
697
|
+
'@keyframes santy-rotate-out-to-top-left{from{opacity:1}to{transform:rotate3d(0,0,1,-45deg);opacity:0}}'+
|
|
698
|
+
'@keyframes santy-rotate-out-to-top-right{from{opacity:1}to{transform:rotate3d(0,0,1,90deg);opacity:0}}'+
|
|
699
|
+
'@keyframes santy-rotate-out-to-bottom-left{from{opacity:1}to{transform:rotate3d(0,0,1,45deg);opacity:0}}'+
|
|
700
|
+
'@keyframes santy-rotate-out-to-bottom-right{from{opacity:1}to{transform:rotate3d(0,0,1,-45deg);opacity:0}}'+
|
|
701
|
+
// Back in / out
|
|
702
|
+
'@keyframes santy-back-in-from-top{0%{transform:translateY(-1200px) scale(.7);opacity:.7}80%{transform:translateY(0) scale(.7);opacity:.7}100%{transform:scale(1);opacity:1}}'+
|
|
703
|
+
'@keyframes santy-back-in-from-bottom{0%{transform:translateY(1200px) scale(.7);opacity:.7}80%{transform:translateY(0) scale(.7);opacity:.7}100%{transform:scale(1);opacity:1}}'+
|
|
704
|
+
'@keyframes santy-back-in-from-left{0%{transform:translateX(-2000px) scale(.7);opacity:.7}80%{transform:translateX(0) scale(.7);opacity:.7}100%{transform:scale(1);opacity:1}}'+
|
|
705
|
+
'@keyframes santy-back-in-from-right{0%{transform:translateX(2000px) scale(.7);opacity:.7}80%{transform:translateX(0) scale(.7);opacity:.7}100%{transform:scale(1);opacity:1}}'+
|
|
706
|
+
'@keyframes santy-back-out-to-top{0%{transform:scale(1);opacity:1}20%{transform:translateY(0) scale(.7);opacity:.7}100%{transform:translateY(-700px) scale(.7);opacity:.7}}'+
|
|
707
|
+
'@keyframes santy-back-out-to-bottom{0%{transform:scale(1);opacity:1}20%{transform:translateY(0) scale(.7);opacity:.7}100%{transform:translateY(700px) scale(.7);opacity:.7}}'+
|
|
708
|
+
'@keyframes santy-back-out-to-left{0%{transform:scale(1);opacity:1}20%{transform:translateX(0) scale(.7);opacity:.7}100%{transform:translateX(-2000px) scale(.7);opacity:.7}}'+
|
|
709
|
+
'@keyframes santy-back-out-to-right{0%{transform:scale(1);opacity:1}20%{transform:translateX(0) scale(.7);opacity:.7}100%{transform:translateX(2000px) scale(.7);opacity:.7}}'+
|
|
710
|
+
// Light speed
|
|
711
|
+
'@keyframes santy-speed-in-from-left{from{transform:translate3d(-100%,0,0) skewX(30deg);opacity:0}60%{transform:skewX(-20deg);opacity:1}80%{transform:skewX(5deg)}to{transform:translate3d(0,0,0)}}'+
|
|
712
|
+
'@keyframes santy-speed-in-from-right{from{transform:translate3d(100%,0,0) skewX(-30deg);opacity:0}60%{transform:skewX(20deg);opacity:1}80%{transform:skewX(-5deg)}to{transform:translate3d(0,0,0)}}'+
|
|
713
|
+
'@keyframes santy-speed-out-to-left{from{opacity:1}to{transform:translate3d(-100%,0,0) skewX(-30deg);opacity:0}}'+
|
|
714
|
+
'@keyframes santy-speed-out-to-right{from{opacity:1}to{transform:translate3d(100%,0,0) skewX(30deg);opacity:0}}'+
|
|
715
|
+
// Specials
|
|
716
|
+
'@keyframes santy-hinge{0%{animation-timing-function:ease-in-out}20%,60%{transform:rotate3d(0,0,1,80deg);animation-timing-function:ease-in-out}40%,80%{transform:rotate3d(0,0,1,60deg);animation-timing-function:ease-in-out;opacity:1}to{transform:translate3d(0,700px,0);opacity:0}}'+
|
|
717
|
+
'@keyframes santy-jack-in-box{from{opacity:0;transform:scale(.1) rotate(30deg)}50%{transform:rotate(-10deg)}70%{transform:rotate(3deg)}to{opacity:1;transform:scale(1)}}'+
|
|
718
|
+
'@keyframes santy-roll-in{from{opacity:0;transform:translate3d(-100%,0,0) rotate3d(0,0,1,-120deg)}to{opacity:1;transform:translate3d(0,0,0)}}'+
|
|
719
|
+
'@keyframes santy-roll-out{from{opacity:1}to{opacity:0;transform:translate3d(100%,0,0) rotate3d(0,0,1,120deg)}}';
|
|
720
|
+
|
|
721
|
+
// ─── Base component styles (small — only rendered once) ───────────────────
|
|
722
|
+
var BASE_CSS = '*,*::before,*::after{box-sizing:border-box}'+
|
|
723
|
+
':root{--santy-font-sans:ui-sans-serif,system-ui,-apple-system,sans-serif;--santy-font-mono:ui-monospace,monospace}'+
|
|
724
|
+
'.container{width:100%;margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px}'+
|
|
725
|
+
'@media(min-width:640px){.container{max-width:640px}}'+
|
|
726
|
+
'@media(min-width:768px){.container{max-width:768px}}'+
|
|
727
|
+
'@media(min-width:1024px){.container{max-width:1024px}}'+
|
|
728
|
+
'@media(min-width:1280px){.container{max-width:1280px}}'+
|
|
729
|
+
'@media(min-width:1536px){.container{max-width:1536px}}'+
|
|
730
|
+
'.btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 20px;font-size:14px;font-weight:600;border-radius:8px;border:none;cursor:pointer;transition:all .15s ease;text-decoration:none;line-height:1.5;white-space:nowrap}'+
|
|
731
|
+
'.btn:disabled{opacity:.5;cursor:not-allowed}'+
|
|
732
|
+
'.btn-sm{padding:4px 12px;font-size:12px;border-radius:6px}'+
|
|
733
|
+
'.btn-lg{padding:12px 28px;font-size:16px;border-radius:10px}'+
|
|
734
|
+
'.btn-xl{padding:16px 36px;font-size:18px;border-radius:12px}'+
|
|
735
|
+
'.btn-primary{background-color:#3b82f6;color:#fff}.btn-primary:hover{background-color:#2563eb}'+
|
|
736
|
+
'.btn-secondary{background-color:#6b7280;color:#fff}.btn-secondary:hover{background-color:#4b5563}'+
|
|
737
|
+
'.btn-success{background-color:#22c55e;color:#fff}.btn-success:hover{background-color:#16a34a}'+
|
|
738
|
+
'.btn-danger{background-color:#ef4444;color:#fff}.btn-danger:hover{background-color:#dc2626}'+
|
|
739
|
+
'.btn-warning{background-color:#f59e0b;color:#fff}.btn-warning:hover{background-color:#d97706}'+
|
|
740
|
+
'.btn-outline{background-color:transparent;border:2px solid currentColor}'+
|
|
741
|
+
'.btn-ghost{background-color:transparent}.btn-ghost:hover{background-color:rgba(0,0,0,.05)}'+
|
|
742
|
+
'.btn-full{width:100%}'+
|
|
743
|
+
'.card{background-color:#fff;border-radius:12px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);overflow:hidden}'+
|
|
744
|
+
'.card-body{padding:24px}.card-header{padding:16px 24px;border-bottom:1px solid #e5e7eb}.card-footer{padding:16px 24px;border-top:1px solid #e5e7eb}'+
|
|
745
|
+
'.badge{display:inline-flex;align-items:center;padding:2px 10px;font-size:12px;font-weight:600;border-radius:9999px;line-height:1.5}'+
|
|
746
|
+
'.alert{padding:12px 16px;border-radius:8px;border-left:4px solid currentColor;margin-bottom:16px}'+
|
|
747
|
+
'.alert-info{background-color:#eff6ff;color:#1d4ed8}.alert-success{background-color:#f0fdf4;color:#15803d}'+
|
|
748
|
+
'.alert-warning{background-color:#fffbeb;color:#b45309}.alert-danger{background-color:#fef2f2;color:#b91c1c}'+
|
|
749
|
+
'.input{display:block;width:100%;padding:8px 12px;font-size:14px;border:1px solid #d1d5db;border-radius:6px;background-color:#fff;transition:border-color .15s ease,box-shadow .15s ease;outline:none}'+
|
|
750
|
+
'.input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.2)}'+
|
|
751
|
+
'.input-error{border-color:#ef4444}.input-error:focus{box-shadow:0 0 0 3px rgba(239,68,68,.2)}'+
|
|
752
|
+
'.input-lg{padding:12px 16px;font-size:16px;border-radius:8px}.input-sm{padding:4px 8px;font-size:12px}'+
|
|
753
|
+
'.divider{border:none;border-top:1px solid #e5e7eb;margin:16px 0}'+
|
|
754
|
+
'.avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;flex-shrink:0}'+
|
|
755
|
+
'.avatar-sm{width:32px;height:32px}.avatar-md{width:40px;height:40px}.avatar-lg{width:56px;height:56px}.avatar-xl{width:80px;height:80px}'+
|
|
756
|
+
'.spinner{border:3px solid rgba(0,0,0,.1);border-top-color:#3b82f6;border-radius:50%;animation:santy-spin .7s linear infinite}'+
|
|
757
|
+
'.spinner-sm{width:16px;height:16px}.spinner-md{width:24px;height:24px}.spinner-lg{width:40px;height:40px}.spinner-xl{width:56px;height:56px}'+
|
|
758
|
+
'.skeleton{background:linear-gradient(90deg,#f3f4f6 25%,#e5e7eb 50%,#f3f4f6 75%);background-size:200% 100%;animation:santy-skeleton 1.5s ease-in-out infinite;border-radius:4px}'+
|
|
759
|
+
'.progress{width:100%;height:8px;background-color:#e5e7eb;border-radius:9999px;overflow:hidden}'+
|
|
760
|
+
'.progress-bar{height:100%;background-color:#3b82f6;border-radius:9999px;transition:width .3s ease}';
|
|
761
|
+
|
|
762
|
+
// ─── Setup style element ──────────────────────────────────────────────────
|
|
763
|
+
var cfg = (root.SantyJIT) || {};
|
|
764
|
+
var sheet = document.createElement('style');
|
|
765
|
+
sheet.id = 'santy-jit';
|
|
766
|
+
if (cfg.nonce) sheet.setAttribute('nonce', cfg.nonce);
|
|
767
|
+
document.head.appendChild(sheet);
|
|
768
|
+
|
|
769
|
+
// Write base styles + keyframes once
|
|
770
|
+
sheet.textContent = BASE_CSS + KEYFRAMES;
|
|
771
|
+
|
|
772
|
+
var generated = {}; // cls → true
|
|
773
|
+
|
|
774
|
+
function inject(cls) {
|
|
775
|
+
if (generated[cls]) return;
|
|
776
|
+
generated[cls] = true;
|
|
777
|
+
var rule = generateRule(cls);
|
|
778
|
+
if (rule) sheet.textContent += rule;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function processElement(el) {
|
|
782
|
+
if (!el || !el.classList) return;
|
|
783
|
+
for (var i = 0; i < el.classList.length; i++) {
|
|
784
|
+
inject(el.classList[i]);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
function scan(root) {
|
|
789
|
+
processElement(root);
|
|
790
|
+
var els = root.querySelectorAll ? root.querySelectorAll('[class]') : [];
|
|
791
|
+
for (var i = 0; i < els.length; i++) processElement(els[i]);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// ─── Initial scan ─────────────────────────────────────────────────────────
|
|
795
|
+
if (document.body) {
|
|
796
|
+
scan(document.body);
|
|
797
|
+
} else {
|
|
798
|
+
document.addEventListener('DOMContentLoaded', function(){ scan(document.body); });
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// Safelist
|
|
802
|
+
if (cfg.safelist) {
|
|
803
|
+
cfg.safelist.forEach(function(cls){ inject(cls); });
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// ─── MutationObserver — watch for class changes ───────────────────────────
|
|
807
|
+
var observer = new MutationObserver(function(mutations) {
|
|
808
|
+
for (var i = 0; i < mutations.length; i++) {
|
|
809
|
+
var m = mutations[i];
|
|
810
|
+
if (m.type === 'attributes' && m.attributeName === 'class') {
|
|
811
|
+
processElement(m.target);
|
|
812
|
+
} else if (m.type === 'childList') {
|
|
813
|
+
for (var j = 0; j < m.addedNodes.length; j++) {
|
|
814
|
+
var node = m.addedNodes[j];
|
|
815
|
+
if (node.nodeType === 1) scan(node);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
if (document.body) {
|
|
822
|
+
observer.observe(document.body, { childList:true, subtree:true, attributes:true, attributeFilter:['class'] });
|
|
823
|
+
} else {
|
|
824
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
825
|
+
observer.observe(document.body, { childList:true, subtree:true, attributes:true, attributeFilter:['class'] });
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// ─── Public API ───────────────────────────────────────────────────────────
|
|
830
|
+
root.SantyJIT = root.SantyJIT || {};
|
|
831
|
+
root.SantyJIT.inject = inject;
|
|
832
|
+
root.SantyJIT.scan = scan;
|
|
833
|
+
root.SantyJIT.getCSS = function(){ return sheet.textContent; };
|
|
834
|
+
root.SantyJIT.stats = function(){
|
|
835
|
+
return {
|
|
836
|
+
generated: Object.keys(generated).length,
|
|
837
|
+
bytes: sheet.textContent.length,
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
}(window));
|