@finhay-pro/leaf-design-system 0.1.5 → 0.1.7

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.
Files changed (55) hide show
  1. package/README.md +197 -73
  2. package/dist/border.css +155 -17
  3. package/dist/button.css +11 -10
  4. package/dist/cdn/leaf-0.1.7.min.css +2 -0
  5. package/dist/cdn/leaf-0.1.7.min.js +2 -0
  6. package/dist/classes.css +1915 -238
  7. package/dist/color.css +28 -32
  8. package/dist/components/Button/Button.d.ts.map +1 -1
  9. package/dist/components/Button/Button.js +3 -3
  10. package/dist/components/Button/Button.js.map +1 -1
  11. package/dist/components/Dialog/Dialog.d.ts +10 -2
  12. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  13. package/dist/components/Dialog/Dialog.js +3 -2
  14. package/dist/components/Dialog/Dialog.js.map +1 -1
  15. package/dist/components/Logo/Logo.d.ts.map +1 -1
  16. package/dist/components/Logo/Logo.js +2 -2
  17. package/dist/components/Logo/Logo.js.map +1 -1
  18. package/dist/components/Skeleton/Skeleton.js +1 -1
  19. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  20. package/dist/components/Slider/Slider.js +2 -2
  21. package/dist/components/Slider/Slider.js.map +1 -1
  22. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  23. package/dist/components/Spinner/Spinner.js +2 -2
  24. package/dist/components/Spinner/Spinner.js.map +1 -1
  25. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  26. package/dist/components/Tabs/Tabs.js +3 -3
  27. package/dist/components/Tabs/Tabs.js.map +1 -1
  28. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  29. package/dist/components/Toggle/Toggle.js +1 -1
  30. package/dist/components/Toggle/Toggle.js.map +1 -1
  31. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  32. package/dist/components/Tooltip/Tooltip.js +2 -2
  33. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  34. package/dist/dialog.css +19 -38
  35. package/dist/flex.css +229 -0
  36. package/dist/grid.css +533 -0
  37. package/dist/logo-assets.css +1 -0
  38. package/dist/logo.css +7 -6
  39. package/dist/overflow.css +72 -0
  40. package/dist/position.css +140 -0
  41. package/dist/sizing.css +377 -0
  42. package/dist/skeleton.css +1 -4
  43. package/dist/slider.css +8 -30
  44. package/dist/spacing.css +72 -4
  45. package/dist/spinner.css +4 -16
  46. package/dist/styles.css +1926 -246
  47. package/dist/tabs.css +9 -12
  48. package/dist/text-layout.css +219 -0
  49. package/dist/toggle.css +6 -8
  50. package/dist/tokens.css +12 -8
  51. package/dist/tooltip.css +4 -15
  52. package/dist/typography.css +2 -3
  53. package/package.json +7 -1
  54. package/dist/cdn/leaf-0.1.5.min.css +0 -2
  55. package/dist/cdn/leaf-0.1.5.min.js +0 -2
package/dist/styles.css CHANGED
@@ -1,4 +1,5 @@
1
1
  /* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
2
+ @layer theme, base, components, utilities;
2
3
 
3
4
  /* --- ../tokens/src/primitive.css --- */
4
5
 
@@ -268,6 +269,7 @@
268
269
 
269
270
  :root {
270
271
  --spacing-0: 0px;
272
+ --spacing-2xs: 2px;
271
273
  --spacing-xs: 4px;
272
274
  --spacing-s: 8px;
273
275
  --spacing-m: 12px;
@@ -283,16 +285,18 @@
283
285
 
284
286
  /* --- ../tokens/src/border.css --- */
285
287
 
286
- /* Border radius tokens — Figma 700:4390. Map sang spacing cùng bậc. */
288
+ /* Border tokens — độ dày viền + bo góc. */
287
289
 
288
290
  :root {
289
- --radius-0: var(--spacing-0);
290
- --radius-xs: var(--spacing-xs);
291
- --radius-s: var(--spacing-s);
292
- --radius-m: var(--spacing-m);
293
- --radius-l: var(--spacing-l);
294
- --radius-xl: var(--spacing-xl);
295
- --radius-2xl: var(--spacing-2xl);
291
+ --border-width-s: 0.5px;
292
+ --border-width-m: 1px;
293
+ --border-width-l: 1.5px;
294
+ --border-width-xl: 2px;
295
+
296
+ --radius-s: 4px;
297
+ --radius-m: 8px;
298
+ --radius-l: 12px;
299
+ --radius-full: 9999px; /* pill / circle */
296
300
  }
297
301
 
298
302
  /* --- src/components/Button/button.css --- */
@@ -330,9 +334,6 @@
330
334
  --leaf-button-bg: var(--button-base-primary);
331
335
  --leaf-button-fg: var(--button-content-primary);
332
336
 
333
- display: inline-flex;
334
- align-items: center;
335
- justify-content: center;
336
337
  box-sizing: border-box;
337
338
  width: var(--leaf-button-width, auto);
338
339
  height: var(--leaf-button-height);
@@ -344,8 +345,6 @@
344
345
  border-radius: 1000px;
345
346
  background-color: var(--leaf-button-bg);
346
347
  color: var(--leaf-button-fg);
347
- text-align: center;
348
- white-space: nowrap;
349
348
  font: inherit;
350
349
  font-family: var(--font-sans);
351
350
  font-size: var(--leaf-button-font-size);
@@ -353,14 +352,10 @@
353
352
  font-weight: var(--leaf-button-font-weight);
354
353
  letter-spacing: var(--leaf-button-letter-spacing);
355
354
  text-decoration: none;
356
- vertical-align: middle;
355
+ appearance: none;
357
356
  }
358
357
 
359
358
  .leaf-button__icon {
360
- display: inline-flex;
361
- flex-shrink: 0;
362
- align-items: center;
363
- justify-content: center;
364
359
  width: var(--leaf-button-icon-size);
365
360
  height: var(--leaf-button-icon-size);
366
361
  font-size: var(--leaf-button-icon-size);
@@ -373,6 +368,15 @@
373
368
  height: 1em;
374
369
  }
375
370
 
371
+ /*
372
+ * Layout (`inline-flex`…) lấy từ class Leaf trên markup. `[hidden]` vẫn cần rule riêng
373
+ * vì class layout cũng set display (selector `[hidden]` specificity cao hơn nên thắng).
374
+ */
375
+ .leaf-button[hidden],
376
+ .leaf-button__icon[hidden] {
377
+ display: none;
378
+ }
379
+
376
380
  /* ── Size — Figma Medium/Small dùng padding (không ép height trong auto-layout);
377
381
  * vẫn set height mặc định khớp frame để icon-only / căn hàng ổn định.
378
382
  * Truyền height="auto" (prop) → chiều cao theo padding + nội dung. */
@@ -511,12 +515,7 @@
511
515
 
512
516
  @layer components {
513
517
  .leaf-dialog-backdrop {
514
- position: fixed;
515
- inset: 0;
516
518
  z-index: var(--leaf-z-dialog, 50);
517
- display: flex;
518
- align-items: center;
519
- justify-content: center;
520
519
  padding: 16px;
521
520
  box-sizing: border-box;
522
521
  /*
@@ -528,7 +527,7 @@
528
527
  backdrop-filter: blur(5px);
529
528
  }
530
529
 
531
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để HTML tĩnh ẩn được. */
530
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
532
531
  .leaf-dialog-backdrop[hidden] {
533
532
  display: none;
534
533
  }
@@ -541,17 +540,18 @@
541
540
  --leaf-dialog-close-size: 28px;
542
541
  --leaf-dialog-close-icon: 20px;
543
542
 
544
- display: flex;
545
- flex-direction: column;
546
543
  gap: var(--leaf-dialog-gap);
547
- /* Luôn co theo viewport; maxWidth/maxHeight chỉ là trần — mobile không bị tràn. */
548
- width: 100%;
549
- height: auto;
544
+ /*
545
+ * Width: luôn 100% trong trần maxWidth (responsive).
546
+ * Height: cố định khi có --leaf-dialog-height (content động không giật panel);
547
+ * không có → auto theo nội dung. maxHeight luôn là trần viewport.
548
+ * Layout flex/overflow/w-full lấy từ class Leaf trên markup.
549
+ */
550
550
  max-width: var(--leaf-dialog-max-width, 100%);
551
+ height: var(--leaf-dialog-height, auto);
551
552
  max-height: var(--leaf-dialog-max-height, 100%);
552
553
  margin: 0;
553
554
  padding: var(--leaf-dialog-padding);
554
- overflow: hidden;
555
555
  box-sizing: border-box;
556
556
  border-radius: var(--leaf-dialog-radius);
557
557
  background-color: var(--base-primary);
@@ -565,39 +565,29 @@
565
565
  }
566
566
 
567
567
  .leaf-dialog__header {
568
- display: flex;
569
- flex-shrink: 0;
570
- align-items: center;
571
- justify-content: space-between;
572
568
  gap: var(--leaf-dialog-gap);
573
- width: 100%;
574
- min-width: 0;
575
569
  }
576
570
 
577
- /* Cụm trái: back + title */
571
+ /* Cụm trái: back + title — flex/min-w từ class Leaf trên markup */
578
572
  .leaf-dialog__start {
579
- display: flex;
580
- align-items: center;
581
573
  gap: var(--leaf-dialog-gap);
582
- min-width: 0;
583
- flex: 1 1 auto;
584
574
  }
585
575
 
586
- /* Chỉ truncate layout — font/màu dùng class heading-3 text-primary trên markup. */
576
+ /*
577
+ * Title — heading-3 · --text-primary nằm ngay ở đây: markup không cần class typography /
578
+ * màu, nên utility trùng tên của app (vd. `text-primary`) không chen vào.
579
+ */
587
580
  .leaf-dialog__start > :where(h2, p) {
588
581
  margin: 0;
589
- min-width: 0;
590
- overflow: hidden;
591
- text-overflow: ellipsis;
592
- white-space: nowrap;
582
+ color: var(--text-primary);
583
+ font-family: var(--font-sans);
584
+ font-size: var(--heading-3-size);
585
+ line-height: var(--heading-3-line-height);
586
+ font-weight: var(--heading-3-weight);
593
587
  }
594
588
 
595
589
  .leaf-dialog__back,
596
590
  .leaf-dialog__close {
597
- display: inline-flex;
598
- flex-shrink: 0;
599
- align-items: center;
600
- justify-content: center;
601
591
  margin: 0;
602
592
  padding: 0;
603
593
  border: none;
@@ -645,13 +635,7 @@
645
635
  }
646
636
 
647
637
  .leaf-dialog__body {
648
- display: flex;
649
- flex: 1 1 auto;
650
- flex-direction: column;
651
638
  gap: var(--leaf-dialog-gap);
652
- min-height: 0;
653
- width: 100%;
654
- overflow: auto;
655
639
  }
656
640
  }
657
641
 
@@ -669,10 +653,6 @@
669
653
 
