@inchurch/matcha-theme 20.278.0 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/base/_reset.scss CHANGED
@@ -1,13 +1,12 @@
1
- @mixin base-body-reset-theme($theme) {
2
- $background: map-get($theme, background);
3
- $foreground: map-get($theme, foreground);
4
-
1
+ @mixin base-body-reset-theme($theme: ()) {
2
+ // theme-agnóstico em valor (var); fica per-classe de tema pelo & (pinta o
3
+ // elemento que carrega a classe). $theme vestigial (default ()).
5
4
  & {
6
5
  *, *:before, *:after {
7
6
  box-sizing: border-box;
8
7
  }
9
- color: getForeground($theme);
10
- background: map-get($background, background);
8
+ color: var(--matcha-color-fg);
9
+ background: var(--matcha-color-surface-bg);
11
10
  }
12
11
  }
13
12
 
@@ -20,19 +19,15 @@ How to use
20
19
  // Typography [Theme]
21
20
  // -----------------------------------------------------------------------------------------------------
22
21
  @mixin base-typography-theme($theme) {
23
- $is-dark: map-get($theme, is-dark);
24
- $accent: map-get($theme, accent);
25
- $warn: map-get($theme, warn);
26
- $primary: map-get($theme, primary);
27
- $background: map-get($theme, background);
28
- $foreground: map-get($theme, foreground);
22
+ // theme-agnóstico: tudo via var(--matcha-color-*) (runtime). $theme mantido só
23
+ // na assinatura por retrocompat dos call sites.
29
24
 
30
25
  a {
31
- color: map-get($accent, default);
26
+ color: var(--matcha-color-accent);
32
27
  }
33
28
 
34
29
  pre > code{
35
- color: getBlue($theme);
30
+ color: var(--matcha-color-info);
36
31
  }
37
32
  code {
38
33
  &:not(.highlight) {
@@ -46,38 +41,33 @@ How to use
46
41
 
47
42
  .changelog {
48
43
  .entry {
49
- background-color: map-get($background, card);
44
+ background-color: var(--matcha-color-surface-card);
50
45
  }
51
46
  }
52
47
 
53
48
  .text-boxed {
54
- @if ($is-dark) {
55
- background-color: rgba(255, 255, 255, 0.12);
56
- color: rgba(255, 255, 255, 0.54);
57
- } @else {
58
- background-color: rgba(0, 0, 0, 0.12);
59
- color: rgba(0, 0, 0, 0.54);
60
- }
49
+ background-color: var(--matcha-color-text-boxed-bg);
50
+ color: var(--matcha-color-text-boxed-fg);
61
51
  }
62
52
 
63
53
  .text-primary {
64
- color: map-get($primary, default) !important;
54
+ color: var(--matcha-color-primary) !important;
65
55
  }
66
56
 
67
57
  .text-warn {
68
- color: map-get($warn, default) !important;
58
+ color: var(--matcha-color-warn) !important;
69
59
  }
70
60
 
71
61
  .text-label {
72
- color: map-get($foreground, label) !important;
62
+ color: var(--matcha-color-text-label) !important;
73
63
  }
74
64
 
75
65
  .text-placeholder {
76
- color: map-get($foreground, placeholder) !important;
66
+ color: var(--matcha-color-text-placeholder) !important;
77
67
  }
78
68
 
79
69
  .text-basic {
80
- color: map-get($foreground, foreground) !important;
70
+ color: var(--matcha-color-fg) !important;
81
71
  }
82
72
 
83
73
  // Changelog
@@ -86,25 +76,25 @@ How to use
86
76
  .groups {
87
77
  .breaking-changes {
88
78
  .title {
89
- background: map-get($background, red);
79
+ background: var(--matcha-color-danger);
90
80
  }
91
81
  }
92
82
 
93
83
  .new {
94
84
  .title {
95
- background: map-get($background, green);
85
+ background: var(--matcha-color-success);
96
86
  }
97
87
  }
98
88
 
99
89
  .improved {
100
90
  .title {
101
- background: map-get($background, purple);
91
+ background: var(--matcha-prim-purple-500);
102
92
  }
103
93
  }
104
94
 
105
95
  .fixed {
106
96
  .title {
107
- background: map-get($background, blue);
97
+ background: var(--matcha-color-info);
108
98
  }
109
99
  }
110
100
  }
@@ -114,22 +104,22 @@ How to use
114
104
  // Code
115
105
  code {
116
106
  &:not(.highlight) {
117
- color: map-get($background, blue);
107
+ color: var(--matcha-color-info);
118
108
  }
119
109
  }
120
110
 
121
111
  // Mark
122
112
  mark {
123
- background: map-get($background, yellow);
113
+ background: var(--matcha-color-warn);
124
114
  }
125
115
 
126
116
  // Message boxes
127
117
  .matcha-message-box,
128
118
  .matcha-msg-box,
129
119
  .message-box {
130
- background-color: getPrimaryAlpha($theme);
131
- border-left-color: map-get($primary, default);
132
- color: map-get($foreground, foreground);
120
+ background-color: var(--matcha-color-primary-alpha);
121
+ border-left-color: var(--matcha-color-primary);
122
+ color: var(--matcha-color-fg);
133
123
 
134
124
  &.error,
135
125
  &.warning,
@@ -139,31 +129,31 @@ How to use
139
129
  &--warning,
140
130
  &--success,
141
131
  &--info {
142
- color: map-get($foreground, foreground);
132
+ color: var(--matcha-color-fg);
143
133
  }
144
134
 
145
135
  &--error,
146
136
  &.error {
147
- background-color: map-get($background, red-alpha);
148
- border-left-color: map-get($background, red);
137
+ background-color: var(--matcha-color-danger-alpha);
138
+ border-left-color: var(--matcha-color-danger);
149
139
  }
150
140
 
151
141
  &--warning,
152
142
  &.warning {
153
- background-color: map-get($background, yellow-alpha);
154
- border-left-color: map-get($background, yellow);
143
+ background-color: var(--matcha-color-warn-alpha);
144
+ border-left-color: var(--matcha-color-warn);
155
145
  }
156
146
 
157
147
  &--success,
158
148
  &.success {
159
- background-color: map-get($background, green-alpha);
160
- border-left-color: map-get($background, green);
149
+ background-color: var(--matcha-color-success-alpha);
150
+ border-left-color: var(--matcha-color-success);
161
151
  }
162
152
 
163
153
  &--info,
164
154
  &.info {
165
- background-color: map-get($background, blue-alpha);
166
- border-left-color: map-get($background, blue);
155
+ background-color: var(--matcha-color-info-alpha);
156
+ border-left-color: var(--matcha-color-info);
167
157
  }
168
158
  }
169
159
  }
@@ -2,19 +2,19 @@
2
2
 
3
3
  &:not([inactivetype]),
4
4
  &[inactivetype="solid"] {
5
- @each $colorName, $colorFn in $color-functions {
5
+ @each $colorName in $color-functions {
6
6
  &[inactivecolor="#{'' + $colorName}"] {
7
7
  .button-group {
8
8
 
9
9
  button[matcha-button],
10
10
  a[matcha-button] {
11
11
  &:not([active]) {
12
- background: call(#{$colorFn}, $theme);
13
- color: call(#{$colorFn}Contrast, $theme);
12
+ background: var(--matcha-color-#{$colorName});
13
+ color: var(--matcha-color-#{$colorName}-contrast);
14
14
  box-shadow: 0 0 0 0px inset;
15
15
 
16
16
  .ripple {
17
- background: call(#{$colorFn}ContrastAlpha, $theme); // ok: legacy ripple color token
17
+ background: var(--matcha-color-#{$colorName}-contrast-alpha); // ok: legacy ripple color token
18
18
  }
19
19
  }
20
20
  }
@@ -40,7 +40,7 @@
40
40
 
41
41
  @mixin _colorize-inactive-type-basic-button-toggle-item($theme, $color-functions) {
42
42
  &[inactivetype="basic"] {
43
- @each $colorName, $colorFn in $color-functions {
43
+ @each $colorName in $color-functions {
44
44
  &[inactivecolor="#{'' + $colorName}"] {
45
45
  .button-group {
46
46
 
@@ -48,11 +48,11 @@
48
48
  a[matcha-button] {
49
49
  &:not([active]) {
50
50
  background: var(--matcha-color-surface);
51
- color: call(#{$colorFn}, $theme);
51
+ color: var(--matcha-color-#{$colorName});
52
52
  box-shadow: 0 0 0 0px inset;
53
53
 
54
54
  .ripple {
55
- background: call(#{$colorFn}Alpha, $theme); // ok: legacy ripple color token
55
+ background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
56
56
  }
57
57
  }
58
58
  }
@@ -81,7 +81,7 @@
81
81
 
82
82
  //disabled false
83
83
  &:not([disabled="true"]) {
84
- @each $colorName, $colorFn in $color-functions {
84
+ @each $colorName in $color-functions {
85
85
  &[inactivecolor="#{'' + $colorName}"] {
86
86
  .button-group {
87
87
 
@@ -90,12 +90,12 @@
90
90
 
91
91
  //botão não ativo
92
92
  &:not([active]) {
93
- color: call(#{$colorFn}, $theme);
93
+ color: var(--matcha-color-#{$colorName});
94
94
  background: transparent;
95
- box-shadow: 0 0 0 2px call(#{$colorFn}, $theme) inset;
95
+ box-shadow: 0 0 0 2px var(--matcha-color-#{$colorName}) inset;
96
96
 
97
97
  .ripple {
98
- background: call(#{$colorFn}Alpha, $theme); // ok: legacy ripple color token
98
+ background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
99
99
  }
100
100
  }
101
101
  }
@@ -125,19 +125,19 @@
125
125
 
126
126
  @mixin _colorize-inactive-type-alpha-button-toggle-item($theme, $color-functions) {
127
127
  &[inactivetype="alpha"] {
128
- @each $colorName, $colorFn in $color-functions {
128
+ @each $colorName in $color-functions {
129
129
  &[inactivecolor="#{'' + $colorName}"] {
130
130
  .button-group {
131
131
 
132
132
  button[matcha-button],
133
133
  a[matcha-button] {
134
134
  &:not([active]) {
135
- color: call(#{$colorFn}, $theme);
136
- background: call(#{$colorFn}Alpha, $theme);
135
+ color: var(--matcha-color-#{$colorName});
136
+ background: var(--matcha-color-#{$colorName}-alpha);
137
137
  box-shadow: 0 0 0 0px;
138
138
 
139
139
  .ripple {
140
- background: call(#{$colorFn}ContrastAlpha, $theme) // ok: legacy ripple color token
140
+ background: var(--matcha-color-#{$colorName}-contrast-alpha) // ok: legacy ripple color token
141
141
  }
142
142
  }
143
143
  }
@@ -166,7 +166,7 @@
166
166
  @mixin _colorize-inactive-type-link-button-toggle-item($theme, $color-functions) {
167
167
 
168
168
  &[inactivetype="link"] {
169
- @each $colorName, $colorFn in $color-functions {
169
+ @each $colorName in $color-functions {
170
170
  &[inactivecolor="#{'' + $colorName}"] {
171
171
  .button-group {
172
172
 
@@ -175,11 +175,11 @@
175
175
  &:not([active]) {
176
176
 
177
177
  background: transparent;
178
- color: call(#{$colorFn}, $theme);
178
+ color: var(--matcha-color-#{$colorName});
179
179
  box-shadow: 0 0 0 0px;
180
180
 
181
181
  .ripple {
182
- background: call(#{$colorFn}Alpha, $theme); // ok: legacy ripple color token
182
+ background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
183
183
  }
184
184
 
185
185
  }
@@ -210,34 +210,10 @@
210
210
 
211
211
 
212
212
  @mixin matcha-button-toggle($theme) {
213
- $color-functions: (
214
- red: getRed,
215
- pink: getPink,
216
- purple: getPurple,
217
- deep-purple: getDeepPurple,
218
- indigo: getIndigo,
219
- blue: getBlue,
220
- light-blue: getLightBlue,
221
- cyan: getCyan,
222
- teal: getTeal,
223
- green: getGreen,
224
- light-green: getLightGreen,
225
- lime: getLime,
226
- yellow: getYellow,
227
- amber: getAmber,
228
- orange: getOrange,
229
- deep-orange: getDeepOrange,
230
- brown: getBrown,
231
- grey: getGrey,
232
- blue-grey: getBlueGrey,
233
- primary: getPrimary,
234
- accent: getAccent,
235
- success: getSuccess,
236
- warn: getWarn,
237
- danger: getDanger,
238
- info: getInfo,
239
- disabled: getDisabled,
240
- );
213
+ // Nomes de cor (semânticas + paleta). Cores vêm de var(--matcha-color-*) — sem getRed/$theme.
214
+ $color-functions: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal",
215
+ "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey",
216
+ "primary", "accent", "success", "warn", "danger", "info", "disabled";
241
217
 
242
218
  matcha-button-toggle {
243
219
  display: flex;
@@ -59,11 +59,14 @@ matcha-chip {
59
59
  }
60
60
  }
61
61
 
62
- // ── Selected (On) — bg + border accent, texto preto ──
62
+ // ── Selected (On) — bg + border accent, texto contrastante ──
63
+ // accent-text-on é theme-aware (branco no light onde accent=#009400 escuro;
64
+ // preto no dark onde accent=#A8D94E claro) — mesmo token de button/stepper/tabs.
65
+ // accent-contrast (legado, sempre preto) fica só de fallback.
63
66
  &[selected] {
64
67
  background: var(--matcha-color-accent, #A8D94E);
65
68
  border-color: var(--matcha-color-accent, #A8D94E);
66
- color: var(--matcha-color-accent-contrast, rgba(0, 0, 0, 0.87));
69
+ color: var(--matcha-color-accent-text-on, var(--matcha-color-accent-contrast, rgba(0, 0, 0, 0.87)));
67
70
 
68
71
  // On interactive — Hover (overlay rgba(0,0,0,0.2) sobre accent) ──
69
72
  &[interactive]:not([disabled]):not(.matcha-chip-disabled):hover {
@@ -113,7 +116,7 @@ matcha-chip {
113
116
  }
114
117
 
115
118
  matcha-chip[selected] .matcha-chip-leading {
116
- color: var(--matcha-color-accent-contrast, rgba(0, 0, 0, 0.87));
119
+ color: var(--matcha-color-accent-text-on, var(--matcha-color-accent-contrast, rgba(0, 0, 0, 0.87)));
117
120
  }
118
121
 
119
122
  matcha-chip[disabled] .matcha-chip-leading,
@@ -205,38 +208,30 @@ matcha-chip .matcha-chip-remove [class*=" i-matcha-"] {
205
208
  // ============================================================================
206
209
 
207
210
  @mixin matcha-chip-theme($theme) {
208
- $chip-colors: (
209
- primary: (getPrimary, getPrimaryContrast),
210
- success: (getSuccess, getSuccessContrast),
211
- warn: (getWarn, getWarnContrast),
212
- danger: (getDanger, getDangerContrast),
213
- info: (getInfo, getInfoContrast),
214
- );
211
+ // Cores semânticas além de accent — var(--matcha-color-*), sem getters/$theme.
212
+ $chip-colors: primary, success, warn, danger, info;
215
213
 
216
214
  matcha-chip {
217
- @each $name, $fns in $chip-colors {
218
- $fn: nth($fns, 1);
219
- $fnContrast: nth($fns, 2);
220
-
215
+ @each $name in $chip-colors {
221
216
  &[color="#{$name}"] {
222
217
  // Off na cor: outline + texto na cor (visualmente quente)
223
- border-color: call(get-function(#{$fn}), $theme);
224
- color: call(get-function(#{$fn}), $theme);
218
+ border-color: var(--matcha-color-#{$name});
219
+ color: var(--matcha-color-#{$name});
225
220
 
226
221
  .matcha-chip-leading {
227
- color: call(get-function(#{$fn}), $theme);
222
+ color: var(--matcha-color-#{$name});
228
223
  }
229
224
 
230
225
  // Selected na cor: filled
231
226
  &[selected],
232
227
  // Explicit variant=filled — sem precisar [selected] (status estático)
233
228
  &[variant="filled"] {
234
- background-color: call(get-function(#{$fn}), $theme);
235
- border-color: call(get-function(#{$fn}), $theme);
236
- color: call(get-function(#{$fnContrast}), $theme);
229
+ background-color: var(--matcha-color-#{$name});
230
+ border-color: var(--matcha-color-#{$name});
231
+ color: var(--matcha-color-#{$name}-contrast);
237
232
 
238
233
  .matcha-chip-leading {
239
- color: call(get-function(#{$fnContrast}), $theme);
234
+ color: var(--matcha-color-#{$name}-contrast);
240
235
  }
241
236
  }
242
237
 
@@ -246,10 +241,10 @@ matcha-chip .matcha-chip-remove [class*=" i-matcha-"] {
246
241
  &[variant="filled-alpha"] {
247
242
  background-color: var(--matcha-color-feedback-#{$name}-alpha, var(--matcha-color-#{$name}-alpha));
248
243
  border-color: transparent;
249
- color: call(get-function(#{$fn}), $theme);
244
+ color: var(--matcha-color-#{$name});
250
245
 
251
246
  .matcha-chip-leading {
252
- color: call(get-function(#{$fn}), $theme);
247
+ color: var(--matcha-color-#{$name});
253
248
  }
254
249
  }
255
250
  }
@@ -1,6 +1,17 @@
1
1
  // =============================================================================
2
2
  // matcha-page-builder — Estilos globais para o editor GrapesJS
3
3
  // Extraído do index-cdn.html e adaptado como mixin de tema.
4
+ // -----------------------------------------------------------------------------
5
+ // ⚠️ CSS VENDORIZADO (GrapeJS + color-picker Spectrum). A TEMATIZAÇÃO é feita
6
+ // pelo BRIDGE de vars --gjs-* → var(--matcha-color-*) logo abaixo: o GrapeJS
7
+ // re-colore sua chrome por essas vars. Os hex HARDCODED restantes são
8
+ // FUNCIONAIS do vendor e NÃO devem virar token:
9
+ // • Spectrum color-picker (.sp-*, ~L3113-3769): swatches + barra de matiz
10
+ // (linear-gradient #ff0000→#ffff00→… É o arco-íris do seletor de cor);
11
+ // • syntax-highlight / cores utilitárias do editor (#090/#d44/#292/…);
12
+ // • gradientes e alphas de overlay.
13
+ // Converter esses para tokens QUEBRA o editor. Corrige a leitura ingênua de
14
+ // matcha-page-builder-001 ("220 hex p/ migrar") — a integração de tema é o bridge.
4
15
  // =============================================================================
5
16
 
6
17
  @mixin matcha-page-builder-theme($theme) {
@@ -30,8 +41,8 @@
30
41
  --gjs-color-yellow: var(--matcha-prim-yellow-500);
31
42
  --gjs-color-green: var(--matcha-color-success);
32
43
  --gjs-left-width: 15%;
33
- --gjs-color-highlight: #71b7f1;
34
- --gjs-color-warn: #ffca6f;
44
+ --gjs-color-highlight: var(--matcha-color-primary); // era #71b7f1 — realce/seleção do editor → papel primary
45
+ --gjs-color-warn: var(--matcha-color-warn); // era #ffca6f — aviso do editor → papel warn
35
46
  --gjs-handle-margin: -5px;
36
47
  --gjs-light-border: rgba(255, 255, 255, 0.05);
37
48
  --gjs-arrow-color: rgba(255, 255, 255, 0.7);
@@ -28,7 +28,7 @@
28
28
  // Bind por color attr → CSS var (mesma estratégia do slider/spinner)
29
29
  @each $name, $fn in $semantic-colors {
30
30
  &[color="#{$name}"] {
31
- --matcha-progress-fill: var(--matcha-color-#{$name}, #{call($fn, $theme)});
31
+ --matcha-progress-fill: var(--matcha-color-#{$name});
32
32
  }
33
33
  }
34
34
  }
@@ -37,7 +37,7 @@
37
37
  matcha-progress-bar[type="multi-level"] {
38
38
  @each $name, $fn in $semantic-colors {
39
39
  .progress-segment-color[data-segment-color="#{$name}"] {
40
- background-color: var(--matcha-color-#{$name}, #{call($fn, $theme)});
40
+ background-color: var(--matcha-color-#{$name});
41
41
  }
42
42
  }
43
43
  }
@@ -1,5 +1,5 @@
1
1
  @mixin matcha-select-multiple-theme($theme) {
2
- $foreground: map-get($theme, foreground);
2
+ // theme-agnóstico: cor via var(--matcha-color-*). $theme mantido só na assinatura.
3
3
 
4
4
  // O matcha-select-multiple reusa as classes .matcha-select-* do matcha-select
5
5
  // (.matcha-select-container, .matcha-select-trigger, .matcha-select-value, etc.),
@@ -29,7 +29,7 @@
29
29
  border: 0;
30
30
  outline: none;
31
31
  background: transparent;
32
- color: map-get($foreground, text);
32
+ color: var(--matcha-color-text-primary);
33
33
  font-size: 14px;
34
34
  line-height: 20px;
35
35
 
@@ -199,7 +199,7 @@ matcha-slide-toggle label {
199
199
  content: '';
200
200
  position: absolute;
201
201
  inset: 0;
202
- background: currentColor; // usa color: getXxx($theme) definido no mixin por variante
202
+ background: currentColor; // herda o color (var(--matcha-color-*)) definido por variante
203
203
  opacity: 0;
204
204
  pointer-events: none;
205
205
  transition: opacity var(--matcha-duration-instant, 80ms) linear;
@@ -30,7 +30,7 @@
30
30
  // Bind por data-color → CSS var pra cores serem trocáveis sem repetir regras
31
31
  @each $name, $fn in $semantic-colors {
32
32
  &[data-color="#{$name}"] {
33
- --matcha-slider-fill: var(--matcha-color-#{$name}, #{call($fn, $theme)});
33
+ --matcha-slider-fill: var(--matcha-color-#{$name});
34
34
  }
35
35
  }
36
36
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  @each $name, $fn in $semantic-colors {
28
28
  &[color="#{$name}"] {
29
- --matcha-spinner-fill: var(--matcha-color-#{$name}, #{call($fn, $theme)});
29
+ --matcha-spinner-fill: var(--matcha-color-#{$name});
30
30
  }
31
31
  }
32
32
  }
@@ -66,8 +66,8 @@
66
66
  // em dark e fica imperceptível). Calibrado pra delta visível mesmo sobre stripe.
67
67
  // CSS custom property values são TEXTO LITERAL pro Sass — fn calls Sass
68
68
  // dentro NÃO são avaliadas. Precisa interpolação `#{}` pra forçar Sass a
69
- // evaluar `getForeground($theme)` ANTES do output. Sem isso, o valor sai
70
- // literal no bundle (ex: `rgba(getForeground($theme), 0.12)`) e o browser
69
+ // evaluar `var(--matcha-color-fg)` ANTES do output. Sem isso, o valor sai
70
+ // literal no bundle (ex: `rgba(var(--matcha-color-fg), 0.12)`) e o browser
71
71
  // descarta como invalid CSS (= chevron invisível, hover sem cor, etc).
72
72
  --matcha-table-row-bg-hover: rgba(var(--matcha-color-fg), 0.12);
73
73
  --matcha-table-row-bg-hover-striped: rgba(var(--matcha-color-fg), 0.18);