@telperion/elements 5.1.0 → 5.3.1
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/.build-manifest.json +1 -1
- package/button/button.element.cjs +16 -8
- package/button/button.element.cjs.map +1 -1
- package/button/button.element.js +16 -8
- package/button/button.element.js.map +1 -1
- package/button/index.d.cts +3 -0
- package/button/index.d.ts +3 -0
- package/fesm/elements.mjs +85 -8
- package/fesm/elements.mjs.map +1 -1
- package/iife/button/index.js +16 -11
- package/iife/button/index.js.map +1 -1
- package/iife/elements.js +30 -25
- package/iife/elements.js.map +1 -1
- package/iife/select/index.js +18 -18
- package/iife/select/index.js.map +1 -1
- package/package.json +1 -1
- package/select/index.d.cts +75 -0
- package/select/index.d.ts +75 -0
- package/select/select.element.cjs +69 -0
- package/select/select.element.cjs.map +1 -1
- package/select/select.element.js +69 -0
- package/select/select.element.js.map +1 -1
package/.build-manifest.json
CHANGED
|
@@ -32,6 +32,9 @@ var shadeMixerLitElement = require('../utils/shade-mixer-lit-element.cjs');
|
|
|
32
32
|
*
|
|
33
33
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
34
34
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
35
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
36
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
37
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
35
38
|
*
|
|
36
39
|
* @example
|
|
37
40
|
* ```html
|
|
@@ -55,6 +58,9 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
55
58
|
${shadeMixerLitElement.ShadeMixerLitElement.shadedElementStyles}
|
|
56
59
|
--tp-button-color: var(--tp-calc-element-color);
|
|
57
60
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
61
|
+
--tp-button-active-mixer-color: transparent;
|
|
62
|
+
--tp-button-active-mixer-percentage: 10%;
|
|
63
|
+
--tp-button-active-color: color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
58
64
|
display: inline-block;
|
|
59
65
|
border: 1px solid transparent;
|
|
60
66
|
cursor: pointer;
|
|
@@ -86,25 +92,27 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
86
92
|
&[variant="ghost"] {
|
|
87
93
|
padding-inline: 1em;
|
|
88
94
|
padding-block: 0.5em;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
background-color: var(--tp-button-active-color);
|
|
98
|
+
}
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
&[variant="outline"],
|
|
92
102
|
&[variant="ghost"] {
|
|
93
103
|
color: var(--tp-button-color);
|
|
94
104
|
background-color: transparent;
|
|
105
|
+
}
|
|
95
106
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
&[variant="solid"],
|
|
108
|
+
&[variant="text"] {
|
|
109
|
+
--tp-button-active-mixer-color: var(--tp-color-black);
|
|
110
|
+
--tp-button-active-mixer-percentage: 80%;
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
&[variant="solid"] {
|
|
102
114
|
background-color: var(--tp-button-color);
|
|
103
115
|
color: var(--tp-button-contrast-color);
|
|
104
|
-
|
|
105
|
-
&:hover {
|
|
106
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 80%, var(--tp-color-black) 20%);
|
|
107
|
-
}
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
&[variant="outline"] {
|
|
@@ -120,7 +128,7 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
120
128
|
background-color: transparent;
|
|
121
129
|
|
|
122
130
|
&:hover {
|
|
123
|
-
color:
|
|
131
|
+
color: var(--tp-button-active-color);
|
|
124
132
|
text-decoration: underline;
|
|
125
133
|
}
|
|
126
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.element.cjs","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":["ButtonElement","ShadeMixerLitElement","css","html","__decorate","property","customElement"],"mappings":";;;;;;;AA6BA
|
|
1
|
+
{"version":3,"file":"button.element.cjs","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":["ButtonElement","ShadeMixerLitElement","css","html","__decorate","property","customElement"],"mappings":";;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AAEUA,qBAAa,GAAnB,MAAM,aAAc,SAAQC,yCAAoB,CAAA;;aAE9C,IAAA,CAAA,cAAc,GAAG,IAAH,CAAQ;aACb,IAAA,CAAA,MAAM,GAAG,CAAC,MAAK;QAC7B,MAAM,KAAK,GAAGC,OAAG,CAAA,CAAA;;;AAGT,UAAA,EAAAD,yCAAoB,CAAC,mBAAmB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+E/C;AAED,QAAA,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,UAAW,CAAC;AAEjF,QAAA,OAAO,KAAK;IACd,CAAC,GAxFqB,CAwFjB;AAoBI,IAAA,UAAU;AAEnB,IAAA,WAAA,GAAA;AACE,QAAA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AA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAO5BI,gBAAA,CAAA;IADCC,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAAL,qBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AA7GNA,qBAAa,GAAAI,gBAAA,CAAA;IADzBE,2BAAa,CAAC,WAAW,CAAC;;AACd,CAAA,EAAAN,qBAAa,CAiLzB;;"}
|
package/button/button.element.js
CHANGED
|
@@ -30,6 +30,9 @@ import { ShadeMixerLitElement } from '../utils/shade-mixer-lit-element.js';
|
|
|
30
30
|
*
|
|
31
31
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
32
32
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
33
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
34
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
35
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
33
36
|
*
|
|
34
37
|
* @example
|
|
35
38
|
* ```html
|
|
@@ -53,6 +56,9 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
53
56
|
${ShadeMixerLitElement.shadedElementStyles}
|
|
54
57
|
--tp-button-color: var(--tp-calc-element-color);
|
|
55
58
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
59
|
+
--tp-button-active-mixer-color: transparent;
|
|
60
|
+
--tp-button-active-mixer-percentage: 10%;
|
|
61
|
+
--tp-button-active-color: color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
56
62
|
display: inline-block;
|
|
57
63
|
border: 1px solid transparent;
|
|
58
64
|
cursor: pointer;
|
|
@@ -84,25 +90,27 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
84
90
|
&[variant="ghost"] {
|
|
85
91
|
padding-inline: 1em;
|
|
86
92
|
padding-block: 0.5em;
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
background-color: var(--tp-button-active-color);
|
|
96
|
+
}
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
&[variant="outline"],
|
|
90
100
|
&[variant="ghost"] {
|
|
91
101
|
color: var(--tp-button-color);
|
|
92
102
|
background-color: transparent;
|
|
103
|
+
}
|
|
93
104
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
&[variant="solid"],
|
|
106
|
+
&[variant="text"] {
|
|
107
|
+
--tp-button-active-mixer-color: var(--tp-color-black);
|
|
108
|
+
--tp-button-active-mixer-percentage: 80%;
|
|
97
109
|
}
|
|
98
110
|
|
|
99
111
|
&[variant="solid"] {
|
|
100
112
|
background-color: var(--tp-button-color);
|
|
101
113
|
color: var(--tp-button-contrast-color);
|
|
102
|
-
|
|
103
|
-
&:hover {
|
|
104
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 80%, var(--tp-color-black) 20%);
|
|
105
|
-
}
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
&[variant="outline"] {
|
|
@@ -118,7 +126,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
118
126
|
background-color: transparent;
|
|
119
127
|
|
|
120
128
|
&:hover {
|
|
121
|
-
color:
|
|
129
|
+
color: var(--tp-button-active-color);
|
|
122
130
|
text-decoration: underline;
|
|
123
131
|
}
|
|
124
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.element.js","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AA6BA
|
|
1
|
+
{"version":3,"file":"button.element.js","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,oBAAoB,CAAA;;aAE9C,IAAA,CAAA,cAAc,GAAG,IAAH,CAAQ;aACb,IAAA,CAAA,MAAM,GAAG,CAAC,MAAK;QAC7B,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;AAGT,UAAA,EAAA,oBAAoB,CAAC,mBAAmB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+E/C;AAED,QAAA,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,UAAW,CAAC;AAEjF,QAAA,OAAO,KAAK;IACd,CAAC,GAxFqB,CAwFjB;AAoBI,IAAA,UAAU;AAEnB,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QApBT,IAAA,CAAA,OAAO,GAAkB,OAAO;AAEhC;;;;AAIG;QAEH,IAAA,CAAA,IAAI,GAAe,QAAQ;AAE3B;;;AAGG;QAEH,IAAA,CAAA,QAAQ,GAAG,KAAK;AAsChB,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,KAAiB,KAAU;AACzC,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,KAAK,CAAC,cAAc,EAAE;gBACtB,KAAK,CAAC,wBAAwB,EAAE;gBAChC;YACF;AACA,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,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-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
98
98
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
99
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
100
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
101
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
99
102
|
*
|
|
100
103
|
* @example
|
|
101
104
|
* ```html
|
package/button/index.d.ts
CHANGED
|
@@ -96,6 +96,9 @@ declare global {
|
|
|
96
96
|
*
|
|
97
97
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
98
98
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
99
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
100
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
101
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
99
102
|
*
|
|
100
103
|
* @example
|
|
101
104
|
* ```html
|
package/fesm/elements.mjs
CHANGED
|
@@ -2950,6 +2950,9 @@ let SelectElement = class SelectElement extends SignalWatcherLitElement {
|
|
|
2950
2950
|
}
|
|
2951
2951
|
`; }
|
|
2952
2952
|
#options;
|
|
2953
|
+
get #popover() {
|
|
2954
|
+
return this.shadowRoot?.querySelector("tp-popover");
|
|
2955
|
+
}
|
|
2953
2956
|
#value;
|
|
2954
2957
|
get value() {
|
|
2955
2958
|
return this.#value.get();
|
|
@@ -3203,6 +3206,72 @@ let SelectElement = class SelectElement extends SignalWatcherLitElement {
|
|
|
3203
3206
|
this.selectOption(option);
|
|
3204
3207
|
}
|
|
3205
3208
|
}
|
|
3209
|
+
/**
|
|
3210
|
+
* Open, close, or toggle the dropdown popover.
|
|
3211
|
+
*
|
|
3212
|
+
* Overrides the native {@link HTMLElement.togglePopover} so callers can
|
|
3213
|
+
* drive the select from outside without reaching into the shadow DOM.
|
|
3214
|
+
* `<tp-select>` itself is not the popover element — the actual popover
|
|
3215
|
+
* lives inside its shadow root — so the call is delegated to the inner
|
|
3216
|
+
* `<tp-popover>`.
|
|
3217
|
+
*
|
|
3218
|
+
* @param options Same shape as the native API: pass `true` to force open,
|
|
3219
|
+
* `false` to force close, or a `{ force }` options bag. Omit to toggle
|
|
3220
|
+
* between the two states.
|
|
3221
|
+
* @returns `true` if the popover ends up open, `false` otherwise (matching
|
|
3222
|
+
* the native return value). Returns `false` early if the inner popover
|
|
3223
|
+
* isn't reachable yet (for example, before the first render).
|
|
3224
|
+
*
|
|
3225
|
+
* @example
|
|
3226
|
+
* ```ts
|
|
3227
|
+
* const select = document.querySelector('tp-select');
|
|
3228
|
+
* select.togglePopover(); // toggle
|
|
3229
|
+
* select.togglePopover(true); // force open
|
|
3230
|
+
* select.togglePopover(false); // force close
|
|
3231
|
+
* ```
|
|
3232
|
+
*/
|
|
3233
|
+
togglePopover() {
|
|
3234
|
+
return this.#popover.togglePopover();
|
|
3235
|
+
}
|
|
3236
|
+
/**
|
|
3237
|
+
* Close the dropdown popover.
|
|
3238
|
+
*
|
|
3239
|
+
* Overrides the native {@link HTMLElement.hidePopover} so callers can
|
|
3240
|
+
* close the select from outside without reaching into the shadow DOM.
|
|
3241
|
+
* `<tp-select>` itself is not the popover element — the actual popover
|
|
3242
|
+
* lives inside its shadow root — so the call is delegated to the inner
|
|
3243
|
+
* `<tp-popover>`.
|
|
3244
|
+
*
|
|
3245
|
+
* No-op if the popover is already closed.
|
|
3246
|
+
*
|
|
3247
|
+
* @example
|
|
3248
|
+
* ```ts
|
|
3249
|
+
* document.querySelector('tp-select').hidePopover();
|
|
3250
|
+
* ```
|
|
3251
|
+
*/
|
|
3252
|
+
hidePopover() {
|
|
3253
|
+
this.#popover.hidePopover();
|
|
3254
|
+
}
|
|
3255
|
+
/**
|
|
3256
|
+
* Open the dropdown popover.
|
|
3257
|
+
*
|
|
3258
|
+
* Overrides the native {@link HTMLElement.showPopover} so callers can
|
|
3259
|
+
* open the select from outside without reaching into the shadow DOM.
|
|
3260
|
+
* `<tp-select>` itself is not the popover element — the actual popover
|
|
3261
|
+
* lives inside its shadow root — so the call is delegated to the inner
|
|
3262
|
+
* `<tp-popover>`.
|
|
3263
|
+
*
|
|
3264
|
+
* @param options Same shape as the native API (e.g. `{ source }` to set
|
|
3265
|
+
* the invoker for the popover invoker relationship).
|
|
3266
|
+
*
|
|
3267
|
+
* @example
|
|
3268
|
+
* ```ts
|
|
3269
|
+
* document.querySelector('tp-select').showPopover();
|
|
3270
|
+
* ```
|
|
3271
|
+
*/
|
|
3272
|
+
showPopover() {
|
|
3273
|
+
this.#popover.showPopover();
|
|
3274
|
+
}
|
|
3206
3275
|
[REGISTER_OPTION](option) {
|
|
3207
3276
|
this.#options.add(option);
|
|
3208
3277
|
}
|
|
@@ -3439,6 +3508,9 @@ __decorate([
|
|
|
3439
3508
|
*
|
|
3440
3509
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
3441
3510
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
3511
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
3512
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
3513
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
3442
3514
|
*
|
|
3443
3515
|
* @example
|
|
3444
3516
|
* ```html
|
|
@@ -3462,6 +3534,9 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3462
3534
|
${ShadeMixerLitElement.shadedElementStyles}
|
|
3463
3535
|
--tp-button-color: var(--tp-calc-element-color);
|
|
3464
3536
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
3537
|
+
--tp-button-active-mixer-color: transparent;
|
|
3538
|
+
--tp-button-active-mixer-percentage: 10%;
|
|
3539
|
+
--tp-button-active-color: color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
3465
3540
|
display: inline-block;
|
|
3466
3541
|
border: 1px solid transparent;
|
|
3467
3542
|
cursor: pointer;
|
|
@@ -3493,25 +3568,27 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3493
3568
|
&[variant="ghost"] {
|
|
3494
3569
|
padding-inline: 1em;
|
|
3495
3570
|
padding-block: 0.5em;
|
|
3571
|
+
|
|
3572
|
+
&:hover {
|
|
3573
|
+
background-color: var(--tp-button-active-color);
|
|
3574
|
+
}
|
|
3496
3575
|
}
|
|
3497
3576
|
|
|
3498
3577
|
&[variant="outline"],
|
|
3499
3578
|
&[variant="ghost"] {
|
|
3500
3579
|
color: var(--tp-button-color);
|
|
3501
3580
|
background-color: transparent;
|
|
3581
|
+
}
|
|
3502
3582
|
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3583
|
+
&[variant="solid"],
|
|
3584
|
+
&[variant="text"] {
|
|
3585
|
+
--tp-button-active-mixer-color: var(--tp-color-black);
|
|
3586
|
+
--tp-button-active-mixer-percentage: 80%;
|
|
3506
3587
|
}
|
|
3507
3588
|
|
|
3508
3589
|
&[variant="solid"] {
|
|
3509
3590
|
background-color: var(--tp-button-color);
|
|
3510
3591
|
color: var(--tp-button-contrast-color);
|
|
3511
|
-
|
|
3512
|
-
&:hover {
|
|
3513
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 80%, var(--tp-color-black) 20%);
|
|
3514
|
-
}
|
|
3515
3592
|
}
|
|
3516
3593
|
|
|
3517
3594
|
&[variant="outline"] {
|
|
@@ -3527,7 +3604,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3527
3604
|
background-color: transparent;
|
|
3528
3605
|
|
|
3529
3606
|
&:hover {
|
|
3530
|
-
color:
|
|
3607
|
+
color: var(--tp-button-active-color);
|
|
3531
3608
|
text-decoration: underline;
|
|
3532
3609
|
}
|
|
3533
3610
|
}
|