670
654
  @layer components {
671
655
  .leaf-logo {
672
- display: inline-flex;
673
- flex-shrink: 0;
674
- align-items: center;
675
- justify-content: center;
676
656
  margin: 0;
677
657
  padding: 0;
678
658
  border: none;
@@ -681,7 +661,6 @@
681
661
  background-position: center;
682
662
  background-size: contain;
683
663
  line-height: 0;
684
- vertical-align: middle;
685
664
  box-sizing: border-box;
686
665
  }
687
666
 
@@ -696,7 +675,12 @@
696
675
  display: block;
697
676
  height: var(--leaf-logo-size, 40px);
698
677
  width: auto;
699
- max-width: 100%;
678
+ /* max-w-full — class Leaf trên markup (React img) */
679
+ }
680
+
681
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
682
+ .leaf-logo[hidden] {
683
+ display: none;
700
684
  }
701
685
  }
702
686
 
@@ -716,8 +700,6 @@
716
700
  --leaf-skeleton-height: 100%;
717
701
  --leaf-skeleton-radius: 12px;
718
702
 
719
- position: relative;
720
- overflow: hidden;
721
703
  box-sizing: border-box;
722
704
  width: var(--leaf-skeleton-width);
723
705
  height: var(--leaf-skeleton-height);
@@ -726,8 +708,6 @@
726
708
  }
727
709
 
728
710
  .leaf-skeleton__shimmer {
729
- position: absolute;
730
- inset: 0;
731
711
  background: linear-gradient(
732
712
  to right,
733
713
  transparent,
@@ -775,11 +755,7 @@
775
755
  20px
776
756
  );
777
757
 
778
- display: flex;
779
- flex-direction: column;
780
- /* Figma gap S (8) giữa Title/Unit và khối track+labels. */
781
- gap: 8px;
782
- width: 100%;
758
+ /* flex / flex-col / w-full / gap-s — class Leaf trên markup */
783
759
  box-sizing: border-box;
784
760
  font-family: var(--font-sans);
785
761
  font-size: var(--body-5-size);
@@ -790,40 +766,21 @@
790
766
  -webkit-user-select: none;
791
767
  }
792
768
 
793
- /* Figma gap XS (4) giữa track và Value labels. */
794
- .leaf-slider__body {
795
- display: flex;
796
- flex-direction: column;
797
- gap: 4px;
798
- width: 100%;
769
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
770
+ .leaf-slider[hidden] {
771
+ display: none;
799
772
  }
800
773
 
774
+ /* Figma gap XS (4) giữa track và Value labels. */
775
+ /* body — layout từ class Leaf trên markup */
776
+
801
777
  .leaf-slider__header {
802
- display: flex;
803
- align-items: flex-start;
804
- justify-content: space-between;
805
- gap: 8px;
806
- width: 100%;
807
778
  color: var(--text-primary);
808
- white-space: nowrap;
809
779
  user-select: text;
810
780
  -webkit-user-select: text;
811
781
  }
812
782
 
813
- .leaf-slider__title,
814
- .leaf-slider__unit {
815
- min-width: 0;
816
- }
817
-
818
- .leaf-slider__unit {
819
- text-align: right;
820
- }
821
-
822
783
  .leaf-slider__control {
823
- position: relative;
824
- display: flex;
825
- align-items: center;
826
- width: 100%;
827
784
  height: var(--leaf-slider-control-height);
828
785
  outline: none;
829
786
  cursor: pointer;
@@ -1002,37 +959,24 @@
1002
959
  --leaf-spinner-size: 24px;
1003
960
  --leaf-spinner-duration: 1.2s;
1004
961
 
1005
- display: inline-flex;
1006
- flex-shrink: 0;
1007
- align-items: center;
1008
- justify-content: center;
1009
962
  width: var(--leaf-spinner-size);
1010
963
  height: var(--leaf-spinner-size);
1011
964
  color: var(--base-quinary);
1012
- vertical-align: middle;
1013
965
  line-height: 0;
1014
966
  }
1015
967
 
1016
- .leaf-spinner__icon {
1017
- display: block;
1018
- width: 100%;
1019
- height: 100%;
1020
- }
968
+ /* icon: block size-full — class Leaf trên markup */
1021
969
 
1022
970
  /* Fullscreen overlay — pattern Spinner (portal + nền mờ). */
1023
971
  .leaf-spinner-overlay {
1024
- position: fixed;
1025
- inset: 0;
1026
972
  z-index: var(--leaf-z-spinner-overlay, 100);
1027
- display: flex;
1028
- align-items: center;
1029
- justify-content: center;
1030
973
  box-sizing: border-box;
1031
974
  background-color: var(--overlay);
1032
975
  color: var(--base-quinary);
1033
976
  }
1034
977
 
1035
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để HTML tĩnh ẩn được. */
978
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
979
+ .leaf-spinner[hidden],
1036
980
  .leaf-spinner-overlay[hidden] {
1037
981
  display: none;
1038
982
  }
@@ -1128,10 +1072,7 @@
1128
1072
  --leaf-tab-line-height: var(--body-3-line-height);
1129
1073
  --leaf-tab-font-weight: var(--body-3-highlight-weight);
1130
1074
 
1131
- display: flex;
1132
- flex-wrap: wrap;
1133
- align-items: center;
1134
- gap: 12px;
1075
+ /* flex / wrap / items / gap-m — class Leaf trên markup */
1135
1076
  }
1136
1077
 
1137
1078
  .leaf-tabs[data-size="lg"] {
@@ -1159,9 +1100,6 @@
1159
1100
  }
1160
1101
 
1161
1102
  .leaf-tab {
1162
- display: inline-flex;
1163
- align-items: center;
1164
- justify-content: center;
1165
1103
  border: none;
1166
1104
  margin: 0;
1167
1105
  padding: 0;
@@ -1170,9 +1108,14 @@
1170
1108
  color: inherit;
1171
1109
  font: inherit;
1172
1110
  font-family: var(--font-sans);
1173
- text-align: center;
1174
- white-space: nowrap;
1175
1111
  box-sizing: border-box;
1112
+ appearance: none;
1113
+ }
1114
+
1115
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
1116
+ .leaf-tabs[hidden],
1117
+ .leaf-tab[hidden] {
1118
+ display: none;
1176
1119
  }
1177
1120
 
1178
1121
  .leaf-tab:disabled,
@@ -1181,9 +1124,6 @@
1181
1124
  }
1182
1125
 
1183
1126
  .leaf-tab__label {
1184
- display: inline-flex;
1185
- align-items: center;
1186
- justify-content: center;
1187
1127
  line-height: inherit;
1188
1128
  }
1189
1129
 
@@ -1364,10 +1304,6 @@
1364
1304
  var(--leaf-toggle-width) - var(--leaf-toggle-padding) * 2 - var(--leaf-toggle-thumb)
1365
1305
  );
1366
1306
 
1367
- position: relative;
1368
- display: inline-flex;
1369
- flex-shrink: 0;
1370
- align-items: center;
1371
1307
  box-sizing: border-box;
1372
1308
  width: var(--leaf-toggle-width);
1373
1309
  height: var(--leaf-toggle-height);
@@ -1377,7 +1313,6 @@
1377
1313
  border-radius: 12px;
1378
1314
  background-color: var(--base-quaternary);
1379
1315
  cursor: pointer;
1380
- vertical-align: middle;
1381
1316
  appearance: none;
1382
1317
  -webkit-appearance: none;
1383
1318
  font: inherit;
@@ -1385,10 +1320,12 @@
1385
1320
  transition: background-color 0.2s ease;
1386
1321
  }
1387
1322
 
