forked from Chalarangelo/30-seconds-of-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnippetList.json
658 lines (658 loc) · 19.8 KB
/
snippetList.json
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
{
"data": [
{
"id": "bouncing-loader",
"type": "snippetListing",
"title": "Bouncing loader",
"attributes": {
"text": "Creates a bouncing loader animation.\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "2934b3aa733591f4964a7c8780f3ec7b273e4bd6a38fce6e0da2a5dd2dd9959f"
}
},
{
"id": "box-sizing-reset",
"type": "snippetListing",
"title": "Box-sizing reset",
"attributes": {
"text": "Resets the box-model so that `width`s and `height`s are not affected by their `border`s or `padding`.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "d4e635bb76a083266e08723f25c3db981b39001ea5d513ce65570fe0099eb6b0"
}
},
{
"id": "button-border-animation",
"type": "snippetListing",
"title": "Button border animation",
"attributes": {
"text": "Creates a border animation on hover.\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "ff6401cc784b92a9672e74968719c029de224c29fcfdc3eaeaa764274108f648"
}
},
{
"id": "calc",
"type": "snippetListing",
"title": "Calc()",
"attributes": {
"text": "The function calc() allows to define CSS values with the use of mathematical expressions, the value adopted for the property is the result of a mathematical expression.\n\n",
"tags": [
"other"
]
},
"meta": {
"hash": "8165e64d1bca7ae3bb0c990712023720dff55c2f6194b557a131901d528be4b7"
}
},
{
"id": "circle",
"type": "snippetListing",
"title": "Circle",
"attributes": {
"text": "Creates a circle shape with pure CSS.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "60ac5a7cb7e2c24c936b267ac74d649052c9aaa80810278720b5b5a14fee1562"
}
},
{
"id": "clearfix",
"type": "snippetListing",
"title": "Clearfix",
"attributes": {
"text": "Ensures that an element self-clears its children.\n\n###### Note: This is only useful if you are still using float to build layouts. Please consider using a modern approach with flexbox layout or grid layout.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "55fe4fad743f778816b5923c862484cfa84efd353a4d2a3efe04893db6f5863f"
}
},
{
"id": "constant-width-to-height-ratio",
"type": "snippetListing",
"title": "Constant width to height ratio",
"attributes": {
"text": "Given an element of variable width, it will ensure its height remains proportionate in a responsive fashion\n(i.e., its width to height ratio remains constant).\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "931815035291ba0e6de497d7296fc75e207117c9ff0607fd646f01da53793929"
}
},
{
"id": "counter",
"type": "snippetListing",
"title": "Counter",
"attributes": {
"text": "Counters are, in essence, variables maintained by CSS whose values may be incremented by CSS rules to track how many times they're used.\n\n",
"tags": [
"visual",
"other"
]
},
"meta": {
"hash": "7c572c339c0767840bd0fd6f5daab357a8da070988c621e341bc5ce78d0f798e"
}
},
{
"id": "custom-scrollbar",
"type": "snippetListing",
"title": "Custom scrollbar",
"attributes": {
"text": "Customizes the scrollbar style for the document and elements with scrollable overflow, on WebKit platforms.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "e5544c894ee3cd4ce3352d10331e2f321c6d30b4a0a667434286c6d4951c3b0a"
}
},
{
"id": "custom-text-selection",
"type": "snippetListing",
"title": "Custom text selection",
"attributes": {
"text": "Changes the styling of text selection.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "bf835c2f1d038e6b08d221c9fef85933757a80c67de555797c6bc63ff7035ae8"
}
},
{
"id": "custom-variables",
"type": "snippetListing",
"title": "Custom variables",
"attributes": {
"text": "CSS variables that contain specific values to be reused throughout a document.\n\n",
"tags": [
"other"
]
},
"meta": {
"hash": "7a0d1c46beceb336265b2ca27a4f3cf25ad332a5cd2e8c0b692a43ce5b329fef"
}
},
{
"id": "disable-selection",
"type": "snippetListing",
"title": "Disable selection",
"attributes": {
"text": "Makes the content unselectable.\n\n",
"tags": [
"interactivity"
]
},
"meta": {
"hash": "02f6472568975f5897a84f8846d97f8561fc5334ddafac53e73adb52ccda5f29"
}
},
{
"id": "display-table-centering",
"type": "snippetListing",
"title": "Display table centering",
"attributes": {
"text": "Vertically and horizontally centers a child element within its parent element using `display: table` (as an alternative to `flexbox`).\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "83c7806b0be2e50ca34f313912f9cb90682852790e6d0105a635f781212fa5b1"
}
},
{
"id": "donut-spinner",
"type": "snippetListing",
"title": "Donut spinner",
"attributes": {
"text": "Creates a donut spinner that can be used to indicate the loading of content.\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "4e7f5ce479955deb9830ca4a72fc8260c8863aa65d6f67f15e88a3f923c10c3a"
}
},
{
"id": "dynamic-shadow",
"type": "snippetListing",
"title": "Dynamic shadow",
"attributes": {
"text": "Creates a shadow similar to `box-shadow` but based on the colors of the element itself.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "738fae9ee6d0a9fe84cdbdd632a93f651f8377ec7e9f647e1031207d99b819a5"
}
},
{
"id": "easing-variables",
"type": "snippetListing",
"title": "Easing variables",
"attributes": {
"text": "Variables that can be reused for `transition-timing-function` properties, more\npowerful than the built-in `ease`, `ease-in`, `ease-out` and `ease-in-out`.\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "94ec3c4e6b02374b61367e8cf4edcb9532bb7297673a28acaee0ad3264adfa3d"
}
},
{
"id": "etched-text",
"type": "snippetListing",
"title": "Etched text",
"attributes": {
"text": "Creates an effect where text appears to be \"etched\" or engraved into the background.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "68da5c2e7399979db3aeb1022d13b0490fc71d55d068597544954706c7027bef"
}
},
{
"id": "evenly-distributed-children",
"type": "snippetListing",
"title": "Evenly distributed children",
"attributes": {
"text": "Evenly distributes child elements within a parent element.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "86c8c53be49e82365f6d6f54a03b55d9a8888ccc85504fe0480499b0e68c7f5b"
}
},
{
"id": "fit-image-in-container",
"type": "snippetListing",
"title": "Fit image in container",
"attributes": {
"text": "Changes the fit and position of an image within its container while preserving its aspect ratio. Previously only possible using a background image and the `background-size` property.\n\n",
"tags": [
"layout",
"visual"
]
},
"meta": {
"hash": "5d09d5e54b7436f047db61223cff15dce2f17f6cffe5e71e0f9061337de3068e"
}
},
{
"id": "flexbox-centering",
"type": "snippetListing",
"title": "Flexbox centering",
"attributes": {
"text": "Horizontally and vertically centers a child element within a parent element using `flexbox`.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "a2bf8cfa4de368cfb10d013b6bbb87c598e0cccacfe816972da4ac668c6abc1a"
}
},
{
"id": "focus-within",
"type": "snippetListing",
"title": "Focus Within",
"attributes": {
"text": "Changes the appearance of a form if any of its children are focused.\n\n",
"tags": [
"visual",
"interactivity"
]
},
"meta": {
"hash": "a12b394af0b2df2f7fa6bae2cbbe3a8b01ba74510991dcfe3952b8bd9c0a5a41"
}
},
{
"id": "fullscreen",
"type": "snippetListing",
"title": "Fullscreen",
"attributes": {
"text": "The :fullscreen CSS pseudo-class represents an element that's displayed when the browser is in fullscreen mode.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "23cab923692f5e3250be38b3c970dc11f3bab34159812aaf979ea09bce441c30"
}
},
{
"id": "ghost-trick",
"type": "snippetListing",
"title": "Ghost trick",
"attributes": {
"text": "Vertically centers an element in another.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "0515f03b1505eafa21e0d0d7377facbe4aaa9159996906dd4ed2857ee137073a"
}
},
{
"id": "gradient-text",
"type": "snippetListing",
"title": "Gradient text",
"attributes": {
"text": "Gives text a gradient color.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "9620da48fb82b48a7c6b681854707b622a18c158f2db88c816e3b9c0d9b04523"
}
},
{
"id": "grid-centering",
"type": "snippetListing",
"title": "Grid centering",
"attributes": {
"text": "Horizontally and vertically centers a child element within a parent element using `grid`.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "f6fbb076581e63ab9187ca63d8620f88de19d7a78c46f9ded903271461a445bf"
}
},
{
"id": "hairline-border",
"type": "snippetListing",
"title": "Hairline border",
"attributes": {
"text": "Gives an element a border equal to 1 native device pixel in width, which can look\nvery sharp and crisp.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "cd26d0cd1831474afdc784b4459b60062243e2d390975e94cd7d51fa776c603f"
}
},
{
"id": "height-transition",
"type": "snippetListing",
"title": "Height transition",
"attributes": {
"text": "Transitions an element's height from `0` to `auto` when its height is unknown.\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "bff0b57d24dac06ae6a6d71a8d0d628ec0b97760be0cfda66791191957075d73"
}
},
{
"id": "hover-shadow-box-animation",
"type": "snippetListing",
"title": "Hover shadow box animation",
"attributes": {
"text": "Creates a shadow box around the text when it is hovered.\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "4136aff34ae1b8bf6b525c08881a12c43e9ce7265e864c09ea25fa40e8d86396"
}
},
{
"id": "hover-underline-animation",
"type": "snippetListing",
"title": "Hover underline animation",
"attributes": {
"text": "Creates an animated underline effect when the text is hovered over.\n\n<small>**Credit:** https://flatuicolors.com/</small>\n\n",
"tags": [
"animation"
]
},
"meta": {
"hash": "6e8a53b0b69ab05f54c199f42944746c0e3331712f69a8dc72709eda16428424"
}
},
{
"id": "last-item-with-remaining-available-height",
"type": "snippetListing",
"title": "Last item with remaining available height",
"attributes": {
"text": "Take advantage of available viewport space by giving the last element the remaining available space in current viewport, even when resizing the window.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "2f925cc190a9744532de97bb4add65e53cc0b2f3833760f4e7263f5df17cfad5"
}
},
{
"id": "mouse-cursor-gradient-tracking",
"type": "snippetListing",
"title": "Mouse cursor gradient tracking",
"attributes": {
"text": "A hover effect where the gradient follows the mouse cursor.\n\n<small class=\"snippet__credit\">**Credit:** [Tobias Reich](https://codepen.io/electerious/pen/MQrRxX)</small>\n\n",
"tags": [
"visual",
"interactivity"
]
},
"meta": {
"hash": "97fbac82b526cafe6e48233dda46d0bb87fde7a52027774048b90c9c14818395"
}
},
{
"id": "not-selector",
"type": "snippetListing",
"title": ":not selector",
"attributes": {
"text": "The `:not` psuedo selector is useful for styling a group of elements, while leaving the last (or specified) element unstyled.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "a5ce598fdef79b1c1a91bc30992bd881e3f1d1f7928c4c4d3ccd5f4eb5817ad9"
}
},
{
"id": "offscreen",
"type": "snippetListing",
"title": "Offscreen",
"attributes": {
"text": "A bulletproof way to completely hide an element visually and positionally in the DOM while still allowing it to be accessed by JavaScript and readable by screen readers. This method is very useful for accessibility ([ADA](https://adata.org/learn-about-ada)) development when more context is needed for visually-impaired users. As an alternative to `display: none` which is not readable by screen readers or `visibility: hidden` which takes up physical space in the DOM.\n\n",
"tags": [
"layout",
"visual"
]
},
"meta": {
"hash": "08134db9917770420e2e7b479304250d9f0b8b4b285db1c28ee3a79e150b3f47"
}
},
{
"id": "overflow-scroll-gradient",
"type": "snippetListing",
"title": "Overflow scroll gradient",
"attributes": {
"text": "Adds a fading gradient to an overflowing element to better indicate there is more content to be scrolled.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "e25bdb353dc5da5c1c359f91769d85d0b3b0a58ff7085041603e4e685b380ef7"
}
},
{
"id": "popout-menu",
"type": "snippetListing",
"title": "Popout menu",
"attributes": {
"text": "Reveals an interactive popout menu on hover and focus.\n\n",
"tags": [
"interactivity"
]
},
"meta": {
"hash": "46d1f9e1a05328d86ffda0dbea7dc60eae44c319eb430632ef384d2f3e7e6d44"
}
},
{
"id": "pretty-text-underline",
"type": "snippetListing",
"title": "Pretty text underline",
"attributes": {
"text": "A nicer alternative to `text-decoration: underline` or `<u></u>` where descenders do not clip the underline.\nNatively implemented as `text-decoration-skip-ink: auto` but it has less control over the underline.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "fb3a96cbbb4d59af2566f3d0729c13478a81a572b25a8dd1696e2a67dd8fff79"
}
},
{
"id": "reset-all-styles",
"type": "snippetListing",
"title": "Reset all styles",
"attributes": {
"text": "Resets all styles to default values with one property. This will not affect `direction` and `unicode-bidi` properties.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "f9542b2db5cd49f09e53b3af8348c58c973244bdeede87857e49660c6e713d65"
}
},
{
"id": "shape-separator",
"type": "snippetListing",
"title": "Shape separator",
"attributes": {
"text": "Uses an SVG shape to separate two different blocks to create more a interesting visual appearance compared to standard horizontal separation.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "0b86c444f4d15709a99d1e32c651e9530a294258ba32784d998a56c6f14198b1"
}
},
{
"id": "sibling-fade",
"type": "snippetListing",
"title": "Sibling fade",
"attributes": {
"text": "Fades out the siblings of a hovered item.\n\n",
"tags": [
"interactivity"
]
},
"meta": {
"hash": "35bfb52929dcbd21c120d555c9d3382154f47b661d31722ffb3d21281021bba3"
}
},
{
"id": "system-font-stack",
"type": "snippetListing",
"title": "System font stack",
"attributes": {
"text": "Uses the native font of the operating system to get close to a native app feel.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "97b037f3f463b8cf7de0cc12a607c540ffe8a4869323a4cc17c66eebbc92d612"
}
},
{
"id": "toggle-switch",
"type": "snippetListing",
"title": "Toggle switch",
"attributes": {
"text": "Creates a toggle switch with CSS only.\n\n",
"tags": [
"visual",
"interactivity"
]
},
"meta": {
"hash": "e29182514bd83550705267a43d21eec8886ed011c6259f2b3efec9862541f90e"
}
},
{
"id": "transform-centering",
"type": "snippetListing",
"title": "Transform centering",
"attributes": {
"text": "Vertically and horizontally centers a child element within its parent element using `position: absolute` and `transform: translate()` (as an alternative to `flexbox` or `display: table`). Similar to `flexbox`, this method does not require you to know the height or width of your parent or child so it is ideal for responsive applications.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "9ee4bb8713d24b9e6f5367eb05645c6e41d205b120b4d06a9a949984c7cd73b0"
}
},
{
"id": "triangle",
"type": "snippetListing",
"title": "Triangle",
"attributes": {
"text": "Creates a triangle shape with pure CSS.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "357daaf44bab240518a3c9bdd34a1e8702fab3358171e30f633b7a7f423b9884"
}
},
{
"id": "truncate-text-multiline",
"type": "snippetListing",
"title": "Truncate text multiline",
"attributes": {
"text": "If the text is longer than one line, it will be truncated for `n` lines and end with an gradient fade.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "a30287149e833b454deea446359d51554640ad3a57cd2460d8519c376077b8b4"
}
},
{
"id": "truncate-text",
"type": "snippetListing",
"title": "Truncate text",
"attributes": {
"text": "If the text is longer than one line, it will be truncated and end with an ellipsis `…`.\n\n",
"tags": [
"layout"
]
},
"meta": {
"hash": "4ce872446c7950c9450e56ab2251c7cfcd473a1c9b2a64baa7c9d6b029264796"
}
},
{
"id": "zebra-striped-list",
"type": "snippetListing",
"title": "Zebra striped list",
"attributes": {
"text": "Creates a striped list with alternating background colors, which is useful for differentiating siblings that have content spread across a wide row.\n\n",
"tags": [
"visual"
]
},
"meta": {
"hash": "43bc0cd7776468f3b74791017349ef278921c8ded7ba0bd7788d2b01bdb68c7a"
}
}
],
"meta": {
"specification": "http://jsonapi.org/format/",
"type": "snippetListingArray"
}
}