@inchurch/matcha-core 21.3.2 → 21.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.scss +185 -0
- package/matcha-core.css +4837 -2679
- package/matcha-core.min.css +1 -1
- package/package.json +1 -1
package/core.scss
CHANGED
|
@@ -848,6 +848,64 @@ $font-weight-token-map: (
|
|
|
848
848
|
}
|
|
849
849
|
@include generate-line-height-classes($helper-breakpoints);
|
|
850
850
|
|
|
851
|
+
// -----------------------------------------------------------------------------------------------------
|
|
852
|
+
// @ Text Styles (composite — Figma matcha/text/*) → size + weight + line-height (+ letter-spacing/transform)
|
|
853
|
+
// Uma classe aplica o text style INTEIRO, token-backed. Nomes seguem --matcha-text-* (canônico DS).
|
|
854
|
+
// Não colide com os utilitários text-* single-prop (center/uppercase/truncate/...): sufixos distintos.
|
|
855
|
+
// Pareamento size/weight/leading/tracking espelha matcha-theme/tokens/_emit-tokens.scss:103-148
|
|
856
|
+
// (weight por estilo não é tokenizado → mapeia pro --matcha-weight-* correspondente).
|
|
857
|
+
// -----------------------------------------------------------------------------------------------------
|
|
858
|
+
@mixin generate-text-style-classes($helper-breakpoints) {
|
|
859
|
+
// name: (size, weight, line-height, letter-spacing-or-null, text-transform-or-null)
|
|
860
|
+
$text-styles: (
|
|
861
|
+
display-hero: (var(--matcha-text-display-hero, 36px), var(--matcha-weight-extrabold, 800), var(--matcha-leading-display-hero, 40px), var(--matcha-tracking-display-hero, -1.2px), null),
|
|
862
|
+
display: (var(--matcha-text-display, 32px), var(--matcha-weight-bold, 700), var(--matcha-leading-display, 40px), var(--matcha-tracking-display, -0.3px), null),
|
|
863
|
+
headline: (var(--matcha-text-headline, 24px), var(--matcha-weight-bold, 700), var(--matcha-leading-headline, 32px), var(--matcha-tracking-headline, -0.3px), null),
|
|
864
|
+
title-lg: (var(--matcha-text-title-lg, 20px), var(--matcha-weight-semibold, 600), var(--matcha-leading-title-lg, 28px), null, null),
|
|
865
|
+
title-md: (var(--matcha-text-title-md, 18px), var(--matcha-weight-semibold, 600), var(--matcha-leading-title-md, 24px), null, null),
|
|
866
|
+
title-sm: (var(--matcha-text-title-sm, 16px), var(--matcha-weight-semibold, 600), var(--matcha-leading-title-sm, 22px), null, null),
|
|
867
|
+
title-xs: (var(--matcha-text-title-xs, 14px), var(--matcha-weight-extrabold, 800), var(--matcha-leading-title-xs, 20px), null, null),
|
|
868
|
+
body-lg: (var(--matcha-text-body-lg, 16px), var(--matcha-weight-regular, 400), var(--matcha-leading-body-lg, 24px), null, null),
|
|
869
|
+
body-md: (var(--matcha-text-body-md, 14px), var(--matcha-weight-regular, 400), var(--matcha-leading-body-md, 20px), null, null),
|
|
870
|
+
body-sm: (var(--matcha-text-body-sm, 12px), var(--matcha-weight-regular, 400), var(--matcha-leading-body-sm, 16px), null, null),
|
|
871
|
+
p-tiny: (var(--matcha-text-p-tiny, 11px), var(--matcha-weight-regular, 400), var(--matcha-leading-p-tiny, 14px), var(--matcha-tracking-p-tiny, 0.3px), null),
|
|
872
|
+
label-lg: (var(--matcha-text-label-lg, 16px), var(--matcha-weight-medium, 500), var(--matcha-leading-label-lg, 22px), null, null),
|
|
873
|
+
label-md: (var(--matcha-text-label-md, 14px), var(--matcha-weight-medium, 500), var(--matcha-leading-label-md, 20px), null, null),
|
|
874
|
+
label-sm: (var(--matcha-text-label-sm, 12px), var(--matcha-weight-medium, 500), var(--matcha-leading-label-sm, 16px), null, null),
|
|
875
|
+
overline: (var(--matcha-text-overline, 10px), var(--matcha-weight-semibold, 600), var(--matcha-leading-overline, 14px), var(--matcha-tracking-overline, 1px), uppercase),
|
|
876
|
+
);
|
|
877
|
+
|
|
878
|
+
@each $breakpoint, $materialBreakpoint in $helper-breakpoints {
|
|
879
|
+
@include media-breakpoint($materialBreakpoint) {
|
|
880
|
+
$infix: if($materialBreakpoint == null, "", "-#{$breakpoint}");
|
|
881
|
+
|
|
882
|
+
@each $name, $props in $text-styles {
|
|
883
|
+
$size: list.nth($props, 1);
|
|
884
|
+
$weight: list.nth($props, 2);
|
|
885
|
+
$leading: list.nth($props, 3);
|
|
886
|
+
$tracking: list.nth($props, 4);
|
|
887
|
+
$transform: list.nth($props, 5);
|
|
888
|
+
|
|
889
|
+
.text#{$infix}-#{$name} {
|
|
890
|
+
font-size: $size;
|
|
891
|
+
font-weight: $weight;
|
|
892
|
+
line-height: $leading;
|
|
893
|
+
@if $tracking != null { letter-spacing: $tracking; }
|
|
894
|
+
@if $transform != null { text-transform: $transform; }
|
|
895
|
+
}
|
|
896
|
+
.text#{$infix}-#{$name}--force {
|
|
897
|
+
font-size: $size !important;
|
|
898
|
+
font-weight: $weight !important;
|
|
899
|
+
line-height: $leading !important;
|
|
900
|
+
@if $tracking != null { letter-spacing: $tracking !important; }
|
|
901
|
+
@if $transform != null { text-transform: $transform !important; }
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
@include generate-text-style-classes($helper-breakpoints);
|
|
908
|
+
|
|
851
909
|
// -----------------------------------------------------------------------------------------------------
|
|
852
910
|
// @ Aspect Ratio classes
|
|
853
911
|
// -----------------------------------------------------------------------------------------------------
|
|
@@ -1270,6 +1328,50 @@ $font-weight-token-map: (
|
|
|
1270
1328
|
}
|
|
1271
1329
|
@include generate-border-size-classes($helper-breakpoints);
|
|
1272
1330
|
|
|
1331
|
+
// -----------------------------------------------------------------------------------------------------
|
|
1332
|
+
// @ Border Named Widths (token-backed — Figma matcha/border/{hairline,thin,medium,thick})
|
|
1333
|
+
// Espelha o gerador numérico acima, mas nomeado e ligado ao token. Cor herda currentColor
|
|
1334
|
+
// (cor de borda continua sendo token do tema — matcha-core não gera border-color).
|
|
1335
|
+
// -----------------------------------------------------------------------------------------------------
|
|
1336
|
+
@mixin generate-border-named-classes($helper-breakpoints){
|
|
1337
|
+
$border-named: (
|
|
1338
|
+
hairline: var(--matcha-border-hairline, 1px),
|
|
1339
|
+
thin: var(--matcha-border-thin, 2px),
|
|
1340
|
+
medium: var(--matcha-border-medium, 4px),
|
|
1341
|
+
thick: var(--matcha-border-thick, 8px),
|
|
1342
|
+
);
|
|
1343
|
+
$border-directions: (bottom: bb, top: bt, left: bl, right: br);
|
|
1344
|
+
|
|
1345
|
+
@each $breakpoint, $materialBreakpoint in $helper-breakpoints {
|
|
1346
|
+
@include media-breakpoint($materialBreakpoint) {
|
|
1347
|
+
$infix: if($materialBreakpoint == null, "", "-#{$breakpoint}");
|
|
1348
|
+
|
|
1349
|
+
@each $name, $width in $border-named {
|
|
1350
|
+
.border#{$infix}-#{$name},
|
|
1351
|
+
.b#{$infix}-#{$name} {
|
|
1352
|
+
border: $width solid;
|
|
1353
|
+
}
|
|
1354
|
+
.border#{$infix}-#{$name}--force,
|
|
1355
|
+
.b#{$infix}-#{$name}--force {
|
|
1356
|
+
border: $width solid !important;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
@each $direction, $abbrev in $border-directions {
|
|
1360
|
+
.border-#{$direction}#{$infix}-#{$name},
|
|
1361
|
+
.#{$abbrev}#{$infix}-#{$name} {
|
|
1362
|
+
border-#{$direction}: $width solid;
|
|
1363
|
+
}
|
|
1364
|
+
.border-#{$direction}#{$infix}-#{$name}--force,
|
|
1365
|
+
.#{$abbrev}#{$infix}-#{$name}--force {
|
|
1366
|
+
border-#{$direction}: $width solid !important;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
@include generate-border-named-classes($helper-breakpoints);
|
|
1374
|
+
|
|
1273
1375
|
// -----------------------------------------------------------------------------------------------------
|
|
1274
1376
|
// @ Border Style
|
|
1275
1377
|
// -----------------------------------------------------------------------------------------------------
|
|
@@ -1389,6 +1491,39 @@ $font-weight-token-map: (
|
|
|
1389
1491
|
}
|
|
1390
1492
|
@include generate-radius-classes($helper-breakpoints);
|
|
1391
1493
|
|
|
1494
|
+
// -----------------------------------------------------------------------------------------------------
|
|
1495
|
+
// @ Shadow / Elevation (token-backed — Figma matcha/elevation/level-{1-4} → --matcha-shadow-*)
|
|
1496
|
+
// Classe utilitária CANÔNICA de sombra. NÃO confundir com o legado .elevation-z-* (Material,
|
|
1497
|
+
// deprecado, gerado no matcha-theme). Alternância light/dark vem do próprio token.
|
|
1498
|
+
// Fallbacks (light) via unquote() — a sombra é multi-camada (vírgulas) e não pode entrar
|
|
1499
|
+
// crua num mapa Sass. Mantidos fiéis a matcha-theme/tokens/_elevation-tokens.scss.
|
|
1500
|
+
// -----------------------------------------------------------------------------------------------------
|
|
1501
|
+
@mixin generate-shadow-classes() {
|
|
1502
|
+
$shadow-map: (
|
|
1503
|
+
1: unquote("var(--matcha-shadow-1, 0 8px 24px -8px rgba(45, 122, 47, 0.04), 0 2px 8px -1px rgba(26, 44, 30, 0.08), 0 1px 2px rgba(26, 44, 30, 0.04))"),
|
|
1504
|
+
2: unquote("var(--matcha-shadow-2, 0 12px 32px -10px rgba(45, 122, 47, 0.05), 0 4px 16px -2px rgba(26, 44, 30, 0.10), 0 2px 4px -1px rgba(26, 44, 30, 0.05))"),
|
|
1505
|
+
3: unquote("var(--matcha-shadow-3, 0 16px 40px -12px rgba(45, 122, 47, 0.06), 0 12px 32px -4px rgba(26, 44, 30, 0.14), 0 4px 8px -2px rgba(26, 44, 30, 0.08))"),
|
|
1506
|
+
4: unquote("var(--matcha-shadow-4, 0 24px 48px -16px rgba(45, 122, 47, 0.08), 0 24px 48px -8px rgba(26, 44, 30, 0.18), 0 8px 16px -4px rgba(26, 44, 30, 0.10))"),
|
|
1507
|
+
);
|
|
1508
|
+
|
|
1509
|
+
@each $level, $value in $shadow-map {
|
|
1510
|
+
.shadow-#{$level} {
|
|
1511
|
+
box-shadow: $value;
|
|
1512
|
+
}
|
|
1513
|
+
.shadow-#{$level}--force {
|
|
1514
|
+
box-shadow: $value !important;
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
.shadow-none {
|
|
1519
|
+
box-shadow: none;
|
|
1520
|
+
}
|
|
1521
|
+
.shadow-none--force {
|
|
1522
|
+
box-shadow: none !important;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
@include generate-shadow-classes();
|
|
1526
|
+
|
|
1392
1527
|
// -----------------------------------------------------------------------------------------------------
|
|
1393
1528
|
// @ Hover - Show/Hide
|
|
1394
1529
|
// -----------------------------------------------------------------------------------------------------
|
|
@@ -1419,6 +1554,56 @@ $font-weight-token-map: (
|
|
|
1419
1554
|
}
|
|
1420
1555
|
@include generate-transition-classes();
|
|
1421
1556
|
|
|
1557
|
+
// -----------------------------------------------------------------------------------------------------
|
|
1558
|
+
// @ Motion — token-backed (Figma matcha/duration/*, matcha/easing/*)
|
|
1559
|
+
// Complementa o legado .ts-* (100/300ms hardcoded, mantido). Estas ligam nos tokens do DS.
|
|
1560
|
+
// .duration-* → transition-duration · .ease-* → transition-timing-function
|
|
1561
|
+
// .transition-* → atalho composto (all + duração + easing standard)
|
|
1562
|
+
// -----------------------------------------------------------------------------------------------------
|
|
1563
|
+
@mixin generate-motion-classes() {
|
|
1564
|
+
$duration-map: (
|
|
1565
|
+
instant: var(--matcha-duration-instant, 80ms),
|
|
1566
|
+
fast: var(--matcha-duration-fast, 200ms),
|
|
1567
|
+
normal: var(--matcha-duration-normal, 400ms),
|
|
1568
|
+
slow: var(--matcha-duration-slow, 600ms),
|
|
1569
|
+
);
|
|
1570
|
+
$easing-map: (
|
|
1571
|
+
standard: unquote("var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1))"),
|
|
1572
|
+
emphasized: unquote("var(--matcha-easing-emphasized, cubic-bezier(0.2, 0, 0, 1))"),
|
|
1573
|
+
decelerated: unquote("var(--matcha-easing-decelerated, cubic-bezier(0, 0, 0.2, 1))"),
|
|
1574
|
+
accelerated: unquote("var(--matcha-easing-accelerated, cubic-bezier(0.4, 0, 1, 1))"),
|
|
1575
|
+
);
|
|
1576
|
+
$standard-ease: unquote("var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1))");
|
|
1577
|
+
|
|
1578
|
+
@each $name, $value in $duration-map {
|
|
1579
|
+
.duration-#{$name} {
|
|
1580
|
+
transition-duration: $value;
|
|
1581
|
+
}
|
|
1582
|
+
.duration-#{$name}--force {
|
|
1583
|
+
transition-duration: $value !important;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
@each $name, $value in $easing-map {
|
|
1588
|
+
.ease-#{$name} {
|
|
1589
|
+
transition-timing-function: $value;
|
|
1590
|
+
}
|
|
1591
|
+
.ease-#{$name}--force {
|
|
1592
|
+
transition-timing-function: $value !important;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
@each $name, $value in $duration-map {
|
|
1597
|
+
.transition-#{$name} {
|
|
1598
|
+
transition: all $value $standard-ease;
|
|
1599
|
+
}
|
|
1600
|
+
.transition-#{$name}--force {
|
|
1601
|
+
transition: all $value $standard-ease !important;
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
@include generate-motion-classes();
|
|
1606
|
+
|
|
1422
1607
|
// -----------------------------------------------------------------------------------------------------
|
|
1423
1608
|
// @ Rotate Animation
|
|
1424
1609
|
// -----------------------------------------------------------------------------------------------------
|