1323
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
1324
+ .leaf-toggle[hidden] {
1325
+ display: none;
1326
+ }
1327
+
1388
1328
  .leaf-toggle__thumb {
1389
- display: flex;
1390
- align-items: center;
1391
- justify-content: center;
1392
1329
  width: var(--leaf-toggle-thumb);
1393
1330
  height: var(--leaf-toggle-thumb);
1394
1331
  border-radius: 100px;
@@ -1462,13 +1399,6 @@
1462
1399
  */
1463
1400
 
1464
1401
  @layer components {
1465
- .leaf-tooltip-trigger {
1466
- position: relative;
1467
- display: inline-flex;
1468
- max-width: 100%;
1469
- vertical-align: middle;
1470
- }
1471
-
1472
1402
  .leaf-tooltip {
1473
1403
  --leaf-tooltip-pad-y: 8px;
1474
1404
  --leaf-tooltip-pad-x: 16px;
@@ -1483,6 +1413,7 @@
1483
1413
  /* Chiều rộng tam giác thật trong khung. */
1484
1414
  --leaf-tooltip-caret-tip: 12px;
1485
1415
 
1416
+ /* inline-flex — class Leaf; direction / align vẫn ở CSS (đổi theo data-position / data-align) */
1486
1417
  display: inline-flex;
1487
1418
  flex-direction: column;
1488
1419
  align-items: center;
@@ -1501,20 +1432,17 @@
1501
1432
  z-index: var(--leaf-z-tooltip, 110);
1502
1433
  }
1503
1434
 
1504
- /* `display` của .leaf-tooltip thắng `[hidden]` của trình duyệt — bản vanilla ẩn bubble bằng hidden. */
1435
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
1436
+ .leaf-tooltip-trigger[hidden],
1505
1437
  .leaf-tooltip[hidden] {
1506
1438
  display: none;
1507
1439
  }
1508
1440
 
1509
1441
  .leaf-tooltip__body {
1510
- position: relative;
1511
- z-index: 1;
1512
1442
  box-sizing: border-box;
1513
- max-width: 100%;
1514
1443
  padding: var(--leaf-tooltip-pad-y) var(--leaf-tooltip-pad-x);
1515
1444
  border-radius: var(--leaf-tooltip-radius);
1516
1445
  background-color: var(--base-quaternary);
1517
- text-align: left;
1518
1446
  word-break: break-word;
1519
1447
  }
1520
1448
 
@@ -1523,9 +1451,6 @@
1523
1451
  * Mặc định: mũi nhọn xuống (position=top — caret dưới body).
1524
1452
  */
1525
1453
  .leaf-tooltip__caret {
1526
- position: relative;
1527
- display: block;
1528
- flex-shrink: 0;
1529
1454
  width: var(--leaf-tooltip-caret-w);
1530
1455
  height: var(--leaf-tooltip-caret-h);
1531
1456
  background-color: transparent;
@@ -1661,24 +1586,19 @@
1661
1586
  /* --- src/styles/border.css --- */
1662
1587
 
1663
1588
  /*
1664
- * Border radius classes — map 1:1 sang --radius-* trong @finhay/leaf-tokens
1665
- * (Figma 700:4390).
1589
+ * Border classes — map 1:1 sang token trong @finhay/leaf-tokens.
1666
1590
  *
1667
- * Tên class `radius-*` (không dùng `rounded-*`) để không đụng utility bo góc mặc
1668
- * định của Tailwind (`rounded-xl`…). `border-*` đã dành cho màu viền.
1591
+ * Width: `border-s|m|l|xl` (+ biến thể cạnh `border-top-s`…).
1592
+ * Mỗi class set width + `border-style: solid` để một class là thấy viền
1593
+ * (không trông vào CSS reset).
1594
+ * Hậu tố width khác hậu tố màu (`border-primary`… chỉ set border-color).
1595
+ * Không có bậc 0 — không viền thì không gắn class.
1669
1596
  *
1670
- * Hậu tố = bậc token: 0 · xs · s · m · l · xl · 2xl.
1671
- * Chỉ set border-radius — width / style / color do app tự lo.
1597
+ * Radius: `radius-*` → border-radius. Hậu tố: s (4) · m (8) · l (12) · full.
1672
1598
  */
1673
1599
 
1674
1600
  @layer utilities {
1675
- .radius-0 {
1676
- border-radius: var(--radius-0);
1677
- }
1678
-
1679
- .radius-xs {
1680
- border-radius: var(--radius-xs);
1681
- }
1601
+ /* Radius */
1682
1602
 
1683
1603
  .radius-s {
1684
1604
  border-radius: var(--radius-s);
@@ -1692,12 +1612,154 @@
1692
1612
  border-radius: var(--radius-l);
1693
1613
  }
1694
1614
 
1695
- .radius-xl {
1696
- border-radius: var(--radius-xl);
1615
+ .radius-full {
1616
+ border-radius: var(--radius-full);
1617
+ }
1618
+
1619
+ /* All sides */
1620
+
1621
+ .border-s {
1622
+ border-width: var(--border-width-s);
1623
+ border-style: solid;
1624
+ }
1625
+
1626
+ .border-m {
1627
+ border-width: var(--border-width-m);
1628
+ border-style: solid;
1629
+ }
1630
+
1631
+ .border-l {
1632
+ border-width: var(--border-width-l);
1633
+ border-style: solid;
1634
+ }
1635
+
1636
+ .border-xl {
1637
+ border-width: var(--border-width-xl);
1638
+ border-style: solid;
1639
+ }
1640
+
1641
+ /* Per side */
1642
+
1643
+ .border-top-s {
1644
+ border-top-width: var(--border-width-s);
1645
+ border-top-style: solid;
1646
+ }
1647
+
1648
+ .border-top-m {
1649
+ border-top-width: var(--border-width-m);
1650
+ border-top-style: solid;
1651
+ }
1652
+
1653
+ .border-top-l {
1654
+ border-top-width: var(--border-width-l);
1655
+ border-top-style: solid;
1656
+ }
1657
+
1658
+ .border-top-xl {
1659
+ border-top-width: var(--border-width-xl);
1660
+ border-top-style: solid;
1661
+ }
1662
+
1663
+ .border-right-s {
1664
+ border-right-width: var(--border-width-s);
1665
+ border-right-style: solid;
1666
+ }
1667
+
1668
+ .border-right-m {
1669
+ border-right-width: var(--border-width-m);
1670
+ border-right-style: solid;
1671
+ }
1672
+
1673
+ .border-right-l {
1674
+ border-right-width: var(--border-width-l);
1675
+ border-right-style: solid;
1676
+ }
1677
+
1678
+ .border-right-xl {
1679
+ border-right-width: var(--border-width-xl);
1680
+ border-right-style: solid;
1681
+ }
1682
+
1683
+ .border-bottom-s {
1684
+ border-bottom-width: var(--border-width-s);
1685
+ border-bottom-style: solid;
1686
+ }
1687
+
1688
+ .border-bottom-m {
1689
+ border-bottom-width: var(--border-width-m);
1690
+ border-bottom-style: solid;
1691
+ }
1692
+
1693
+ .border-bottom-l {
1694
+ border-bottom-width: var(--border-width-l);
1695
+ border-bottom-style: solid;
1696
+ }
1697
+
1698
+ .border-bottom-xl {
1699
+ border-bottom-width: var(--border-width-xl);
1700
+ border-bottom-style: solid;
1701
+ }
1702
+
1703
+ .border-left-s {
1704
+ border-left-width: var(--border-width-s);
1705
+ border-left-style: solid;
1706
+ }
1707
+
1708
+ .border-left-m {
1709
+ border-left-width: var(--border-width-m);
1710
+ border-left-style: solid;
1711
+ }
1712
+
1713
+ .border-left-l {
1714
+ border-left-width: var(--border-width-l);
1715
+ border-left-style: solid;
1716
+ }
1717
+
1718
+ .border-left-xl {
1719
+ border-left-width: var(--border-width-xl);
1720
+ border-left-style: solid;
1721
+ }
1722
+
1723
+ /* Logical */
1724
+
1725
+ .border-inline-s {
1726
+ border-inline-width: var(--border-width-s);
1727
+ border-inline-style: solid;
1728
+ }
1729
+
1730
+ .border-inline-m {
1731
+ border-inline-width: var(--border-width-m);
1732
+ border-inline-style: solid;
1733
+ }
1734
+
1735
+ .border-inline-l {
1736
+ border-inline-width: var(--border-width-l);
1737
+ border-inline-style: solid;
1738
+ }
1739
+
1740
+ .border-inline-xl {
1741
+ border-inline-width: var(--border-width-xl);
1742
+ border-inline-style: solid;
1743
+ }
1744
+
1745
+ .border-block-s {
1746
+ border-block-width: var(--border-width-s);
1747
+ border-block-style: solid;
1748
+ }
1749
+
1750
+ .border-block-m {
1751
+ border-block-width: var(--border-width-m);
1752
+ border-block-style: solid;
1753
+ }
1754
+
1755
+ .border-block-l {
1756
+ border-block-width: var(--border-width-l);
1757
+ border-block-style: solid;
1697
1758
  }
1698
1759
 
1699
- .radius-2xl {
1700
- border-radius: var(--radius-2xl);
1760
+ .border-block-xl {
1761
+ border-block-width: var(--border-width-xl);
1762
+ border-block-style: solid;
1701
1763
  }
1702
1764
  }
1703
1765
 
@@ -1709,33 +1771,28 @@
1709
1771
  * Quy tắc tên: **tiền tố nói thuộc tính, phần sau nói vai trò của token**.
1710
1772
  *
1711
1773
  * text-* → color (text-primary, text-red)
1712
- * base-* → background-color (base-primary, base-red)
1774
+ * bg-* → background-color (bg-primary, bg-red) — token vẫn là --base-*
1713
1775
  * border-* → border-color (border-primary, border-red)
1714
1776
  *
1715
- * Ba bộ dùng chung một hậu tố nên đọc là đoán được: `text-red` / `base-red` /
1716
- * `border-red`, `text-primary` / `base-primary` / `border-primary`. Nhóm system
1777
+ * Ba bộ dùng chung một hậu tố nên đọc là đoán được: `text-red` / `bg-red` /
1778
+ * `border-red`, `text-primary` / `bg-primary` / `border-primary`. Nhóm system
1717
1779
  * bỏ chữ `system` trong tên class (token vẫn là `--system-red`), còn `border-*`
1718
1780
  * lấy màu từ thang base vì viền luôn là màu bề mặt. Secondary của system giữ
1719
1781
  * hậu tố `-secondary` (vd. `text-red-secondary` ↔ `--system-red-secondary`).
1720
1782
  *
1721
1783
  * Mỗi class chỉ set đúng 1 thuộc tính (color / background-color / border-color)
1722
- * — border-width và border-style do app tự lo. Class tự đổi giá trị theo
1723
- * `[data-theme="light"]` vì nó trỏ vào var, không hard-code màu.
1784
+ * — độ dày / style viền dùng class width (`border-s`…) trong `border.css`.
1785
+ * Class tự đổi giá trị theo `[data-theme="light"]` vì nó trỏ vào var, không hard-code màu.
1724
1786
  *
1725
1787
  * Chỉ semantic token mới có class. Primitive (--neutral-500, --brand-300…) là
1726
1788
  * nguồn nội bộ, không dùng thẳng trong UI.
1727
1789
  *
1728
1790
  * ─ Vì sao `@layer utilities` ─────────────────────────────────────────────────
1729
1791
  *
1730
- * Màu của Leaf là token gốc, trùng tên thì phải thắng. Đặt chung layer với
1731
- * utility của Tailwind, và app import file này SAU `@import "tailwindcss"`, nên
1732
- * khi app cũng khai báo `--color-primary` / `--color-red` trong `@theme` thì
1733
- * `.text-primary` của Leaf (cùng specificity, đứng sau) là cái có hiệu lực.
1792
+ * Màu của Leaf là token gốc, trùng tên thì phải thắng. Đặt ở layer cao nhất
1793
+ * nên `.text-primary` của Leaf luôn có hiệu lực khi trùng tên.
1734
1794
  *
1735
- * Biến thể trạng thái vẫn override được vì pseudo-class cộng thêm specificity:
1736
- * `hover:text-[var(--text-highlight)]`, `focus:…` thắng bình thường. Riêng biến
1737
- * thể responsive (`md:`, `lg:`) cùng specificity và được Tailwind ghi ra trước
1738
- * file này nên phải thêm important modifier: `md:text-[var(--text-secondary)]!`.
1795
+ * Biến thể trạng thái vẫn override được vì pseudo-class cộng thêm specificity.
1739
1796
  */
1740
1797
 
1741
1798
  @layer utilities {
@@ -1811,79 +1868,79 @@
1811
1868
  color: var(--system-purple-secondary);
1812
1869
  }
1813
1870
 
1814
- /* Background — base */
1871
+ /* Background — surface (--base-*) + system */
1815
1872
 
1816
- .base-highlight {
1873
+ .bg-highlight {
1817
1874
  background-color: var(--text-highlight);
1818
1875
  }
1819
1876
 
1820
- .base-primary {
1877
+ .bg-primary {
1821
1878
  background-color: var(--base-primary);
1822
1879
  }
1823
1880
 
1824
- .base-secondary {
1881
+ .bg-secondary {
1825
1882
  background-color: var(--base-secondary);
1826
1883
  }
1827
1884
 
1828
- .base-tertiary {
1885
+ .bg-tertiary {
1829
1886
  background-color: var(--base-tertiary);
1830
1887
  }
1831
1888
 
1832
- .base-quaternary {
1889
+ .bg-quaternary {
1833
1890
  background-color: var(--base-quaternary);
1834
1891
  }
1835
1892
 
1836
- .base-quinary {
1893
+ .bg-quinary {
1837
1894
  background-color: var(--base-quinary);
1838
1895
  }
1839
1896
 
1840
1897
  /* Background — system */
1841
1898
 
1842
- .base-blue {
1899
+ .bg-blue {
1843
1900
  background-color: var(--system-blue);
1844
1901
  }
1845
1902
 
1846
- .base-green {
1903
+ .bg-green {
1847
1904
  background-color: var(--system-green);
1848
1905
  }
1849
1906
 
1850
- .base-yellow {
1907
+ .bg-yellow {
1851
1908
  background-color: var(--system-yellow);
1852
1909
  }
1853
1910
 
1854
- .base-orange {
1911
+ .bg-orange {
1855
1912
  background-color: var(--system-orange);
1856
1913
  }
1857
1914
 
1858
- .base-red {
1915
+ .bg-red {
1859
1916
  background-color: var(--system-red);
1860
1917
  }
1861
1918
 
1862
- .base-purple {
1919
+ .bg-purple {
1863
1920
  background-color: var(--system-purple);
1864
1921
  }
1865
1922
 
1866
- .base-blue-secondary {
1923
+ .bg-blue-secondary {
1867
1924
  background-color: var(--system-blue-secondary);
1868
1925
  }
1869
1926
 
1870
- .base-green-secondary {
1927
+ .bg-green-secondary {
1871
1928
  background-color: var(--system-green-secondary);
1872
1929
  }
1873
1930
 
1874
- .base-yellow-secondary {
1931
+ .bg-yellow-secondary {
1875
1932
  background-color: var(--system-yellow-secondary);
1876
1933
  }
1877
1934
 
1878
- .base-orange-secondary {
1935
+ .bg-orange-secondary {
1879
1936
  background-color: var(--system-orange-secondary);
1880
1937
  }
1881
1938
 
1882
- .base-red-secondary {
1939
+ .bg-red-secondary {
1883
1940
  background-color: var(--system-red-secondary);
1884
1941
  }
1885
1942
 
1886
- .base-purple-secondary {
1943
+ .bg-purple-secondary {
1887
1944
  background-color: var(--system-purple-secondary);
1888
1945
  }
1889
1946
 
@@ -1964,96 +2021,1444 @@
1964
2021
  }
1965
2022
  }
1966
2023
 
1967
- /* --- src/styles/spacing.css --- */
2024
+ /* --- src/styles/flex.css --- */
1968
2025
 
1969
2026
  /*
1970
- * Spacing classes — map 1:1 sang --spacing-* trong @finhay/leaf-tokens (Figma 34:1034).
2027
+ * Flex + alignment classes.
1971
2028
  *
1972
- * Tiền tố = thuộc tính (giống color): p-* / m-* / gap-* (+ biến thể hướng).
1973
- * Hậu tố = bậc token: 0 · xs · s · m · l · xl · 2xl … 7xl.
2029
+ * Display, hướng, wrap, grow/shrink/basis, và căn chỉnh (justify / items / self /
2030
+ * content). Nhóm căn chỉnh dùng chung cho grid.
1974
2031
  *
1975
- * Chỉ set đúng 1 thuộc tính spacing — không đụng width/height/radius.
1976
- * Nằm trong @layer utilities để Leaf thắng khi trùng tên với utility Tailwind
1977
- * (import sau @import "tailwindcss"), giống color.css.
2032
+ * Nằm trong @layer components — SCSS module (ngoài layer) đè được class Leaf.
2033
+ *
2034
+ * `.flex[hidden]`… specificity cao hơn class display nên `hidden` luôn ẩn.
1978
2035
  */
1979
2036
 
1980
- @layer utilities {
1981
- /* Padding */
2037
+ @layer components {
2038
+ .block {
2039
+ display: block;
2040
+ }
1982
2041
 
1983
- .p-0 {
1984
- padding: var(--spacing-0);
2042
+ .inline-block {
2043
+ display: inline-block;
1985
2044
  }
1986
2045
 
1987
- .p-xs {
1988
- padding: var(--spacing-xs);
2046
+ .inline {
2047
+ display: inline;
1989
2048
  }
1990
2049
 
1991
- .p-s {
1992
- padding: var(--spacing-s);
2050
+ .hidden {
2051
+ display: none;
1993
2052
  }
1994
2053
 
1995
- .p-m {
1996
- padding: var(--spacing-m);
2054
+ .flex {
2055
+ display: flex;
1997
2056
  }
1998
2057
 
1999
- .p-l {
2000
- padding: var(--spacing-l);
2058
+ .inline-flex {
2059
+ display: inline-flex;
2001
2060
  }
2002
2061
 
2003
- .p-xl {
2004
- padding: var(--spacing-xl);
2062
+ .block[hidden],
2063
+ .inline-block[hidden],
2064
+ .inline[hidden],
2065
+ .flex[hidden],
2066
+ .inline-flex[hidden] {
2067
+ display: none;
2005
2068
  }
2006
2069
 
2007
- .p-2xl {
2008
- padding: var(--spacing-2xl);
2070
+ .flex-row {
2071
+ flex-direction: row;
2009
2072
  }
2010
2073
 
2011
- .p-3xl {
2012
- padding: var(--spacing-3xl);
2074
+ .flex-row-reverse {
2075
+ flex-direction: row-reverse;
2013
2076
  }
2014
2077
 
2015
- .p-4xl {
2016
- padding: var(--spacing-4xl);
2078
+ .flex-col {
2079
+ flex-direction: column;
2017
2080
  }
2018
2081
 
2019
- .p-5xl {
2020
- padding: var(--spacing-5xl);
2082
+ .flex-col-reverse {
2083
+ flex-direction: column-reverse;
2021
2084
  }
2022
2085
 
2023
- .p-6xl {
2024
- padding: var(--spacing-6xl);
2086
+ .flex-wrap {
2087
+ flex-wrap: wrap;
2025
2088
  }
2026
2089
 
2027
- .p-7xl {
2028
- padding: var(--spacing-7xl);
2090
+ .flex-wrap-reverse {
2091
+ flex-wrap: wrap-reverse;
2029
2092
  }
2030
2093
 
2031
- .px-0 {
2032
- padding-inline: var(--spacing-0);
2094
+ .flex-nowrap {
2095
+ flex-wrap: nowrap;
2033
2096
  }
2034
2097
 
2035
- .px-xs {
2036
- padding-inline: var(--spacing-xs);
2098
+ .flex-1 {
2099
+ flex: 1;
2037
2100
  }
2038
2101
 
2039
- .px-s {
2040
- padding-inline: var(--spacing-s);
2102
+ .flex-auto {
2103
+ flex: auto;
2041
2104
  }
2042
2105
 
2043
- .px-m {
2044
- padding-inline: var(--spacing-m);
2106
+ .flex-initial {
2107
+ flex: 0 auto;
2045
2108
  }
2046
2109
 
2047
- .px-l {
2048
- padding-inline: var(--spacing-l);
2110
+ .flex-none {
2111
+ flex: none;
2049
2112
  }
2050
2113
 
2051
- .px-xl {
2052
- padding-inline: var(--spacing-xl);
2114
+ .grow {
2115
+ flex-grow: 1;
2053
2116
  }
2054
2117
 
2055
- .px-2xl {
2056
- padding-inline: var(--spacing-2xl);
2118
+ .grow-0 {
2119
+ flex-grow: 0;
2120
+ }
2121
+
2122
+ .shrink {
2123
+ flex-shrink: 1;
2124
+ }
2125
+
2126
+ .shrink-0 {
2127
+ flex-shrink: 0;
2128
+ }
2129
+
2130
+ .basis-0 {
2131
+ flex-basis: 0px;
2132
+ }
2133
+
2134
+ .basis-auto {
2135
+ flex-basis: auto;
2136
+ }
2137
+
2138
+ .basis-full {
2139
+ flex-basis: 100%;
2140
+ }
2141
+
2142
+ .justify-start {
2143
+ justify-content: flex-start;
2144
+ }
2145
+
2146
+ .justify-end {
2147
+ justify-content: flex-end;
2148
+ }
2149
+
2150
+ .justify-center {
2151
+ justify-content: center;
2152
+ }
2153
+
2154
+ .justify-between {
2155
+ justify-content: space-between;
2156
+ }
2157
+
2158
+ .justify-around {
2159
+ justify-content: space-around;
2160
+ }
2161
+
2162
+ .justify-evenly {
2163
+ justify-content: space-evenly;
2164
+ }
2165
+
2166
+ .justify-stretch {
2167
+ justify-content: stretch;
2168
+ }
2169
+
2170
+ .justify-normal {
2171
+ justify-content: normal;
2172
+ }
2173
+
2174
+ .items-start {
2175
+ align-items: flex-start;
2176
+ }
2177
+
2178
+ .items-end {
2179
+ align-items: flex-end;
2180
+ }
2181
+
2182
+ .items-center {
2183
+ align-items: center;
2184
+ }
2185
+
2186
+ .items-baseline {
2187
+ align-items: baseline;
2188
+ }
2189
+
2190
+ .items-stretch {
2191
+ align-items: stretch;
2192
+ }
2193
+
2194
+ .self-auto {
2195
+ align-self: auto;
2196
+ }
2197
+
2198
+ .self-start {
2199
+ align-self: flex-start;
2200
+ }
2201
+
2202
+ .self-end {
2203
+ align-self: flex-end;
2204
+ }
2205
+
2206
+ .self-center {
2207
+ align-self: center;
2208
+ }
2209
+
2210
+ .self-baseline {
2211
+ align-self: baseline;
2212
+ }
2213
+
2214
+ .self-stretch {
2215
+ align-self: stretch;
2216
+ }
2217
+
2218
+ .content-start {
2219
+ align-content: flex-start;
2220
+ }
2221
+
2222
+ .content-end {
2223
+ align-content: flex-end;
2224
+ }
2225
+
2226
+ .content-center {
2227
+ align-content: center;
2228
+ }
2229
+
2230
+ .content-between {
2231
+ align-content: space-between;
2232
+ }
2233
+
2234
+ .content-around {
2235
+ align-content: space-around;
2236
+ }
2237
+
2238
+ .content-evenly {
2239
+ align-content: space-evenly;
2240
+ }
2241
+
2242
+ .content-stretch {
2243
+ align-content: stretch;
2244
+ }
2245
+
2246
+ .content-normal {
2247
+ align-content: normal;
2248
+ }
2249
+ }
2250
+
2251
+ /* --- src/styles/grid.css --- */
2252
+
2253
+ /*
2254
+ * Grid classes.
2255
+ *
2256
+ * Display, template columns/rows, span/start/end, flow, auto-cols/rows, và
2257
+ * place/justify-items/self. Gap dùng class spacing (`gap-*`).
2258
+ *
2259
+ * Nằm trong @layer components (cùng lý do với flex.css).
2260
+ */
2261
+
2262
+ @layer components {
2263
+ .grid {
2264
+ display: grid;
2265
+ }
2266
+
2267
+ .inline-grid {
2268
+ display: inline-grid;
2269
+ }
2270
+
2271
+ /* `hidden` luôn ẩn — cùng lý do với flex.css. */
2272
+ .grid[hidden],
2273
+ .inline-grid[hidden] {
2274
+ display: none;
2275
+ }
2276
+
2277
+ .grid-cols-1 {
2278
+ grid-template-columns: repeat(1, minmax(0, 1fr));
2279
+ }
2280
+
2281
+ .grid-cols-2 {
2282
+ grid-template-columns: repeat(2, minmax(0, 1fr));
2283
+ }
2284
+
2285
+ .grid-cols-3 {
2286
+ grid-template-columns: repeat(3, minmax(0, 1fr));
2287
+ }
2288
+
2289
+ .grid-cols-4 {
2290
+ grid-template-columns: repeat(4, minmax(0, 1fr));
2291
+ }
2292
+
2293
+ .grid-cols-5 {
2294
+ grid-template-columns: repeat(5, minmax(0, 1fr));
2295
+ }
2296
+
2297
+ .grid-cols-6 {
2298
+ grid-template-columns: repeat(6, minmax(0, 1fr));
2299
+ }
2300
+
2301
+ .grid-cols-7 {
2302
+ grid-template-columns: repeat(7, minmax(0, 1fr));
2303
+ }
2304
+
2305
+ .grid-cols-8 {
2306
+ grid-template-columns: repeat(8, minmax(0, 1fr));
2307
+ }
2308
+
2309
+ .grid-cols-9 {
2310
+ grid-template-columns: repeat(9, minmax(0, 1fr));
2311
+ }
2312
+
2313
+ .grid-cols-10 {
2314
+ grid-template-columns: repeat(10, minmax(0, 1fr));
2315
+ }
2316
+
2317
+ .grid-cols-11 {
2318
+ grid-template-columns: repeat(11, minmax(0, 1fr));
2319
+ }
2320
+
2321
+ .grid-cols-12 {
2322
+ grid-template-columns: repeat(12, minmax(0, 1fr));
2323
+ }
2324
+
2325
+ .grid-cols-none {
2326
+ grid-template-columns: none;
2327
+ }
2328
+
2329
+ .grid-cols-subgrid {
2330
+ grid-template-columns: subgrid;
2331
+ }
2332
+
2333
+ .col-span-1 {
2334
+ grid-column: span 1 / span 1;
2335
+ }
2336
+
2337
+ .col-span-2 {
2338
+ grid-column: span 2 / span 2;
2339
+ }
2340
+
2341
+ .col-span-3 {
2342
+ grid-column: span 3 / span 3;
2343
+ }
2344
+
2345
+ .col-span-4 {
2346
+ grid-column: span 4 / span 4;
2347
+ }
2348
+
2349
+ .col-span-5 {
2350
+ grid-column: span 5 / span 5;
2351
+ }
2352
+
2353
+ .col-span-6 {
2354
+ grid-column: span 6 / span 6;
2355
+ }
2356
+
2357
+ .col-span-7 {
2358
+ grid-column: span 7 / span 7;
2359
+ }
2360
+
2361
+ .col-span-8 {
2362
+ grid-column: span 8 / span 8;
2363
+ }
2364
+
2365
+ .col-span-9 {
2366
+ grid-column: span 9 / span 9;
2367
+ }
2368
+
2369
+ .col-span-10 {
2370
+ grid-column: span 10 / span 10;
2371
+ }
2372
+
2373
+ .col-span-11 {
2374
+ grid-column: span 11 / span 11;
2375
+ }
2376
+
2377
+ .col-span-12 {
2378
+ grid-column: span 12 / span 12;
2379
+ }
2380
+
2381
+ .col-span-full {
2382
+ grid-column: 1 / -1;
2383
+ }
2384
+
2385
+ .col-auto {
2386
+ grid-column: auto;
2387
+ }
2388
+
2389
+ .col-start-1 {
2390
+ grid-column-start: 1;
2391
+ }
2392
+
2393
+ .col-start-2 {
2394
+ grid-column-start: 2;
2395
+ }
2396
+
2397
+ .col-start-3 {
2398
+ grid-column-start: 3;
2399
+ }
2400
+
2401
+ .col-start-4 {
2402
+ grid-column-start: 4;
2403
+ }
2404
+
2405
+ .col-start-5 {
2406
+ grid-column-start: 5;
2407
+ }
2408
+
2409
+ .col-start-6 {
2410
+ grid-column-start: 6;
2411
+ }
2412
+
2413
+ .col-start-7 {
2414
+ grid-column-start: 7;
2415
+ }
2416
+
2417
+ .col-start-8 {
2418
+ grid-column-start: 8;
2419
+ }
2420
+
2421
+ .col-start-9 {
2422
+ grid-column-start: 9;
2423
+ }
2424
+
2425
+ .col-start-10 {
2426
+ grid-column-start: 10;
2427
+ }
2428
+
2429
+ .col-start-11 {
2430
+ grid-column-start: 11;
2431
+ }
2432
+
2433
+ .col-start-12 {
2434
+ grid-column-start: 12;
2435
+ }
2436
+
2437
+ .col-start-13 {
2438
+ grid-column-start: 13;
2439
+ }
2440
+
2441
+ .col-start-auto {
2442
+ grid-column-start: auto;
2443
+ }
2444
+
2445
+ .col-end-1 {
2446
+ grid-column-end: 1;
2447
+ }
2448
+
2449
+ .col-end-2 {
2450
+ grid-column-end: 2;
2451
+ }
2452
+
2453
+ .col-end-3 {
2454
+ grid-column-end: 3;
2455
+ }
2456
+
2457
+ .col-end-4 {
2458
+ grid-column-end: 4;
2459
+ }
2460
+
2461
+ .col-end-5 {
2462
+ grid-column-end: 5;
2463
+ }
2464
+
2465
+ .col-end-6 {
2466
+ grid-column-end: 6;
2467
+ }
2468
+
2469
+ .col-end-7 {
2470
+ grid-column-end: 7;
2471
+ }
2472
+
2473
+ .col-end-8 {
2474
+ grid-column-end: 8;
2475
+ }
2476
+
2477
+ .col-end-9 {
2478
+ grid-column-end: 9;
2479
+ }
2480
+
2481
+ .col-end-10 {
2482
+ grid-column-end: 10;
2483
+ }
2484
+
2485
+ .col-end-11 {
2486
+ grid-column-end: 11;
2487
+ }
2488
+
2489
+ .col-end-12 {
2490
+ grid-column-end: 12;
2491
+ }
2492
+
2493
+ .col-end-13 {
2494
+ grid-column-end: 13;
2495
+ }
2496
+
2497
+ .col-end-auto {
2498
+ grid-column-end: auto;
2499
+ }
2500
+
2501
+ .grid-rows-1 {
2502
+ grid-template-rows: repeat(1, minmax(0, 1fr));
2503
+ }
2504
+
2505
+ .grid-rows-2 {
2506
+ grid-template-rows: repeat(2, minmax(0, 1fr));
2507
+ }
2508
+
2509
+ .grid-rows-3 {
2510
+ grid-template-rows: repeat(3, minmax(0, 1fr));
2511
+ }
2512
+
2513
+ .grid-rows-4 {
2514
+ grid-template-rows: repeat(4, minmax(0, 1fr));
2515
+ }
2516
+
2517
+ .grid-rows-5 {
2518
+ grid-template-rows: repeat(5, minmax(0, 1fr));
2519
+ }
2520
+
2521
+ .grid-rows-6 {
2522
+ grid-template-rows: repeat(6, minmax(0, 1fr));
2523
+ }
2524
+
2525
+ .grid-rows-none {
2526
+ grid-template-rows: none;
2527
+ }
2528
+
2529
+ .grid-rows-subgrid {
2530
+ grid-template-rows: subgrid;
2531
+ }
2532
+
2533
+ .row-span-1 {
2534
+ grid-row: span 1 / span 1;
2535
+ }
2536
+
2537
+ .row-span-2 {
2538
+ grid-row: span 2 / span 2;
2539
+ }
2540
+
2541
+ .row-span-3 {
2542
+ grid-row: span 3 / span 3;
2543
+ }
2544
+
2545
+ .row-span-4 {
2546
+ grid-row: span 4 / span 4;
2547
+ }
2548
+
2549
+ .row-span-5 {
2550
+ grid-row: span 5 / span 5;
2551
+ }
2552
+
2553
+ .row-span-6 {
2554
+ grid-row: span 6 / span 6;
2555
+ }
2556
+
2557
+ .row-span-full {
2558
+ grid-row: 1 / -1;
2559
+ }
2560
+
2561
+ .row-auto {
2562
+ grid-row: auto;
2563
+ }
2564
+
2565
+ .row-start-1 {
2566
+ grid-row-start: 1;
2567
+ }
2568
+
2569
+ .row-start-2 {
2570
+ grid-row-start: 2;
2571
+ }
2572
+
2573
+ .row-start-3 {
2574
+ grid-row-start: 3;
2575
+ }
2576
+
2577
+ .row-start-4 {
2578
+ grid-row-start: 4;
2579
+ }
2580
+
2581
+ .row-start-5 {
2582
+ grid-row-start: 5;
2583
+ }
2584
+
2585
+ .row-start-6 {
2586
+ grid-row-start: 6;
2587
+ }
2588
+
2589
+ .row-start-7 {
2590
+ grid-row-start: 7;
2591
+ }
2592
+
2593
+ .row-start-auto {
2594
+ grid-row-start: auto;
2595
+ }
2596
+
2597
+ .row-end-1 {
2598
+ grid-row-end: 1;
2599
+ }
2600
+
2601
+ .row-end-2 {
2602
+ grid-row-end: 2;
2603
+ }
2604
+
2605
+ .row-end-3 {
2606
+ grid-row-end: 3;
2607
+ }
2608
+
2609
+ .row-end-4 {
2610
+ grid-row-end: 4;
2611
+ }
2612
+
2613
+ .row-end-5 {
2614
+ grid-row-end: 5;
2615
+ }
2616
+
2617
+ .row-end-6 {
2618
+ grid-row-end: 6;
2619
+ }
2620
+
2621
+ .row-end-7 {
2622
+ grid-row-end: 7;
2623
+ }
2624
+
2625
+ .row-end-auto {
2626
+ grid-row-end: auto;
2627
+ }
2628
+
2629
+ .grid-flow-row {
2630
+ grid-auto-flow: row;
2631
+ }
2632
+
2633
+ .grid-flow-col {
2634
+ grid-auto-flow: column;
2635
+ }
2636
+
2637
+ .grid-flow-dense {
2638
+ grid-auto-flow: dense;
2639
+ }
2640
+
2641
+ .grid-flow-row-dense {
2642
+ grid-auto-flow: row dense;
2643
+ }
2644
+
2645
+ .grid-flow-col-dense {
2646
+ grid-auto-flow: column dense;
2647
+ }
2648
+
2649
+ .auto-cols-auto {
2650
+ grid-auto-columns: auto;
2651
+ }
2652
+
2653
+ .auto-cols-min {
2654
+ grid-auto-columns: min-content;
2655
+ }
2656
+
2657
+ .auto-cols-max {
2658
+ grid-auto-columns: max-content;
2659
+ }
2660
+
2661
+ .auto-cols-fr {
2662
+ grid-auto-columns: minmax(0, 1fr);
2663
+ }
2664
+
2665
+ .auto-rows-auto {
2666
+ grid-auto-rows: auto;
2667
+ }
2668
+
2669
+ .auto-rows-min {
2670
+ grid-auto-rows: min-content;
2671
+ }
2672
+
2673
+ .auto-rows-max {
2674
+ grid-auto-rows: max-content;
2675
+ }
2676
+
2677
+ .auto-rows-fr {
2678
+ grid-auto-rows: minmax(0, 1fr);
2679
+ }
2680
+
2681
+ .justify-items-start {
2682
+ justify-items: start;
2683
+ }
2684
+
2685
+ .justify-items-end {
2686
+ justify-items: end;
2687
+ }
2688
+
2689
+ .justify-items-center {
2690
+ justify-items: center;
2691
+ }
2692
+
2693
+ .justify-items-stretch {
2694
+ justify-items: stretch;
2695
+ }
2696
+
2697
+ .justify-self-auto {
2698
+ justify-self: auto;
2699
+ }
2700
+
2701
+ .justify-self-start {
2702
+ justify-self: flex-start;
2703
+ }
2704
+
2705
+ .justify-self-end {
2706
+ justify-self: flex-end;
2707
+ }
2708
+
2709
+ .justify-self-center {
2710
+ justify-self: center;
2711
+ }
2712
+
2713
+ .justify-self-stretch {
2714
+ justify-self: stretch;
2715
+ }
2716
+
2717
+ .place-content-center {
2718
+ place-content: center;
2719
+ }
2720
+
2721
+ .place-content-start {
2722
+ place-content: start;
2723
+ }
2724
+
2725
+ .place-content-end {
2726
+ place-content: end;
2727
+ }
2728
+
2729
+ .place-content-between {
2730
+ place-content: space-between;
2731
+ }
2732
+
2733
+ .place-content-around {
2734
+ place-content: space-around;
2735
+ }
2736
+
2737
+ .place-content-evenly {
2738
+ place-content: space-evenly;
2739
+ }
2740
+
2741
+ .place-content-stretch {
2742
+ place-content: stretch;
2743
+ }
2744
+
2745
+ .place-items-start {
2746
+ place-items: start;
2747
+ }
2748
+
2749
+ .place-items-end {
2750
+ place-items: end;
2751
+ }
2752
+
2753
+ .place-items-center {
2754
+ place-items: center;
2755
+ }
2756
+
2757
+ .place-items-stretch {
2758
+ place-items: stretch;
2759
+ }
2760
+
2761
+ .place-self-auto {
2762
+ place-self: auto;
2763
+ }
2764
+
2765
+ .place-self-start {
2766
+ place-self: start;
2767
+ }
2768
+
2769
+ .place-self-end {
2770
+ place-self: end;
2771
+ }
2772
+
2773
+ .place-self-center {
2774
+ place-self: center;
2775
+ }
2776
+
2777
+ .place-self-stretch {
2778
+ place-self: stretch;
2779
+ }
2780
+ }
2781
+
2782
+ /* --- src/styles/overflow.css --- */
2783
+
2784
+ /*
2785
+ * Overflow classes.
2786
+ *
2787
+ * Nằm trong @layer components (cùng lý do với flex.css).
2788
+ */
2789
+
2790
+ @layer components {
2791
+ .overflow-auto {
2792
+ overflow: auto;
2793
+ }
2794
+
2795
+ .overflow-hidden {
2796
+ overflow: hidden;
2797
+ }
2798
+
2799
+ .overflow-clip {
2800
+ overflow: clip;
2801
+ }
2802
+
2803
+ .overflow-visible {
2804
+ overflow: visible;
2805
+ }
2806
+
2807
+ .overflow-scroll {
2808
+ overflow: scroll;
2809
+ }
2810
+
2811
+ .overflow-x-auto {
2812
+ overflow-x: auto;
2813
+ }
2814
+
2815
+ .overflow-x-hidden {
2816
+ overflow-x: hidden;
2817
+ }
2818
+
2819
+ .overflow-x-clip {
2820
+ overflow-x: clip;
2821
+ }
2822
+
2823
+ .overflow-x-visible {
2824
+ overflow-x: visible;
2825
+ }
2826
+
2827
+ .overflow-x-scroll {
2828
+ overflow-x: scroll;
2829
+ }
2830
+
2831
+ .overflow-y-auto {
2832
+ overflow-y: auto;
2833
+ }
2834
+
2835
+ .overflow-y-hidden {
2836
+ overflow-y: hidden;
2837
+ }
2838
+
2839
+ .overflow-y-clip {
2840
+ overflow-y: clip;
2841
+ }
2842
+
2843
+ .overflow-y-visible {
2844
+ overflow-y: visible;
2845
+ }
2846
+
2847
+ .overflow-y-scroll {
2848
+ overflow-y: scroll;
2849
+ }
2850
+ }
2851
+
2852
+ /* --- src/styles/position.css --- */
2853
+
2854
+ /*
2855
+ * Position classes — position, inset cơ bản, z-index scale.
2856
+ *
2857
+ * Nằm trong @layer components (cùng lý do với flex.css).
2858
+ */
2859
+
2860
+ @layer components {
2861
+ .static {
2862
+ position: static;
2863
+ }
2864
+
2865
+ .relative {
2866
+ position: relative;
2867
+ }
2868
+
2869
+ .absolute {
2870
+ position: absolute;
2871
+ }
2872
+
2873
+ .fixed {
2874
+ position: fixed;
2875
+ }
2876
+
2877
+ .sticky {
2878
+ position: sticky;
2879
+ }
2880
+
2881
+ .inset-0 {
2882
+ inset: 0px;
2883
+ }
2884
+
2885
+ .inset-auto {
2886
+ inset: auto;
2887
+ }
2888
+
2889
+ .inset-x-0 {
2890
+ inset-inline: 0px;
2891
+ }
2892
+
2893
+ .inset-y-0 {
2894
+ inset-block: 0px;
2895
+ }
2896
+
2897
+ .top-0 {
2898
+ top: 0px;
2899
+ }
2900
+
2901
+ .top-auto {
2902
+ top: auto;
2903
+ }
2904
+
2905
+ .top-full {
2906
+ top: 100%;
2907
+ }
2908
+
2909
+ .top-1\/2 {
2910
+ top: calc(1 / 2 * 100%);
2911
+ }
2912
+
2913
+ .right-0 {
2914
+ right: 0px;
2915
+ }
2916
+
2917
+ .right-auto {
2918
+ right: auto;
2919
+ }
2920
+
2921
+ .right-full {
2922
+ right: 100%;
2923
+ }
2924
+
2925
+ .right-1\/2 {
2926
+ right: calc(1 / 2 * 100%);
2927
+ }
2928
+
2929
+ .bottom-0 {
2930
+ bottom: 0px;
2931
+ }
2932
+
2933
+ .bottom-auto {
2934
+ bottom: auto;
2935
+ }
2936
+
2937
+ .bottom-full {
2938
+ bottom: 100%;
2939
+ }
2940
+
2941
+ .bottom-1\/2 {
2942
+ bottom: calc(1 / 2 * 100%);
2943
+ }
2944
+
2945
+ .left-0 {
2946
+ left: 0px;
2947
+ }
2948
+
2949
+ .left-auto {
2950
+ left: auto;
2951
+ }
2952
+
2953
+ .left-full {
2954
+ left: 100%;
2955
+ }
2956
+
2957
+ .left-1\/2 {
2958
+ left: calc(1 / 2 * 100%);
2959
+ }
2960
+
2961
+ .z-0 {
2962
+ z-index: 0;
2963
+ }
2964
+
2965
+ .z-10 {
2966
+ z-index: 10;
2967
+ }
2968
+
2969
+ .z-20 {
2970
+ z-index: 20;
2971
+ }
2972
+
2973
+ .z-30 {
2974
+ z-index: 30;
2975
+ }
2976
+
2977
+ .z-40 {
2978
+ z-index: 40;
2979
+ }
2980
+
2981
+ .z-50 {
2982
+ z-index: 50;
2983
+ }
2984
+
2985
+ .z-auto {
2986
+ z-index: auto;
2987
+ }
2988
+ }
2989
+
2990
+ /* --- src/styles/sizing.css --- */
2991
+
2992
+ /*
2993
+ * Sizing classes — keyword + phân số.
2994
+ *
2995
+ * Chỉ size tương đối / keyword (`full`, `auto`, `1/2`…). Size cố định (w-80…)
2996
+ * để app viết trong SCSS module.
2997
+ *
2998
+ * Nằm trong @layer components (cùng lý do với flex.css).
2999
+ */
3000
+
3001
+ @layer components {
3002
+ .w-0 {
3003
+ width: 0px;
3004
+ }
3005
+
3006
+ .w-px {
3007
+ width: 1px;
3008
+ }
3009
+
3010
+ .w-full {
3011
+ width: 100%;
3012
+ }
3013
+
3014
+ .w-auto {
3015
+ width: auto;
3016
+ }
3017
+
3018
+ .w-fit {
3019
+ width: fit-content;
3020
+ }
3021
+
3022
+ .w-min {
3023
+ width: min-content;
3024
+ }
3025
+
3026
+ .w-max {
3027
+ width: max-content;
3028
+ }
3029
+
3030
+ .w-screen {
3031
+ width: 100vw;
3032
+ }
3033
+
3034
+ .h-0 {
3035
+ height: 0px;
3036
+ }
3037
+
3038
+ .h-px {
3039
+ height: 1px;
3040
+ }
3041
+
3042
+ .h-full {
3043
+ height: 100%;
3044
+ }
3045
+
3046
+ .h-auto {
3047
+ height: auto;
3048
+ }
3049
+
3050
+ .h-fit {
3051
+ height: fit-content;
3052
+ }
3053
+
3054
+ .h-min {
3055
+ height: min-content;
3056
+ }
3057
+
3058
+ .h-max {
3059
+ height: max-content;
3060
+ }
3061
+
3062
+ .h-screen {
3063
+ height: 100vh;
3064
+ }
3065
+
3066
+ .h-dvh {
3067
+ height: 100dvh;
3068
+ }
3069
+
3070
+ .w-1\/2 {
3071
+ width: calc(1 / 2 * 100%);
3072
+ }
3073
+
3074
+ .w-1\/3 {
3075
+ width: calc(1 / 3 * 100%);
3076
+ }
3077
+
3078
+ .w-2\/3 {
3079
+ width: calc(2 / 3 * 100%);
3080
+ }
3081
+
3082
+ .w-1\/4 {
3083
+ width: calc(1 / 4 * 100%);
3084
+ }
3085
+
3086
+ .w-2\/4 {
3087
+ width: calc(2 / 4 * 100%);
3088
+ }
3089
+
3090
+ .w-3\/4 {
3091
+ width: calc(3 / 4 * 100%);
3092
+ }
3093
+
3094
+ .w-1\/5 {
3095
+ width: calc(1 / 5 * 100%);
3096
+ }
3097
+
3098
+ .w-2\/5 {
3099
+ width: calc(2 / 5 * 100%);
3100
+ }
3101
+
3102
+ .w-3\/5 {
3103
+ width: calc(3 / 5 * 100%);
3104
+ }
3105
+
3106
+ .w-4\/5 {
3107
+ width: calc(4 / 5 * 100%);
3108
+ }
3109
+
3110
+ .w-1\/6 {
3111
+ width: calc(1 / 6 * 100%);
3112
+ }
3113
+
3114
+ .w-2\/6 {
3115
+ width: calc(2 / 6 * 100%);
3116
+ }
3117
+
3118
+ .w-3\/6 {
3119
+ width: calc(3 / 6 * 100%);
3120
+ }
3121
+
3122
+ .w-4\/6 {
3123
+ width: calc(4 / 6 * 100%);
3124
+ }
3125
+
3126
+ .w-5\/6 {
3127
+ width: calc(5 / 6 * 100%);
3128
+ }
3129
+
3130
+ .w-1\/12 {
3131
+ width: calc(1 / 12 * 100%);
3132
+ }
3133
+
3134
+ .w-2\/12 {
3135
+ width: calc(2 / 12 * 100%);
3136
+ }
3137
+
3138
+ .w-3\/12 {
3139
+ width: calc(3 / 12 * 100%);
3140
+ }
3141
+
3142
+ .w-4\/12 {
3143
+ width: calc(4 / 12 * 100%);
3144
+ }
3145
+
3146
+ .w-5\/12 {
3147
+ width: calc(5 / 12 * 100%);
3148
+ }
3149
+
3150
+ .w-6\/12 {
3151
+ width: calc(6 / 12 * 100%);
3152
+ }
3153
+
3154
+ .w-7\/12 {
3155
+ width: calc(7 / 12 * 100%);
3156
+ }
3157
+
3158
+ .w-8\/12 {
3159
+ width: calc(8 / 12 * 100%);
3160
+ }
3161
+
3162
+ .w-9\/12 {
3163
+ width: calc(9 / 12 * 100%);
3164
+ }
3165
+
3166
+ .w-10\/12 {
3167
+ width: calc(10 / 12 * 100%);
3168
+ }
3169
+
3170
+ .w-11\/12 {
3171
+ width: calc(11 / 12 * 100%);
3172
+ }
3173
+
3174
+ .h-1\/2 {
3175
+ height: calc(1 / 2 * 100%);
3176
+ }
3177
+
3178
+ .h-1\/3 {
3179
+ height: calc(1 / 3 * 100%);
3180
+ }
3181
+
3182
+ .h-2\/3 {
3183
+ height: calc(2 / 3 * 100%);
3184
+ }
3185
+
3186
+ .h-1\/4 {
3187
+ height: calc(1 / 4 * 100%);
3188
+ }
3189
+
3190
+ .h-2\/4 {
3191
+ height: calc(2 / 4 * 100%);
3192
+ }
3193
+
3194
+ .h-3\/4 {
3195
+ height: calc(3 / 4 * 100%);
3196
+ }
3197
+
3198
+ .h-1\/5 {
3199
+ height: calc(1 / 5 * 100%);
3200
+ }
3201
+
3202
+ .h-2\/5 {
3203
+ height: calc(2 / 5 * 100%);
3204
+ }
3205
+
3206
+ .h-3\/5 {
3207
+ height: calc(3 / 5 * 100%);
3208
+ }
3209
+
3210
+ .h-4\/5 {
3211
+ height: calc(4 / 5 * 100%);
3212
+ }
3213
+
3214
+ .h-1\/6 {
3215
+ height: calc(1 / 6 * 100%);
3216
+ }
3217
+
3218
+ .h-2\/6 {
3219
+ height: calc(2 / 6 * 100%);
3220
+ }
3221
+
3222
+ .h-3\/6 {
3223
+ height: calc(3 / 6 * 100%);
3224
+ }
3225
+
3226
+ .h-4\/6 {
3227
+ height: calc(4 / 6 * 100%);
3228
+ }
3229
+
3230
+ .h-5\/6 {
3231
+ height: calc(5 / 6 * 100%);
3232
+ }
3233
+
3234
+ .h-1\/12 {
3235
+ height: calc(1 / 12 * 100%);
3236
+ }
3237
+
3238
+ .h-2\/12 {
3239
+ height: calc(2 / 12 * 100%);
3240
+ }
3241
+
3242
+ .h-3\/12 {
3243
+ height: calc(3 / 12 * 100%);
3244
+ }
3245
+
3246
+ .h-4\/12 {
3247
+ height: calc(4 / 12 * 100%);
3248
+ }
3249
+
3250
+ .h-5\/12 {
3251
+ height: calc(5 / 12 * 100%);
3252
+ }
3253
+
3254
+ .h-6\/12 {
3255
+ height: calc(6 / 12 * 100%);
3256
+ }
3257
+
3258
+ .h-7\/12 {
3259
+ height: calc(7 / 12 * 100%);
3260
+ }
3261
+
3262
+ .h-8\/12 {
3263
+ height: calc(8 / 12 * 100%);
3264
+ }
3265
+
3266
+ .h-9\/12 {
3267
+ height: calc(9 / 12 * 100%);
3268
+ }
3269
+
3270
+ .h-10\/12 {
3271
+ height: calc(10 / 12 * 100%);
3272
+ }
3273
+
3274
+ .h-11\/12 {
3275
+ height: calc(11 / 12 * 100%);
3276
+ }
3277
+
3278
+ .size-full {
3279
+ width: 100%;
3280
+ height: 100%;
3281
+ }
3282
+
3283
+ .size-auto {
3284
+ width: auto;
3285
+ height: auto;
3286
+ }
3287
+
3288
+ .min-w-0 {
3289
+ min-width: 0px;
3290
+ }
3291
+
3292
+ .min-w-full {
3293
+ min-width: 100%;
3294
+ }
3295
+
3296
+ .min-w-fit {
3297
+ min-width: fit-content;
3298
+ }
3299
+
3300
+ .min-w-min {
3301
+ min-width: min-content;
3302
+ }
3303
+
3304
+ .min-w-max {
3305
+ min-width: max-content;
3306
+ }
3307
+
3308
+ .max-w-full {
3309
+ max-width: 100%;
3310
+ }
3311
+
3312
+ .max-w-fit {
3313
+ max-width: fit-content;
3314
+ }
3315
+
3316
+ .max-w-min {
3317
+ max-width: min-content;
3318
+ }
3319
+
3320
+ .max-w-max {
3321
+ max-width: max-content;
3322
+ }
3323
+
3324
+ .max-w-none {
3325
+ max-width: none;
3326
+ }
3327
+
3328
+ .min-h-0 {
3329
+ min-height: 0px;
3330
+ }
3331
+
3332
+ .min-h-full {
3333
+ min-height: 100%;
3334
+ }
3335
+
3336
+ .min-h-fit {
3337
+ min-height: fit-content;
3338
+ }
3339
+
3340
+ .min-h-screen {
3341
+ min-height: 100vh;
3342
+ }
3343
+
3344
+ .min-h-dvh {
3345
+ min-height: 100dvh;
3346
+ }
3347
+
3348
+ .max-h-full {
3349
+ max-height: 100%;
3350
+ }
3351
+
3352
+ .max-h-fit {
3353
+ max-height: fit-content;
3354
+ }
3355
+
3356
+ .max-h-screen {
3357
+ max-height: 100vh;
3358
+ }
3359
+
3360
+ .max-h-none {
3361
+ max-height: none;
3362
+ }
3363
+ }
3364
+
3365
+ /* --- src/styles/spacing.css --- */
3366
+
3367
+ /*
3368
+ * Spacing classes — map 1:1 sang --spacing-* trong @finhay/leaf-tokens (Figma 34:1034).
3369
+ *
3370
+ * Tiền tố = thuộc tính (giống color): p-* / m-* / gap-* (+ biến thể hướng).
3371
+ * Hậu tố = bậc token: 0 · 2xs · xs · s · m · l · xl · 2xl … 7xl.
3372
+ *
3373
+ * Chỉ set đúng 1 thuộc tính spacing — không đụng width/height.
3374
+ * Nằm trong @layer utilities để Leaf thắng khi trùng tên, giống color.css.
3375
+ */
3376
+
3377
+ @layer utilities {
3378
+ /* Padding */
3379
+
3380
+ .p-0 {
3381
+ padding: var(--spacing-0);
3382
+ }
3383
+
3384
+ .p-2xs {
3385
+ padding: var(--spacing-2xs);
3386
+ }
3387
+
3388
+ .p-xs {
3389
+ padding: var(--spacing-xs);
3390
+ }
3391
+
3392
+ .p-s {
3393
+ padding: var(--spacing-s);
3394
+ }
3395
+
3396
+ .p-m {
3397
+ padding: var(--spacing-m);
3398
+ }
3399
+
3400
+ .p-l {
3401
+ padding: var(--spacing-l);
3402
+ }
3403
+
3404
+ .p-xl {
3405
+ padding: var(--spacing-xl);
3406
+ }
3407
+
3408
+ .p-2xl {
3409
+ padding: var(--spacing-2xl);
3410
+ }
3411
+
3412
+ .p-3xl {
3413
+ padding: var(--spacing-3xl);
3414
+ }
3415
+
3416
+ .p-4xl {
3417
+ padding: var(--spacing-4xl);
3418
+ }
3419
+
3420
+ .p-5xl {
3421
+ padding: var(--spacing-5xl);
3422
+ }
3423
+
3424
+ .p-6xl {
3425
+ padding: var(--spacing-6xl);
3426
+ }
3427
+
3428
+ .p-7xl {
3429
+ padding: var(--spacing-7xl);
3430
+ }
3431
+
3432
+ .px-0 {
3433
+ padding-inline: var(--spacing-0);
3434
+ }
3435
+
3436
+ .px-2xs {
3437
+ padding-inline: var(--spacing-2xs);
3438
+ }
3439
+
3440
+ .px-xs {
3441
+ padding-inline: var(--spacing-xs);
3442
+ }
3443
+
3444
+ .px-s {
3445
+ padding-inline: var(--spacing-s);
3446
+ }
3447
+
3448
+ .px-m {
3449
+ padding-inline: var(--spacing-m);
3450
+ }
3451
+
3452
+ .px-l {
3453
+ padding-inline: var(--spacing-l);
3454
+ }
3455
+
3456
+ .px-xl {
3457
+ padding-inline: var(--spacing-xl);
3458
+ }
3459
+
3460
+ .px-2xl {
3461
+ padding-inline: var(--spacing-2xl);
2057
3462
  }
2058
3463
 
2059
3464
  .px-3xl {
@@ -2080,6 +3485,10 @@
2080
3485
  padding-block: var(--spacing-0);
2081
3486
  }
2082
3487
 
3488
+ .py-2xs {
3489
+ padding-block: var(--spacing-2xs);
3490
+ }
3491
+
2083
3492
  .py-xs {
2084
3493
  padding-block: var(--spacing-xs);
2085
3494
  }
@@ -2128,6 +3537,10 @@
2128
3537
  padding-top: var(--spacing-0);
2129
3538
  }
2130
3539
 
3540
+ .pt-2xs {
3541
+ padding-top: var(--spacing-2xs);
3542
+ }
3543
+
2131
3544
  .pt-xs {
2132
3545
  padding-top: var(--spacing-xs);
2133
3546
  }
@@ -2176,6 +3589,10 @@
2176
3589
  padding-right: var(--spacing-0);
2177
3590
  }
2178
3591
 
3592
+ .pr-2xs {
3593
+ padding-right: var(--spacing-2xs);
3594
+ }
3595
+
2179
3596
  .pr-xs {
2180
3597
  padding-right: var(--spacing-xs);
2181
3598
  }
@@ -2224,6 +3641,10 @@
2224
3641
  padding-bottom: var(--spacing-0);
2225
3642
  }
2226
3643
 
3644
+ .pb-2xs {
3645
+ padding-bottom: var(--spacing-2xs);
3646
+ }
3647
+
2227
3648
  .pb-xs {
2228
3649
  padding-bottom: var(--spacing-xs);
2229
3650
  }
@@ -2272,6 +3693,10 @@
2272
3693
  padding-left: var(--spacing-0);
2273
3694
  }
2274
3695
 
3696
+ .pl-2xs {
3697
+ padding-left: var(--spacing-2xs);
3698
+ }
3699
+
2275
3700
  .pl-xs {
2276
3701
  padding-left: var(--spacing-xs);
2277
3702
  }
@@ -2322,6 +3747,10 @@
2322
3747
  margin: var(--spacing-0);
2323
3748
  }
2324
3749
 
3750
+ .m-2xs {
3751
+ margin: var(--spacing-2xs);
3752
+ }
3753
+
2325
3754
  .m-xs {
2326
3755
  margin: var(--spacing-xs);
2327
3756
  }
@@ -2370,6 +3799,10 @@
2370
3799
  margin-inline: var(--spacing-0);
2371
3800
  }
2372
3801
 
3802
+ .mx-2xs {
3803
+ margin-inline: var(--spacing-2xs);
3804
+ }
3805
+
2373
3806
  .mx-xs {
2374
3807
  margin-inline: var(--spacing-xs);
2375
3808
  }
@@ -2418,6 +3851,10 @@
2418
3851
  margin-block: var(--spacing-0);
2419
3852
  }
2420
3853
 
3854
+ .my-2xs {
3855
+ margin-block: var(--spacing-2xs);
3856
+ }
3857
+
2421
3858
  .my-xs {
2422
3859
  margin-block: var(--spacing-xs);
2423
3860
  }
@@ -2466,6 +3903,10 @@
2466
3903
  margin-top: var(--spacing-0);
2467
3904
  }
2468
3905
 
3906
+ .mt-2xs {
3907
+ margin-top: var(--spacing-2xs);
3908
+ }
3909
+
2469
3910
  .mt-xs {
2470
3911
  margin-top: var(--spacing-xs);
2471
3912
  }
@@ -2514,6 +3955,10 @@
2514
3955
  margin-right: var(--spacing-0);
2515
3956
  }
2516
3957
 
3958
+ .mr-2xs {
3959
+ margin-right: var(--spacing-2xs);
3960
+ }
3961
+
2517
3962
  .mr-xs {
2518
3963
  margin-right: var(--spacing-xs);
2519
3964
  }
@@ -2562,6 +4007,10 @@
2562
4007
  margin-bottom: var(--spacing-0);
2563
4008
  }
2564
4009
 
4010
+ .mb-2xs {
4011
+ margin-bottom: var(--spacing-2xs);
4012
+ }
4013
+
2565
4014
  .mb-xs {
2566
4015
  margin-bottom: var(--spacing-xs);
2567
4016
  }
@@ -2610,6 +4059,10 @@
2610
4059
  margin-left: var(--spacing-0);
2611
4060
  }
2612
4061
 
4062
+ .ml-2xs {
4063
+ margin-left: var(--spacing-2xs);
4064
+ }
4065
+
2613
4066
  .ml-xs {
2614
4067
  margin-left: var(--spacing-xs);
2615
4068
  }
@@ -2660,6 +4113,10 @@
2660
4113
  gap: var(--spacing-0);
2661
4114
  }
2662
4115
 
4116
+ .gap-2xs {
4117
+ gap: var(--spacing-2xs);
4118
+ }
4119
+
2663
4120
  .gap-xs {
2664
4121
  gap: var(--spacing-xs);
2665
4122
  }
@@ -2708,6 +4165,10 @@
2708
4165
  column-gap: var(--spacing-0);
2709
4166
  }
2710
4167
 
4168
+ .gap-x-2xs {
4169
+ column-gap: var(--spacing-2xs);
4170
+ }
4171
+
2711
4172
  .gap-x-xs {
2712
4173
  column-gap: var(--spacing-xs);
2713
4174
  }
@@ -2756,6 +4217,10 @@
2756
4217
  row-gap: var(--spacing-0);
2757
4218
  }
2758
4219
 
4220
+ .gap-y-2xs {
4221
+ row-gap: var(--spacing-2xs);
4222
+ }
4223
+
2759
4224
  .gap-y-xs {
2760
4225
  row-gap: var(--spacing-xs);
2761
4226
  }
@@ -2801,6 +4266,223 @@
2801
4266
  }
2802
4267
  }
2803
4268
 
4269
+ /* --- src/styles/text-layout.css --- */
4270
+
4271
+ /*
4272
+ * Text layout classes — căn chữ, whitespace, truncate, line-clamp, transform,
4273
+ * decoration, vertical-align.
4274
+ *
4275
+ * Tên file `text-layout.css` để tránh lẫn với class màu `text-*` và typography.css.
4276
+ * Không gồm wrap-break-*, italic, tabular-nums, cursor.
4277
+ *
4278
+ * Nằm trong @layer components (cùng lý do với flex.css).
4279
+ */
4280
+
4281
+ @layer components {
4282
+ .text-left {
4283
+ text-align: left;
4284
+ }
4285
+
4286
+ .text-center {
4287
+ text-align: center;
4288
+ }
4289
+
4290
+ .text-right {
4291
+ text-align: right;
4292
+ }
4293
+
4294
+ .text-justify {
4295
+ text-align: justify;
4296
+ }
4297
+
4298
+ .text-start {
4299
+ text-align: start;
4300
+ }
4301
+
4302
+ .text-end {
4303
+ text-align: end;
4304
+ }
4305
+
4306
+ .whitespace-normal {
4307
+ white-space: normal;
4308
+ }
4309
+
4310
+ .whitespace-nowrap {
4311
+ white-space: nowrap;
4312
+ }
4313
+
4314
+ .whitespace-pre {
4315
+ white-space: pre;
4316
+ }
4317
+
4318
+ .whitespace-pre-line {
4319
+ white-space: pre-line;
4320
+ }
4321
+
4322
+ .whitespace-pre-wrap {
4323
+ white-space: pre-wrap;
4324
+ }
4325
+
4326
+ .whitespace-break-spaces {
4327
+ white-space: break-spaces;
4328
+ }
4329
+
4330
+ .truncate {
4331
+ overflow: hidden;
4332
+ text-overflow: ellipsis;
4333
+ white-space: nowrap;
4334
+ }
4335
+
4336
+ .text-ellipsis {
4337
+ text-overflow: ellipsis;
4338
+ }
4339
+
4340
+ .text-clip {
4341
+ text-overflow: clip;
4342
+ }
4343
+
4344
+ .text-wrap {
4345
+ text-wrap: wrap;
4346
+ }
4347
+
4348
+ .text-nowrap {
4349
+ text-wrap: nowrap;
4350
+ }
4351
+
4352
+ .text-balance {
4353
+ text-wrap: balance;
4354
+ }
4355
+
4356
+ .text-pretty {
4357
+ text-wrap: pretty;
4358
+ }
4359
+
4360
+ .break-normal {
4361
+ overflow-wrap: normal;
4362
+ word-break: normal;
4363
+ }
4364
+
4365
+ .break-all {
4366
+ word-break: break-all;
4367
+ }
4368
+
4369
+ .break-keep {
4370
+ word-break: keep-all;
4371
+ }
4372
+
4373
+ .line-clamp-1 {
4374
+ overflow: hidden;
4375
+ display: -webkit-box;
4376
+ -webkit-box-orient: vertical;
4377
+ -webkit-line-clamp: 1;
4378
+ }
4379
+
4380
+ .line-clamp-2 {
4381
+ overflow: hidden;
4382
+ display: -webkit-box;
4383
+ -webkit-box-orient: vertical;
4384
+ -webkit-line-clamp: 2;
4385
+ }
4386
+
4387
+ .line-clamp-3 {
4388
+ overflow: hidden;
4389
+ display: -webkit-box;
4390
+ -webkit-box-orient: vertical;
4391
+ -webkit-line-clamp: 3;
4392
+ }
4393
+
4394
+ .line-clamp-4 {
4395
+ overflow: hidden;
4396
+ display: -webkit-box;
4397
+ -webkit-box-orient: vertical;
4398
+ -webkit-line-clamp: 4;
4399
+ }
4400
+
4401
+ .line-clamp-5 {
4402
+ overflow: hidden;
4403
+ display: -webkit-box;
4404
+ -webkit-box-orient: vertical;
4405
+ -webkit-line-clamp: 5;
4406
+ }
4407
+
4408
+ .line-clamp-6 {
4409
+ overflow: hidden;
4410
+ display: -webkit-box;
4411
+ -webkit-box-orient: vertical;
4412
+ -webkit-line-clamp: 6;
4413
+ }
4414
+
4415
+ .line-clamp-none {
4416
+ overflow: visible;
4417
+ display: block;
4418
+ -webkit-box-orient: horizontal;
4419
+ -webkit-line-clamp: unset;
4420
+ }
4421
+
4422
+ /* line-clamp set display — `hidden` vẫn phải ẩn (cùng lý do với flex.css). */
4423
+ .line-clamp-1[hidden],
4424
+ .line-clamp-2[hidden],
4425
+ .line-clamp-3[hidden],
4426
+ .line-clamp-4[hidden],
4427
+ .line-clamp-5[hidden],
4428
+ .line-clamp-6[hidden],
4429
+ .line-clamp-none[hidden] {
4430
+ display: none;
4431
+ }
4432
+
4433
+ .uppercase {
4434
+ text-transform: uppercase;
4435
+ }
4436
+
4437
+ .lowercase {
4438
+ text-transform: lowercase;
4439
+ }
4440
+
4441
+ .capitalize {
4442
+ text-transform: capitalize;
4443
+ }
4444
+
4445
+ .normal-case {
4446
+ text-transform: none;
4447
+ }
4448
+
4449
+ .underline {
4450
+ text-decoration-line: underline;
4451
+ }
4452
+
4453
+ .line-through {
4454
+ text-decoration-line: line-through;
4455
+ }
4456
+
4457
+ .no-underline {
4458
+ text-decoration-line: none;
4459
+ }
4460
+
4461
+ .align-top {
4462
+ vertical-align: top;
4463
+ }
4464
+
4465
+ .align-middle {
4466
+ vertical-align: middle;
4467
+ }
4468
+
4469
+ .align-bottom {
4470
+ vertical-align: bottom;
4471
+ }
4472
+
4473
+ .align-baseline {
4474
+ vertical-align: baseline;
4475
+ }
4476
+
4477
+ .align-text-top {
4478
+ vertical-align: text-top;
4479
+ }
4480
+
4481
+ .align-text-bottom {
4482
+ vertical-align: text-bottom;
4483
+ }
4484
+ }
4485
+
2804
4486
  /* --- src/styles/typography.css --- */
2805
4487
 
2806
4488
  /*
@@ -2813,9 +4495,7 @@
2813
4495
  * weight (400 / 600 / 700 theo token). Letter spacing, margin, màu chữ không
2814
4496
  * thuộc stylesheet này — màu dùng class text-* riêng.
2815
4497
  *
2816
- * Toàn bộ nằm trong `@layer components` để utility của Tailwind (`@layer
2817
- * utilities`) luôn thắng: `class="heading-1 font-bold"` hay `class="body-3
2818
- * text-2xl"` đều override được mà không cần important modifier.
4498
+ * Toàn bộ nằm trong `@layer components` — SCSS module (ngoài layer) override được.
2819
4499
  */
2820
4500
 
2821
4501
  @layer components {