-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebCSS.html
More file actions
868 lines (814 loc) · 42.5 KB
/
Copy pathWebCSS.html
File metadata and controls
868 lines (814 loc) · 42.5 KB
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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/jpeg" href="logo.jpg">
<title>WebCSS</title>
<link rel="stylesheet" href="WebCSS.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,400;1,600;1,700&family=Dancing+Script:wght@400;600;700&family=Lora:ital,wght@1,400;1,600;1,700&family=Cormorant+Garamond:ital,wght@1,300;1,400;1,600&family=Crimson+Pro:ital,wght@1,400;1,600;1,700&display=swap" rel="stylesheet">
<script src="WebCSS.js" defer></script>
</head>
<body>
<nav>
<div class="nav-left">
<a href="#" rel="noopener">
<img src="logo.jpg" alt="Logo">
</a>
<a href="#" class="nav-brand">WebCSS</a>
<div id="navbarSupportedContent">
<ul>
<li><a aria-current="page" href="#">Docs</a></li>
<li><a href="#list-Example">Examples</a></li>
<li><a href="#section-colors">Colors</a></li>
<li><a href="#section-fonts">Fonts</a></li>
</ul>
</div>
</div>
<div class="nav-right">
<a href="https://github.com" target="_blank" rel="noopener">
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub Logo">
</a>
<h3>Version 1.0</h3>
<button type="button" id="darkModeBtn">Dark Mode</button>
</div>
</nav>
<div class="section-wrapper">
<div class="sidebar">
<div id="list-Example">
<a href="#list-item-1">Spinners</a>
<a href="#list-item-2">Toasts</a>
<a href="#list-item-3">Tooltips</a>
<a href="#list-item-4">Pagination</a>
<a href="#list-item-5">Progress</a>
<a href="#list-item-6">Scrollspy</a>
<a href="#list-item-7">Popovers</a>
<a href="#list-item-8">Forms</a>
<a href="#list-item-9">Navigation</a>
<a href="#list-item-10">Tables</a>
<a href="#list-item-11">Cards</a>
<a href="#list-item-12">Badges</a>
<a href="#list-item-13">Accordion</a>
<a href="#list-item-14">Alerts</a>
<a href="#list-item-15">Badge</a>
<a href="#list-item-16">Breadcrumb</a>
<a href="#list-item-17">Buttons</a>
<a href="#list-item-18">Button group</a>
</div>
</div>
<div class="content-area">
<div class="content-scroll">
<h4 id="list-item-1">Spinners</h4>
<p>Spinners can be used to show the loading state in your projects. They're built with HTML and CSS — no JavaScript needed to create them. You will need custom JavaScript to toggle visibility. Their appearance, alignment, and sizing can be customized with utility classes.</p>
<div class="component-example">
<div class="component-demo">
<div class="spinner-border text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-border text-secondary" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-border text-success" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-border text-danger" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-border text-warning" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-border text-info" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
<div class="spinner-grow text-success" role="status"><span class="visually-hidden">Loading...</span></div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="spinner-border text-primary" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<div class="spinner-grow text-success" role="status">
<span class="visually-hidden">Loading...</span>
</div></code></pre>
</div>
<h4 id="list-item-2">Toasts</h4>
<p>Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems. They're built with flexbox, so they're easy to align and position.</p>
<div class="component-example">
<div class="component-demo">
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto">WebCSS</strong>
<small>Just now</small>
<button type="button" class="btn-close" aria-label="Close">×</button>
</div>
<div class="toast-body">Hello, this is a toast notification!</div>
</div>
<div class="toast show toast-success" role="alert">
<div class="toast-header">
<strong class="me-auto">Success</strong>
<small>2 mins ago</small>
</div>
<div class="toast-body">Your action was completed successfully.</div>
</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="toast show" role="alert">
<div class="toast-header">
<strong class="me-auto">Title</strong>
<small>Just now</small>
</div>
<div class="toast-body">Hello, world!</div>
</div></code></pre>
</div>
<h4 id="list-item-3">Tooltips</h4>
<p>Tooltips display informative text when users hover over, focus on, or tap an element. They rely on a third-party library — Popper — for positioning. Here we demonstrate a pure CSS tooltip implementation.</p>
<div class="component-example">
<div class="component-demo">
<span class="tooltip-wrapper">
<button type="button" class="btn btn-primary">Hover me (Top)</button>
<span class="tooltip-box tooltip-top">Tooltip on top!</span>
</span>
<span class="tooltip-wrapper">
<button type="button" class="btn btn-secondary">Hover me (Bottom)</button>
<span class="tooltip-box tooltip-bottom">Tooltip on bottom!</span>
</span>
<span class="tooltip-wrapper">
<button type="button" class="btn btn-success">Hover me (Right)</button>
<span class="tooltip-box tooltip-right">Tooltip on right!</span>
</span>
</div>
<h5>Example Code:</h5>
<pre><code><span class="tooltip-wrapper">
<button class="btn btn-primary">Hover me</button>
<span class="tooltip-box tooltip-top">Tooltip text!</span>
</span></code></pre>
</div>
<h4 id="list-item-4">Pagination</h4>
<p>Pagination is used to indicate a series of related content exists across multiple pages. Use it to let users navigate between sets of results or pages.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:1rem;">
<nav aria-label="Page navigation">
<ul class="pagination">
<li class="page-item disabled"><a class="page-link" href="#">Previous</a></li>
<li class="page-item active"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">4</a></li>
<li class="page-item"><a class="page-link" href="#">5</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>
<h5>Example Code:</h5>
<pre><code><ul class="pagination">
<li class="page-item disabled"><a class="page-link" href="#">Previous</a></li>
<li class="page-item active"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul></code></pre>
</div>
<h4 id="list-item-5">Progress</h4>
<p>Progress components are built with two HTML elements, some CSS to set the width, and a few attributes. Use the <code>.progress</code> wrapper and <code>.progress-bar</code> inside it.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:0.75rem; width:100%;">
<div class="progress demo-progress"><div class="progress-bar" role="progressbar" style="width:25%">25%</div></div>
<div class="progress demo-progress"><div class="progress-bar bg-success" role="progressbar" style="width:50%">50%</div></div>
<div class="progress demo-progress"><div class="progress-bar bg-warning" role="progressbar" style="width:75%">75%</div></div>
<div class="progress demo-progress"><div class="progress-bar bg-danger" role="progressbar" style="width:90%">90%</div></div>
<div class="progress demo-progress">
<div class="progress-bar" role="progressbar" style="width:30%">30%</div>
<div class="progress-bar bg-success" role="progressbar" style="width:20%">20%</div>
</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="progress">
<div class="progress-bar bg-success" role="progressbar" style="width:50%">50%</div>
</div></code></pre>
</div>
<h4 id="list-item-6">Scrollspy</h4>
<p>Scrollspy automatically updates navigation links based on scroll position to indicate which link is currently active in the viewport. This entire page uses scrollspy — the sidebar on the left highlights the active section as you scroll.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column;">
<p>Scrollspy is implemented on this page's left sidebar. As you scroll through sections, the active link in the sidebar automatically highlights. The key attributes needed are:</p>
<ul style="padding-left:1.5rem; color:#495057;">
<li><code>data-bs-spy="scroll"</code> — on the scrollable container</li>
<li><code>data-bs-target="#list-Example"</code> — pointing to the nav</li>
<li><code>tabindex="0"</code> — to make the element focusable</li>
</ul>
</div>
<h5>Example Code:</h5>
<pre><code><div data-bs-spy="scroll" data-bs-target="#list-Example" tabindex="0">
<h4 id="list-item-1">Spinners</h4>
<p>...</p>
<h4 id="list-item-2">Toasts</h4>
<p>...</p>
</div></code></pre>
</div>
<h4 id="list-item-7">Popovers</h4>
<p>Popovers are similar to tooltips but can contain richer HTML content including a title and body. They appear on click (or hover) and are positioned dynamically.</p>
<div class="component-example">
<div class="component-demo">
<div class="popover-wrapper">
<button type="button" class="btn btn-primary" onclick="this.nextElementSibling.classList.toggle('show')">Click for Popover</button>
<div class="popover-box">
<div class="popover-header">Popover Title</div>
<div class="popover-body">This is some popover content. Click the button again to close it.</div>
</div>
</div>
<div class="popover-wrapper">
<button type="button" class="btn btn-danger" onclick="this.nextElementSibling.classList.toggle('show')">Another Popover</button>
<div class="popover-box popover-danger">
<div class="popover-header">Warning!</div>
<div class="popover-body">This action cannot be undone. Proceed with caution.</div>
</div>
</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="popover-wrapper">
<button class="btn btn-primary">Click for Popover</button>
<div class="popover-box">
<div class="popover-header">Title</div>
<div class="popover-body">Content here.</div>
</div>
</div></code></pre>
</div>
<h4 id="list-item-8">Forms</h4>
<p>WebCSS's form controls expand on our Rebooted form styles with classes. Use these classes to opt into their customized displays for a more consistent rendering across browsers and devices.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:1rem; width:100%; max-width:480px;">
<div class="mb-3">
<label class="form-label" for="exampleEmail">Email address</label>
<input type="email" class="form-control" id="exampleEmail" placeholder="name@example.com">
<div class="form-text">We'll never share your email with anyone.</div>
</div>
<div class="mb-3">
<label class="form-label" for="examplePassword">Password</label>
<input type="password" class="form-control" id="examplePassword" placeholder="Password">
</div>
<div class="mb-3">
<label class="form-label" for="exampleSelect">Select</label>
<select class="form-control" id="exampleSelect">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" id="exampleCheck">
<label class="form-check-label" for="exampleCheck">Check me out</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="radio" name="radios" id="radio1" checked>
<label class="form-check-label" for="radio1">Option one</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="radio" name="radios" id="radio2">
<label class="form-check-label" for="radio2">Option two</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
<h5>Example Code:</h5>
<pre><code><div class="mb-3">
<label class="form-label" for="email">Email</label>
<input type="email" class="form-control" id="email" placeholder="name@example.com">
</div>
<button type="submit" class="btn btn-primary">Submit</button></code></pre>
</div>
<h4 id="list-item-9">Navigation</h4>
<p>WebCSS's navigation components build on the base nav component with modifiers to create different navigation styles including tabs, pills, and a fully collapsed navigation bar.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:1.5rem; width:100%;">
<nav>
<ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active" href="#">Active Tab</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link</a></li>
<li class="nav-item"><a class="nav-link" href="#">Another Link</a></li>
<li class="nav-item"><a class="nav-link disabled" href="#" tabindex="-1">Disabled</a></li>
</ul>
</nav>
<nav>
<ul class="nav nav-pills">
<li class="nav-item"><a class="nav-link active" href="#">Active</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link</a></li>
<li class="nav-item"><a class="nav-link" href="#">Another</a></li>
<li class="nav-item"><a class="nav-link disabled" href="#" tabindex="-1">Disabled</a></li>
</ul>
</nav>
</div>
<h5>Example Code:</h5>
<pre><code><!-- Tabs -->
<ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active" href="#">Active</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link</a></li>
</ul>
<!-- Pills -->
<ul class="nav nav-pills">
<li class="nav-item"><a class="nav-link active" href="#">Active</a></li>
</ul></code></pre>
</div>
<h4 id="list-item-10">Tables</h4>
<p>Use contextual classes to color tables, table rows, or individual cells. WebCSS provides several color variants for flexible table styling.</p>
<div class="component-example">
<div class="component-demo" style="width:100%; overflow-x:auto;">
<table>
<thead>
<tr class="table-header-row">
<th>Class</th>
<th>Heading</th>
<th>Heading</th>
</tr>
</thead>
<tbody>
<tr class="table-primary"><td>table-primary</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-secondary"><td>table-secondary</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-success"><td>table-success</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-danger"><td>table-danger</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-warning"><td>table-warning</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-info"><td>table-info</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-light"><td>table-light</td><td>Cell</td><td>Cell</td></tr>
<tr class="table-dark"><td>table-dark</td><td>Cell</td><td>Cell</td></tr>
</tbody>
</table>
</div>
<h5>Example Code:</h5>
<pre><code><table>
<tbody>
<tr class="table-primary"><td>Primary</td></tr>
<tr class="table-success"><td>Success</td></tr>
<tr class="table-danger"><td>Danger</td></tr>
</tbody>
</table></code></pre>
</div>
<h4 id="list-item-11">Cards</h4>
<p>A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.</p>
<div class="component-example">
<div class="component-demo">
<div class="card demo-card">
<div class="card-header">Featured</div>
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="card demo-card" style="border-color:#28a745;">
<div class="card-header" style="background:#28a745; color:white;">Success Card</div>
<div class="card-body">
<h5 class="card-title">Success!</h5>
<p class="card-text">This is a card with a success style applied to the header.</p>
<a href="#" class="btn btn-success">Learn more</a>
</div>
</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="card">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Title</h5>
<p class="card-text">Body text.</p>
<a href="#" class="btn btn-primary">Action</a>
</div>
</div></code></pre>
</div>
<h4 id="list-item-12">Badges</h4>
<p>Badges scale to match the size of the immediate parent element by using relative font sizing and <code>em</code> units. Use them to highlight new or unread items.</p>
<div class="component-example">
<div class="component-demo">
<span class="badge bg-primary">Primary</span>
<span class="badge bg-secondary">Secondary</span>
<span class="badge bg-success">Success</span>
<span class="badge bg-danger">Danger</span>
<span class="badge bg-warning text-dark">Warning</span>
<span class="badge bg-info">Info</span>
<span class="badge bg-dark">Dark</span>
<h4>Notifications <span class="badge bg-danger">4</span></h4>
</div>
<h5>Example Code:</h5>
<pre><code><span class="badge bg-primary">Primary</span>
<span class="badge bg-success">Success</span>
<span class="badge bg-danger">Danger</span>
<h4>Notifications <span class="badge bg-danger">4</span></h4></code></pre>
</div>
<h4 id="list-item-13">Accordion</h4>
<p>Build vertically collapsing accordions in combination with our Collapse component. Use the accordion to allow users to show and hide sections of content.</p>
<div class="component-example">
<div class="component-demo" style="width:100%;">
<div class="accordion" style="width:100%;">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" onclick="toggleAccordion(this)">
Accordion Item #1
</button>
</h2>
<div class="accordion-collapse show">
<div class="accordion-body">
This is the first item's accordion body. It is shown by default. Modify the class to collapse it.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" onclick="toggleAccordion(this)">
Accordion Item #2
</button>
</h2>
<div class="accordion-collapse">
<div class="accordion-body">
This is the second item's accordion body. It is hidden by default.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" onclick="toggleAccordion(this)">
Accordion Item #3
</button>
</h2>
<div class="accordion-collapse">
<div class="accordion-body">
This is the third item's accordion body. Click the button above to toggle visibility.
</div>
</div>
</div>
</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="accordion">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button">Item #1</button>
</h2>
<div class="accordion-collapse show">
<div class="accordion-body">Content here.</div>
</div>
</div>
</div></code></pre>
</div>
<h4 id="list-item-14">Alerts</h4>
<p>Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. Use one of the contextual classes like <code>.alert-success</code> or <code>.alert-danger</code>.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:0.5rem; width:100%;">
<div class="alert alert-primary" role="alert">A simple <strong>primary</strong> alert — check it out!</div>
<div class="alert alert-secondary" role="alert">A simple <strong>secondary</strong> alert — check it out!</div>
<div class="alert alert-success" role="alert">A simple <strong>success</strong> alert — check it out!</div>
<div class="alert alert-danger" role="alert">A simple <strong>danger</strong> alert — check it out!</div>
<div class="alert alert-warning" role="alert">A simple <strong>warning</strong> alert — check it out!</div>
<div class="alert alert-info" role="alert">A simple <strong>info</strong> alert — check it out!</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="alert alert-success" role="alert">
A simple success alert!
</div>
<div class="alert alert-danger" role="alert">
A danger alert!
</div></code></pre>
</div>
<h4 id="list-item-15">Badge (Pill)</h4>
<p>Use the <code>.rounded-pill</code> modifier class to make badges more rounded with a larger <code>border-radius</code>. Useful if you miss the badges from v3.</p>
<div class="component-example">
<div class="component-demo">
<span class="badge bg-primary rounded-pill">Primary</span>
<span class="badge bg-secondary rounded-pill">Secondary</span>
<span class="badge bg-success rounded-pill">Success</span>
<span class="badge bg-danger rounded-pill">Danger</span>
<span class="badge bg-warning text-dark rounded-pill">Warning</span>
<span class="badge bg-info rounded-pill">Info</span>
<span class="badge bg-dark rounded-pill">Dark</span>
</div>
<h5>Example Code:</h5>
<pre><code><span class="badge bg-primary rounded-pill">Primary</span>
<span class="badge bg-success rounded-pill">Success</span></code></pre>
</div>
<h4 id="list-item-16">Breadcrumb</h4>
<p>Indicate the current page's location within a navigational hierarchy that automatically adds separators via CSS. Use an ordered list or an unordered list with a <code>.breadcrumb</code> class.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:0.75rem;">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
</ol>
</nav>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active" aria-current="page">Data</li>
</ol>
</nav>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item"><a href="#">Components</a></li>
<li class="breadcrumb-item active" aria-current="page">Breadcrumb</li>
</ol>
</nav>
</div>
<h5>Example Code:</h5>
<pre><code><nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active">Current Page</li>
</ol>
</nav></code></pre>
</div>
<h4 id="list-item-17">Buttons</h4>
<p>Use WebCSS's custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.</p>
<div class="component-example">
<div class="component-demo">
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-dark">Dark</button>
<button type="button" class="btn btn-outline-primary">Outline</button>
</div>
<div class="component-demo" style="margin-top:0.5rem;">
<button type="button" class="btn btn-primary btn-lg">Large</button>
<button type="button" class="btn btn-secondary">Normal</button>
<button type="button" class="btn btn-success btn-sm">Small</button>
<button type="button" class="btn btn-danger" disabled>Disabled</button>
</div>
<h5>Example Code:</h5>
<pre><code><button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-outline-primary">Outline</button></code></pre>
</div>
<h4 id="list-item-18">Button group</h4>
<p>Group a series of buttons together on a single line or stack them in a vertical column with the button group component.</p>
<div class="component-example">
<div class="component-demo" style="flex-direction:column; gap:1rem;">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-outline-primary">1</button>
<button type="button" class="btn btn-outline-primary">2</button>
<button type="button" class="btn btn-outline-primary">3</button>
<button type="button" class="btn btn-outline-primary">4</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-danger">Delete</button>
<button type="button" class="btn btn-warning">Edit</button>
<button type="button" class="btn btn-success">Save</button>
</div>
</div>
<h5>Example Code:</h5>
<pre><code><div class="btn-group" role="group">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div></code></pre>
</div>
</div>
</div>
</div>
<div class="section-wrapper" id="section-colors">
<div class="sidebar">
<div id="list-Colors">
<a href="#color-primary">Primary</a>
<a href="#color-secondary">Secondary</a>
<a href="#color-success">Success</a>
<a href="#color-danger">Danger</a>
<a href="#color-warning">Warning</a>
<a href="#color-info">Info</a>
</div>
</div>
<div class="content-area">
<div class="content-scroll">
<h4>Color Palette</h4>
<p>WebCSS ships with a variety of color options to convey meaning through color. These contextual colors cover the most common cases for UI components.</p>
<table>
<thead>
<tr>
<th class="color-header">Color Name</th>
<th class="cell-header">Swatch</th>
<th class="cell-header">Hex Value</th>
<th class="cell-header">Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td class="color-blue bg-blue" id="color-primary">Blue (Primary)</td>
<td class="cell-cell bg-blue">●</td>
<td style="background:#fff; color:#333;">#007bff</td>
<td style="background:#fff; color:#333;">Primary actions, links</td>
</tr>
<tr>
<td class="color-gray bg-gray" id="color-secondary">Gray (Secondary)</td>
<td class="cell-cell bg-gray">●</td>
<td style="background:#fff; color:#333;">#6c757d</td>
<td style="background:#fff; color:#333;">Secondary elements</td>
</tr>
<tr>
<td class="color-green bg-green" id="color-success">Green (Success)</td>
<td class="cell-cell bg-green">●</td>
<td style="background:#fff; color:#333;">#28a745</td>
<td style="background:#fff; color:#333;">Positive feedback</td>
</tr>
<tr>
<td class="color-red bg-red" id="color-danger">Red (Danger)</td>
<td class="cell-cell bg-red">●</td>
<td style="background:#fff; color:#333;">#dc3545</td>
<td style="background:#fff; color:#333;">Errors, destructive</td>
</tr>
<tr>
<td class="color-yellow bg-yellow" id="color-warning">Yellow (Warning)</td>
<td class="cell-cell bg-yellow">●</td>
<td style="background:#fff; color:#333;">#ffc107</td>
<td style="background:#fff; color:#333;">Warnings, caution</td>
</tr>
<tr>
<td class="color-cyan bg-cyan" id="color-info">Cyan (Info)</td>
<td class="cell-cell bg-cyan">●</td>
<td style="background:#fff; color:#333;">#17a2b8</td>
<td style="background:#fff; color:#333;">Informational</td>
</tr>
<tr>
<td class="color-sky bg-sky">Sky</td>
<td class="cell-cell bg-sky">●</td>
<td style="background:#fff; color:#333;">#7dd3fc</td>
<td style="background:#fff; color:#333;">Soft accent</td>
</tr>
<tr>
<td class="color-black bg-black">Black</td>
<td class="cell-cell bg-black">●</td>
<td style="background:#fff; color:#333;">#212529</td>
<td style="background:#fff; color:#333;">Dark theme, text</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section-wrapper" id="section-fonts">
<div class="sidebar">
<div id="list-Fonts">
<a href="#font-playfair">Playfair Display</a>
<a href="#font-dancing">Dancing Script</a>
<a href="#font-lora">Lora</a>
<a href="#font-cormorant">Cormorant Garamond</a>
<a href="#font-crimson">Crimson Pro</a>
</div>
</div>
<div class="content-area">
<div class="content-scroll">
<h4 style="margin-top:0;">Italic Fonts</h4>
<p>WebCSS includes five elegant italic-style fonts loaded from Google Fonts. Each comes with utility classes so you can apply them instantly to any element.</p>
<!-- Font 1: Playfair Display -->
<div class="font-card" id="font-playfair">
<div class="font-card-header">
<span class="font-badge">Serif</span>
<h5 class="font-name">Playfair Display</h5>
<span class="font-class-tag">.font-playfair</span>
</div>
<div class="font-preview font-playfair">
<p class="font-preview-xl">The quick brown fox jumps over the lazy dog.</p>
<p class="font-preview-md">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p class="font-preview-sm">abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()</p>
</div>
<div class="font-sizes">
<span class="font-playfair" style="font-size:0.75rem;">12px</span>
<span class="font-playfair" style="font-size:1rem;">16px</span>
<span class="font-playfair" style="font-size:1.25rem;">20px</span>
<span class="font-playfair" style="font-size:1.75rem;">28px</span>
<span class="font-playfair" style="font-size:2.5rem;">40px</span>
</div>
<pre><code><p class="font-playfair">Your text here</p>
/* CSS */
.font-playfair {
font-family: 'Playfair Display', serif;
font-style: italic;
}</code></pre>
</div>
<div class="font-card" id="font-dancing">
<div class="font-card-header">
<span class="font-badge font-badge-cursive">Cursive</span>
<h5 class="font-name">Dancing Script</h5>
<span class="font-class-tag">.font-dancing</span>
</div>
<div class="font-preview font-dancing">
<p class="font-preview-xl">The quick brown fox jumps over the lazy dog.</p>
<p class="font-preview-md">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p class="font-preview-sm">abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()</p>
</div>
<div class="font-sizes">
<span class="font-dancing" style="font-size:0.75rem;">12px</span>
<span class="font-dancing" style="font-size:1rem;">16px</span>
<span class="font-dancing" style="font-size:1.25rem;">20px</span>
<span class="font-dancing" style="font-size:1.75rem;">28px</span>
<span class="font-dancing" style="font-size:2.5rem;">40px</span>
</div>
<pre><code><p class="font-dancing">Your text here</p>
/* CSS */
.font-dancing {
font-family: 'Dancing Script', cursive;
font-style: italic;
}</code></pre>
</div>
<div class="font-card" id="font-lora">
<div class="font-card-header">
<span class="font-badge font-badge-serif">Serif</span>
<h5 class="font-name">Lora</h5>
<span class="font-class-tag">.font-lora</span>
</div>
<div class="font-preview font-lora">
<p class="font-preview-xl">The quick brown fox jumps over the lazy dog.</p>
<p class="font-preview-md">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p class="font-preview-sm">abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()</p>
</div>
<div class="font-sizes">
<span class="font-lora" style="font-size:0.75rem;">12px</span>
<span class="font-lora" style="font-size:1rem;">16px</span>
<span class="font-lora" style="font-size:1.25rem;">20px</span>
<span class="font-lora" style="font-size:1.75rem;">28px</span>
<span class="font-lora" style="font-size:2.5rem;">40px</span>
</div>
<pre><code><p class="font-lora">Your text here</p>
/* CSS */
.font-lora {
font-family: 'Lora', serif;
font-style: italic;
}</code></pre>
</div>
<div class="font-card" id="font-cormorant">
<div class="font-card-header">
<span class="font-badge font-badge-display">Display</span>
<h5 class="font-name">Cormorant Garamond</h5>
<span class="font-class-tag">.font-cormorant</span>
</div>
<div class="font-preview font-cormorant">
<p class="font-preview-xl">The quick brown fox jumps over the lazy dog.</p>
<p class="font-preview-md">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p class="font-preview-sm">abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()</p>
</div>
<div class="font-sizes">
<span class="font-cormorant" style="font-size:0.75rem;">12px</span>
<span class="font-cormorant" style="font-size:1rem;">16px</span>
<span class="font-cormorant" style="font-size:1.25rem;">20px</span>
<span class="font-cormorant" style="font-size:1.75rem;">28px</span>
<span class="font-cormorant" style="font-size:2.5rem;">40px</span>
</div>
<pre><code><p class="font-cormorant">Your text here</p>
/* CSS */
.font-cormorant {
font-family: 'Cormorant Garamond', serif;
font-style: italic;
}</code></pre>
</div>
<div class="font-card" id="font-crimson">
<div class="font-card-header">
<span class="font-badge font-badge-text">Text</span>
<h5 class="font-name">Crimson Pro</h5>
<span class="font-class-tag">.font-crimson</span>
</div>
<div class="font-preview font-crimson">
<p class="font-preview-xl">The quick brown fox jumps over the lazy dog.</p>
<p class="font-preview-md">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p class="font-preview-sm">abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()</p>
</div>
<div class="font-sizes">
<span class="font-crimson" style="font-size:0.75rem;">12px</span>
<span class="font-crimson" style="font-size:1rem;">16px</span>
<span class="font-crimson" style="font-size:1.25rem;">20px</span>
<span class="font-crimson" style="font-size:1.75rem;">28px</span>
<span class="font-crimson" style="font-size:2.5rem;">40px</span>
</div>
<pre><code><p class="font-crimson">Your text here</p>
/* CSS */
.font-crimson {
font-family: 'Crimson Pro', serif;
font-style: italic;
}</code></pre>
</div>
</div>
</div>
</div>
<script>
const btn = document.getElementById('darkModeBtn');
if (btn) {
btn.addEventListener('click', () => {
document.body.classList.toggle('dark-mode');
btn.textContent = document.body.classList.contains('dark-mode') ? 'Light Mode' : 'Dark Mode';
});
}
function toggleAccordion(button) {
const collapse = button.closest('.accordion-item').querySelector('.accordion-collapse');
const isOpen = collapse.classList.contains('show');
collapse.classList.toggle('show', !isOpen);
button.classList.toggle('collapsed', isOpen);
}
const sidebarLinks = document.querySelectorAll('#list-Example a');
const sections = document.querySelectorAll('.content-scroll h4[id]');
const contentScroll = document.querySelector('.content-scroll');
if (contentScroll) {
contentScroll.addEventListener('scroll', () => {
let current = '';
sections.forEach(sec => {
if (contentScroll.scrollTop >= sec.offsetTop - 20) current = sec.id;
});
sidebarLinks.forEach(link => {
link.classList.remove('active');
if (link.getAttribute('href') === '#' + current) link.classList.add('active');
});
});
}
</script>
</body>
</html>