santycss 1.1.0 → 1.2.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 +381 -1
- package/dist/santy-animations.css +829 -519
- package/dist/santy-components.css +220 -0
- package/dist/santy.css +13068 -12538
- package/dist/santy.min.css +1 -1
- package/lib/animations.js +318 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,381 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SantyCSS
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/santycss)
|
|
4
|
+
[](https://www.npmjs.com/package/santycss)
|
|
5
|
+
[](https://github.com/ChintuSanty/santyCSS/blob/main/LICENSE)
|
|
6
|
+
[](https://www.npmjs.com/package/santycss)
|
|
7
|
+
|
|
8
|
+
**Plain-English utility-first CSS framework.**
|
|
9
|
+
Class names read like sentences. No build step. No configuration. Just link and use.
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<div class="make-flex align-center gap-16 background-blue-500 round-corners-12 add-padding-24">
|
|
13
|
+
<button class="make-button style-primary size-large shape-pill on-hover:animate-bounce">
|
|
14
|
+
Get Started
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> 🌐 **[santycss.santy.in](https://santycss.santy.in)** · 📖 **[Class Reference](https://santycss.santy.in/classes.html)** · 🎬 **[Animations](https://santycss.santy.in/animations.html)** · 📦 **[npm Docs](https://santycss.santy.in/docs.html)**
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## What's New in v1.2
|
|
24
|
+
|
|
25
|
+
### 🎬 120+ Animations (was 70+)
|
|
26
|
+
|
|
27
|
+
**Scroll-Triggered** — elements animate when they enter the viewport:
|
|
28
|
+
```html
|
|
29
|
+
<div class="animate-on-scroll-slide-up scroll-reveal-delay-200">Reveals on scroll</div>
|
|
30
|
+
<!-- Add IntersectionObserver once in your JS -->
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Hover-Triggered** — full animations on mouse-over, not just transforms:
|
|
34
|
+
```html
|
|
35
|
+
<button class="make-button style-primary on-hover:animate-rubber-band">Hover me</button>
|
|
36
|
+
<div class="animate-text-gradient-flow set-text-32 text-bold">Gradient Flow</div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Text Animations:**
|
|
40
|
+
```html
|
|
41
|
+
<h1 class="animate-typewriter">Hello, World!</h1>
|
|
42
|
+
<h2 class="animate-text-glitch">Glitch</h2>
|
|
43
|
+
<p class="animate-text-neon-pulse color-blue-400">Neon Pulse</p>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Staggered Entrances** — children animate in sequence:
|
|
47
|
+
```html
|
|
48
|
+
<ul class="animate-stagger-slide-up animate-stagger-children-100">
|
|
49
|
+
<li>Item 1</li> <!-- 0ms delay -->
|
|
50
|
+
<li>Item 2</li> <!-- 100ms delay -->
|
|
51
|
+
<li>Item 3</li> <!-- 200ms delay -->
|
|
52
|
+
</ul>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**3D Animations:**
|
|
56
|
+
```html
|
|
57
|
+
<div class="animate-flip-3d-y">Card flip</div>
|
|
58
|
+
<div class="animate-morph-blob" style="width:80px;height:80px;background:#6366f1;"></div>
|
|
59
|
+
<div class="animate-border-spin">Spinning border</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**UI Feedback Animations** — paired with components:
|
|
63
|
+
```html
|
|
64
|
+
<div class="animate-toast-in">Toast notification</div>
|
|
65
|
+
<div class="animate-modal-in">Modal dialog</div>
|
|
66
|
+
<div class="animate-error-shake">Form error</div>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**New helper classes:**
|
|
70
|
+
```
|
|
71
|
+
animation-ease-bounce animation-ease-elastic animation-ease-spring
|
|
72
|
+
animation-direction-reverse animation-direction-alternate
|
|
73
|
+
animation-pause-on-hover animation-delay-750 animation-delay-1500
|
|
74
|
+
animation-delay-2500 animation-speed-ultra-fast
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### 🧩 Component Variant System (`make-*`)
|
|
80
|
+
|
|
81
|
+
Replaces the old `btn btn-primary` pattern with a composable modifier system:
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<!-- Old way -->
|
|
85
|
+
<button class="btn btn-success btn-lg">Old</button>
|
|
86
|
+
|
|
87
|
+
<!-- New way -->
|
|
88
|
+
<button class="make-button style-success size-large shape-pill">New</button>
|
|
89
|
+
<button class="make-button style-danger size-small shape-rounded">Delete</button>
|
|
90
|
+
<div class="make-card style-elevated">
|
|
91
|
+
<div class="card-body">...</div>
|
|
92
|
+
</div>
|
|
93
|
+
<span class="make-badge style-success">Active</span>
|
|
94
|
+
<div class="make-alert style-warning">Watch out</div>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**All components:** `make-button` · `make-card` · `make-badge` · `make-alert` · `make-input` · `make-avatar` · `make-spinner` · `make-skeleton` · `make-progress` · `make-navbar` · `make-tooltip` · `make-modal` · `make-drawer` · `make-accordion` · `make-dropdown`
|
|
98
|
+
|
|
99
|
+
**Style modifiers:** `style-primary` · `style-secondary` · `style-success` · `style-danger` · `style-warning` · `style-info` · `style-outline` · `style-ghost` · `style-dark` · `style-flat` · `style-elevated` · `style-bordered`
|
|
100
|
+
|
|
101
|
+
**Size modifiers:** `size-small` · `size-large` · `size-xl` · `size-full`
|
|
102
|
+
|
|
103
|
+
**Shape modifiers:** `shape-pill` · `shape-rounded` · `shape-square`
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### 🌐 20 Modern CSS Utility Groups
|
|
108
|
+
|
|
109
|
+
| Group | Classes |
|
|
110
|
+
|---|---|
|
|
111
|
+
| Container Queries | `container-query`, `cq-sm:make-flex`, `cq-md:grid-cols-3` |
|
|
112
|
+
| Scroll & Snap | `scroll-smooth`, `scroll-snap-x`, `scroll-snap-center`, `overscroll-contain` |
|
|
113
|
+
| Logical Properties | `add-padding-inline-{n}`, `ps-{n}`, `pe-{n}`, `ms-auto`, `text-start`, `text-end` |
|
|
114
|
+
| Fluid Typography | `text-fluid-sm` through `text-fluid-hero` (CSS `clamp()`) |
|
|
115
|
+
| Clip Path | `clip-circle`, `clip-hexagon`, `clip-diamond`, `clip-star`, `clip-arrow-right` |
|
|
116
|
+
| Gradients | `gradient-radial-from-center`, `gradient-conic`, `text-gradient-blue-to-purple` |
|
|
117
|
+
| Advanced Grid | `grid-auto-fit-min-200`, `masonry-cols-3`, `grid-area-header/sidebar/main/footer` |
|
|
118
|
+
| Advanced Typography | `text-balance`, `text-pretty`, `text-clamp-1/2/3`, `drop-cap`, `font-tabular-nums` |
|
|
119
|
+
| Cursor Utilities | 30 cursor types including `cursor-cell`, `cursor-copy`, `cursor-resize-ns` |
|
|
120
|
+
| Dynamic Viewport | `set-height-dvh`, `set-height-svh`, `set-height-lvh`, `set-min-height-dvh` |
|
|
121
|
+
| Color Mix / Opacity | `background-blue-500/50`, `background-white/75`, `background-mix-blue-red-50` |
|
|
122
|
+
| Semantic Z-index | `z-modal: 400`, `z-tooltip: 600`, `z-toast: 700`, `isolate` |
|
|
123
|
+
| View Transitions | `view-transition-fade`, `view-transition-slide` (View Transitions API) |
|
|
124
|
+
| Size Utilities | `set-size-16` through `set-size-200`, `set-size-full/screen/fit` |
|
|
125
|
+
| Print Utilities | `print-hidden`, `print-only`, `print-break-before`, `print-show-links` |
|
|
126
|
+
| Subgrid | `grid-cols-subgrid`, `span-col-subgrid-3` |
|
|
127
|
+
| Math / Calc | `set-width-calc-100-minus-64`, `set-height-calc-screen-minus-80`, `set-max-width-readable` |
|
|
128
|
+
| Pointer / Touch | `touch-none`, `touch-pan-x`, `touch-manipulation`, `will-change-transform` |
|
|
129
|
+
| @layer | `@layer santy-base, santy-utilities, santy-components, santy-overrides` |
|
|
130
|
+
| 3D Transform | `perspective-*`, `rotate-3d`, `transform-origin-*` (extended) |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
### 🤖 Built for the AI Era
|
|
135
|
+
|
|
136
|
+
SantyCSS ships a **context file** (`santycss.context.md`) — paste it into Claude, GPT-4, or Cursor's system prompt and the AI generates SantyCSS instead of Tailwind, every time:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
Paste santycss.context.md → AI writes SantyCSS instead of Tailwind
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The **built-in AI Generator** converts plain English → SantyCSS classes in the browser (no API key):
|
|
143
|
+
|
|
144
|
+
> "a centered flex container with green background and white text and gap"
|
|
145
|
+
> → `make-flex align-center justify-center background-green-500 color-white gap-16`
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Installation
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npm install santycss
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**CDN (fastest — zero install):**
|
|
156
|
+
```html
|
|
157
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/santycss/dist/santy.css">
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Import in JS/TS (React, Vue, Next, Nuxt, Vite):**
|
|
161
|
+
```js
|
|
162
|
+
import 'santycss/css'; // full bundle
|
|
163
|
+
import 'santycss/css/core'; // utilities only
|
|
164
|
+
import 'santycss/css/components'; // component shortcuts
|
|
165
|
+
import 'santycss/css/animations'; // animations only
|
|
166
|
+
import 'santycss/css/email'; // email-safe CSS
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**PostCSS:**
|
|
170
|
+
```js
|
|
171
|
+
// postcss.config.js
|
|
172
|
+
module.exports = {
|
|
173
|
+
plugins: [require('santycss/postcss')]
|
|
174
|
+
};
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Vite plugin:**
|
|
178
|
+
```js
|
|
179
|
+
// vite.config.js
|
|
180
|
+
import santyCSS from 'santycss/vite';
|
|
181
|
+
export default { plugins: [santyCSS()] };
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Core Naming Conventions
|
|
187
|
+
|
|
188
|
+
| Pattern | Example | Meaning |
|
|
189
|
+
|---|---|---|
|
|
190
|
+
| `add-{prop}-{n}` | `add-padding-24` | Additive — border, padding, margin, shadow |
|
|
191
|
+
| `make-{val}` | `make-flex`, `make-circle` | Display / behaviour |
|
|
192
|
+
| `set-{prop}-{val}` | `set-text-24`, `set-width-320` | Dimension / size setter |
|
|
193
|
+
| `pin-{side}-{n}` | `pin-top-0`, `pin-center` | Absolute / fixed positioning |
|
|
194
|
+
| `on-hover:{class}` | `on-hover:scale-110` | State / responsive prefix |
|
|
195
|
+
| `md:{class}` | `md:grid-cols-3` | Responsive breakpoint |
|
|
196
|
+
| `make-button style-* size-* shape-*` | `make-button style-success size-large shape-pill` | Component variant system |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Quick Examples
|
|
201
|
+
|
|
202
|
+
**Responsive hero:**
|
|
203
|
+
```html
|
|
204
|
+
<section class="make-flex flex-column align-center justify-center text-center add-padding-y-80 background-gray-50">
|
|
205
|
+
<h1 class="set-text-56 text-bold color-gray-900 add-margin-bottom-16 md:set-text-40 on-mobile:set-text-32">
|
|
206
|
+
Build faster
|
|
207
|
+
</h1>
|
|
208
|
+
<p class="set-text-20 color-gray-500 line-height-relaxed add-margin-bottom-32">
|
|
209
|
+
Plain-English CSS that reads like you wrote it.
|
|
210
|
+
</p>
|
|
211
|
+
<a href="#" class="make-button style-primary size-large shape-pill on-hover:scale-105 transition-all">
|
|
212
|
+
Get started →
|
|
213
|
+
</a>
|
|
214
|
+
</section>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Card with hover effect:**
|
|
218
|
+
```html
|
|
219
|
+
<div class="make-card style-bordered add-border-left-4 border-color-blue-500 on-hover:scale-105 transition-all cursor-pointer add-padding-28 add-shadow-md round-corners-16">
|
|
220
|
+
<h3 class="set-text-20 text-bold color-gray-900 add-margin-bottom-8">Card Title</h3>
|
|
221
|
+
<p class="set-text-14 color-gray-500 line-height-relaxed">Card description.</p>
|
|
222
|
+
</div>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Dark-mode card grid:**
|
|
226
|
+
```html
|
|
227
|
+
<div class="make-grid grid-cols-3 gap-24 on-mobile:grid-cols-1 md:grid-cols-2">
|
|
228
|
+
<div class="make-card style-elevated background-white dark:background-gray-800 round-corners-16 add-padding-24">
|
|
229
|
+
<span class="make-badge style-primary add-margin-bottom-12">New</span>
|
|
230
|
+
<h4 class="set-text-18 text-semibold color-gray-900 dark:color-white">Feature</h4>
|
|
231
|
+
<p class="set-text-14 color-gray-500 dark:color-gray-400 line-height-relaxed">Description.</p>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Scroll-triggered stagger:**
|
|
237
|
+
```html
|
|
238
|
+
<div class="make-grid grid-cols-3 gap-24 animate-stagger-slide-up animate-stagger-children-200">
|
|
239
|
+
<div class="make-card style-bordered">Card 1</div>
|
|
240
|
+
<div class="make-card style-bordered">Card 2</div>
|
|
241
|
+
<div class="make-card style-bordered">Card 3</div>
|
|
242
|
+
</div>
|
|
243
|
+
<script>
|
|
244
|
+
new IntersectionObserver(entries => {
|
|
245
|
+
entries.forEach(e => { if(e.isIntersecting) e.target.classList.add('is-visible'); });
|
|
246
|
+
}, { threshold: 0.15 }).observe(
|
|
247
|
+
...document.querySelectorAll('[class*="animate-on-scroll"],[class*="scroll-reveal"]')
|
|
248
|
+
);
|
|
249
|
+
</script>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Spacing & Sizing Reference
|
|
255
|
+
|
|
256
|
+
**Spacing values (n):** 0–50 every 1px · 52–200 every 4px · plus 256, 320, 384, 448, 512, 640, 768, 1024
|
|
257
|
+
|
|
258
|
+
| Category | Classes |
|
|
259
|
+
|---|---|
|
|
260
|
+
| Padding | `add-padding-{n}` · `-top-` · `-bottom-` · `-left-` · `-right-` · `-x-` · `-y-{n}` |
|
|
261
|
+
| Margin | `add-margin-{n}` · `-top-` · `-bottom-` · `-left-` · `-right-` · `-x-` · `-y-{n}` · `-x-auto` |
|
|
262
|
+
| Gap | `gap-{n}` · `gap-x-{n}` · `gap-y-{n}` |
|
|
263
|
+
| Width | `set-width-{n}` · `-full` · `-screen` · `-fit` |
|
|
264
|
+
| Height | `set-height-{n}` · `-full` · `-screen` · `-dvh` · `-svh` · `-lvh` |
|
|
265
|
+
| Text size | `set-text-{n}` (8–144px) |
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Colors
|
|
270
|
+
|
|
271
|
+
20 color families × 10 shades (50–950):
|
|
272
|
+
|
|
273
|
+
`blue` `red` `green` `yellow` `purple` `pink` `orange` `gray` `indigo` `cyan` `teal` `rose` `violet` `emerald` `amber` `lime` `sky` `slate` `zinc` `neutral` `stone`
|
|
274
|
+
|
|
275
|
+
```html
|
|
276
|
+
<p class="color-blue-500">Text</p>
|
|
277
|
+
<div class="background-emerald-100 border-color-emerald-400 add-border-2">Card</div>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Responsive Breakpoints
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
sm:{class} 640px+
|
|
286
|
+
md:{class} 768px+
|
|
287
|
+
lg:{class} 1024px+
|
|
288
|
+
xl:{class} 1280px+
|
|
289
|
+
on-mobile:{class} max 767px
|
|
290
|
+
on-tablet:{class} 768–1023px
|
|
291
|
+
on-desktop:{class} 1024px+
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## CSS Design Tokens
|
|
297
|
+
|
|
298
|
+
Override to brand your entire UI with zero rebuilding:
|
|
299
|
+
|
|
300
|
+
```css
|
|
301
|
+
:root {
|
|
302
|
+
--santy-primary: #3b82f6;
|
|
303
|
+
--santy-secondary: #8b5cf6;
|
|
304
|
+
--santy-accent: #10b981;
|
|
305
|
+
--santy-radius: 0.5rem;
|
|
306
|
+
--santy-font: 'Inter', system-ui, sans-serif;
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Component Classes (Legacy)
|
|
313
|
+
|
|
314
|
+
The original `.btn`, `.card`, `.badge` classes still work and are fully supported:
|
|
315
|
+
|
|
316
|
+
```html
|
|
317
|
+
<button class="btn btn-primary btn-lg">Button</button>
|
|
318
|
+
<div class="card card-body">Card</div>
|
|
319
|
+
<span class="badge badge-success">Active</span>
|
|
320
|
+
<div class="alert alert-warning">Warning</div>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
For new projects, the **Component Variant System** (`make-button style-*`) is recommended.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Files in the Package
|
|
328
|
+
|
|
329
|
+
| File | Size | Contents |
|
|
330
|
+
|---|---|---|
|
|
331
|
+
| `dist/santy.css` | 701KB | Everything — utilities + components + animations |
|
|
332
|
+
| `dist/santy.min.css` | 615KB | Minified full bundle |
|
|
333
|
+
| `dist/santy-core.css` | 597KB | Utilities only (no components) |
|
|
334
|
+
| `dist/santy-components.css` | 52KB | Component shortcuts only |
|
|
335
|
+
| `dist/santy-animations.css` | 53KB | 120+ animations only |
|
|
336
|
+
| `dist/santy-email.css` | 13KB | Email-safe CSS for HTML email |
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Tree-shaking / Purge
|
|
341
|
+
|
|
342
|
+
Keep only the classes you use:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
npx santycss purge --input ./src --output ./dist/santy.purged.css
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Or in Node.js:
|
|
349
|
+
|
|
350
|
+
```js
|
|
351
|
+
const { purge } = require('santycss/purge');
|
|
352
|
+
purge({ input: './src', output: './dist/santy.purged.css' });
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## LLM / AI Integration
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
npm show santycss homepage
|
|
361
|
+
→ https://santycss.santy.in
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
The file `santycss.context.md` (in the GitHub repo) is a ready-made system prompt for LLMs. Paste it into your AI tool of choice and it will generate SantyCSS class names instead of Tailwind utilities.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Links
|
|
369
|
+
|
|
370
|
+
- 🌐 Website: [santycss.santy.in](https://santycss.santy.in)
|
|
371
|
+
- 📖 Class Reference: [santycss.santy.in/classes.html](https://santycss.santy.in/classes.html)
|
|
372
|
+
- 🎬 Animations: [santycss.santy.in/animations.html](https://santycss.santy.in/animations.html)
|
|
373
|
+
- 🎮 Live Demo: [santycss.santy.in/demo.html](https://santycss.santy.in/demo.html)
|
|
374
|
+
- 📦 npm Docs: [santycss.santy.in/docs.html](https://santycss.santy.in/docs.html)
|
|
375
|
+
- 🐛 Issues: [github.com/ChintuSanty/santyCSS/issues](https://github.com/ChintuSanty/santyCSS/issues)
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## License
|
|
380
|
+
|
|
381
|
+
MIT © [Santy](https://github.com/ChintuSanty)
|