@adnap/krysalicss 0.0.1 → 0.1.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/README.md +23 -5
- package/dist/element/badge.css +30 -0
- package/dist/element/badge.min.css +1 -1
- package/dist/element/box.css +193 -0
- package/dist/element/box.min.css +1 -0
- package/dist/element/button.css +4 -0
- package/dist/element/button.min.css +1 -1
- package/dist/element/divider.css +155 -0
- package/dist/element/divider.min.css +1 -0
- package/dist/element/image.css +434 -0
- package/dist/element/image.min.css +1 -0
- package/dist/element/range.css +2 -2
- package/dist/element/spinner.css +190 -0
- package/dist/element/spinner.min.css +1 -0
- package/dist/helper/border.css +141 -0
- package/dist/helper/border.min.css +1 -0
- package/dist/helper/color.css +203 -0
- package/dist/helper/color.min.css +1 -0
- package/dist/helper/flex.css +277 -0
- package/dist/helper/flex.min.css +1 -0
- package/dist/helper/font-size.css +137 -0
- package/dist/helper/font-size.min.css +1 -0
- package/dist/helper/interactions.css +142 -0
- package/dist/helper/interactions.min.css +1 -0
- package/dist/helper/line-height.css +129 -0
- package/dist/helper/line-height.min.css +1 -0
- package/dist/helper/object-fit.css +133 -0
- package/dist/helper/object-fit.min.css +1 -0
- package/dist/helper/overflow.css +165 -0
- package/dist/helper/overflow.min.css +1 -0
- package/dist/helper/position.css +157 -0
- package/dist/helper/position.min.css +1 -0
- package/dist/helper/ratio.css +142 -0
- package/dist/helper/ratio.min.css +1 -0
- package/dist/helper/shadow.css +129 -0
- package/dist/helper/shadow.min.css +1 -0
- package/dist/helper/sizing.css +177 -0
- package/dist/helper/sizing.min.css +1 -0
- package/dist/helper/spacing.css +563 -0
- package/dist/helper/spacing.min.css +1 -0
- package/dist/helper/stack.css +127 -0
- package/dist/helper/stack.min.css +1 -0
- package/dist/helper/text.css +243 -0
- package/dist/helper/text.min.css +1 -0
- package/dist/helper/tooltip.css +174 -0
- package/dist/helper/tooltip.min.css +1 -0
- package/dist/helper/visibility.css +334 -0
- package/dist/helper/visibility.min.css +1 -0
- package/dist/krysalicss.css +3491 -414
- package/dist/krysalicss.css.map +1 -1
- package/dist/krysalicss.min.css +1 -1
- package/dist/layout/footer.css +155 -0
- package/dist/layout/footer.min.css +1 -0
- package/dist/layout/hero.css +177 -0
- package/dist/layout/hero.min.css +1 -0
- package/dist/module/alert.css +30 -0
- package/dist/module/alert.min.css +1 -1
- package/dist/module/breadcrumb.css +163 -0
- package/dist/module/breadcrumb.min.css +1 -0
- package/dist/module/buttons.css +158 -0
- package/dist/module/buttons.min.css +1 -0
- package/dist/module/card.css +89 -0
- package/dist/module/card.min.css +1 -1
- package/dist/module/dropdown.css +253 -0
- package/dist/module/dropdown.min.css +1 -0
- package/dist/module/navbar.css +1 -1
- package/dist/module/navbar.min.css +1 -1
- package/dist/module/pagination.css +301 -0
- package/dist/module/pagination.min.css +1 -0
- package/dist/module/popover.css +272 -0
- package/dist/module/popover.min.css +1 -0
- package/dist/module/section.css +138 -0
- package/dist/module/section.min.css +1 -0
- package/dist/module/toast.css +307 -0
- package/dist/module/toast.min.css +1 -0
- package/dist/scss-api.json +4672 -0
- package/dist/typography/blockquote.css +128 -0
- package/dist/typography/blockquote.min.css +1 -0
- package/dist/typography/figure.css +132 -0
- package/dist/typography/figure.min.css +1 -0
- package/dist/typography/lead.css +119 -0
- package/dist/typography/lead.min.css +1 -0
- package/dist/typography/list.css +125 -0
- package/dist/typography/list.min.css +1 -0
- package/package.json +8 -2
- package/src/base/global/_plugin.scss +2 -0
- package/src/base/reset/_plugin.scss +2 -0
- package/src/base/reset/_variables.scss +2 -0
- package/src/element/_index.scss +4 -0
- package/src/element/badge/_plugin.scss +6 -8
- package/src/element/badge/_variables.scss +4 -6
- package/src/element/box/_index.scss +2 -0
- package/src/element/box/_plugin.scss +31 -0
- package/src/element/box/_variables.scss +18 -0
- package/src/element/button/_plugin.scss +20 -1
- package/src/element/checkbox/_plugin.scss +3 -4
- package/src/element/checkbox/_variables.scss +2 -5
- package/src/element/divider/_index.scss +2 -0
- package/src/element/divider/_plugin.scss +69 -0
- package/src/element/divider/_variables.scss +16 -0
- package/src/element/file/_plugin.scss +2 -0
- package/src/element/file/_variables.scss +2 -6
- package/src/element/image/_index.scss +2 -0
- package/src/element/image/_plugin.scss +106 -0
- package/src/element/image/_variables.scss +53 -0
- package/src/element/progress/_plugin.scss +9 -28
- package/src/element/progress/_variables.scss +2 -8
- package/src/element/radio/_plugin.scss +4 -4
- package/src/element/radio/_variables.scss +2 -2
- package/src/element/range/_plugin.scss +9 -20
- package/src/element/range/_variables.scss +7 -1
- package/src/element/select/_plugin.scss +3 -4
- package/src/element/select/_variables.scss +2 -6
- package/src/element/spinner/_index.scss +2 -0
- package/src/element/spinner/_plugin.scss +78 -0
- package/src/element/spinner/_variables.scss +22 -0
- package/src/element/switch/_plugin.scss +6 -10
- package/src/element/switch/_variables.scss +2 -10
- package/src/element/text-input/_plugin.scss +3 -1
- package/src/element/text-input/_variables.scss +5 -5
- package/src/element/textarea/_plugin.scss +3 -1
- package/src/element/textarea/_variables.scss +2 -2
- package/src/helper/_border.scss +43 -0
- package/src/helper/_color.scss +29 -0
- package/src/helper/{_controls.scss → _controls-internal.scss} +21 -0
- package/src/helper/_flex.scss +89 -0
- package/src/helper/_font-size.scss +22 -0
- package/src/helper/_index.scss +18 -1
- package/src/helper/_interactions.scss +41 -0
- package/src/helper/_line-height.scss +22 -0
- package/src/helper/_object-fit.scss +15 -0
- package/src/helper/_overflow.scss +28 -0
- package/src/helper/_position.scss +47 -0
- package/src/helper/_ratio.scss +35 -0
- package/src/helper/_shadow.scss +31 -0
- package/src/helper/_sizing.scss +65 -0
- package/src/helper/_spacing.scss +95 -0
- package/src/helper/_stack.scss +24 -0
- package/src/helper/_state.scss +2 -17
- package/src/helper/_text.scss +92 -0
- package/src/helper/_tooltip.scss +100 -0
- package/src/helper/_visibility.scss +80 -0
- package/src/layout/_index.scss +2 -0
- package/src/layout/container/_plugin.scss +2 -0
- package/src/layout/container/_variables.scss +2 -0
- package/src/layout/flex/_plugin.scss +2 -1
- package/src/layout/flex/_variables.scss +2 -2
- package/src/layout/footer/_index.scss +2 -0
- package/src/layout/footer/_plugin.scss +24 -0
- package/src/layout/footer/_variables.scss +11 -0
- package/src/layout/grid/_plugin.scss +2 -0
- package/src/layout/grid/_variables.scss +20 -16
- package/src/layout/hero/_index.scss +2 -0
- package/src/layout/hero/_plugin.scss +54 -0
- package/src/layout/hero/_variables.scss +23 -0
- package/src/module/_index.scss +7 -0
- package/src/module/alert/_plugin.scss +6 -1
- package/src/module/alert/_variables.scss +7 -0
- package/src/module/breadcrumb/_index.scss +2 -0
- package/src/module/breadcrumb/_plugin.scss +73 -0
- package/src/module/breadcrumb/_variables.scss +27 -0
- package/src/module/buttons/_index.scss +2 -0
- package/src/module/buttons/_plugin.scss +67 -0
- package/src/module/buttons/_variables.scss +10 -0
- package/src/module/card/_plugin.scss +96 -2
- package/src/module/card/_variables.scss +39 -0
- package/src/module/dropdown/_index.scss +2 -0
- package/src/module/dropdown/_plugin.scss +155 -0
- package/src/module/dropdown/_variables.scss +50 -0
- package/src/module/field/_plugin.scss +2 -0
- package/src/module/modal/_plugin.scss +2 -0
- package/src/module/navbar/_plugin.scss +4 -1
- package/src/module/navbar/_variables.scss +6 -2
- package/src/module/pagination/_index.scss +2 -0
- package/src/module/pagination/_plugin.scss +276 -0
- package/src/module/pagination/_variables.scss +64 -0
- package/src/module/popover/_index.scss +2 -0
- package/src/module/popover/_plugin.scss +183 -0
- package/src/module/popover/_variables.scss +44 -0
- package/src/module/section/_index.scss +2 -0
- package/src/module/section/_plugin.scss +47 -0
- package/src/module/section/_variables.scss +24 -0
- package/src/module/tabs/_plugin.scss +3 -1
- package/src/module/toast/_index.scss +2 -0
- package/src/module/toast/_plugin.scss +184 -0
- package/src/module/toast/_variables.scss +56 -0
- package/src/typography/_index.scss +4 -0
- package/src/typography/base/_plugin.scss +2 -0
- package/src/typography/base/_variables.scss +4 -3
- package/src/typography/blockquote/_index.scss +2 -0
- package/src/typography/blockquote/_plugin.scss +22 -0
- package/src/typography/blockquote/_variables.scss +13 -0
- package/src/typography/content/_plugin.scss +2 -0
- package/src/typography/content/_variables.scss +2 -0
- package/src/typography/figure/_index.scss +2 -0
- package/src/typography/figure/_plugin.scss +29 -0
- package/src/typography/figure/_variables.scss +13 -0
- package/src/typography/lead/_index.scss +2 -0
- package/src/typography/lead/_plugin.scss +12 -0
- package/src/typography/lead/_variables.scss +6 -0
- package/src/typography/link/_mixins.scss +2 -0
- package/src/typography/link/_plugin.scss +2 -0
- package/src/typography/link/_variables.scss +2 -0
- package/src/typography/list/_index.scss +2 -0
- package/src/typography/list/_plugin.scss +18 -0
- package/src/typography/list/_variables.scss +6 -0
- package/src/typography/table/_plugin.scss +2 -0
- package/src/typography/table/_variables.scss +2 -0
- package/src/typography/title/_plugin.scss +2 -0
- package/src/typography/title/_variables.scss +2 -0
- package/src/variables/_color.scss +20 -12
- package/src/variables/_feature.scss +36 -0
- package/src/variables/_global.scss +8 -0
- package/src/variables/_selector.scss +1 -0
- package/dist/tokens/dark.json +0 -85
- package/dist/tokens/default.json +0 -85
- package/dist/tokens/high-contrast.json +0 -85
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "variables" as *;
|
|
3
|
+
@use "../../variables";
|
|
4
|
+
@use "../../helper/controls-internal" as controls;
|
|
5
|
+
|
|
6
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/box.mdx
|
|
7
|
+
|
|
8
|
+
@if variables.$feature-element-box {
|
|
9
|
+
#{$selector} {
|
|
10
|
+
@include variables.backgroundColor(
|
|
11
|
+
box-bg,
|
|
12
|
+
list.nth($default-combination, 1),
|
|
13
|
+
);
|
|
14
|
+
@include variables.textColor(box-fg, list.nth($default-combination, 2));
|
|
15
|
+
display: block;
|
|
16
|
+
padding: $padding;
|
|
17
|
+
border-radius: $border-radius;
|
|
18
|
+
box-shadow: $shadow;
|
|
19
|
+
|
|
20
|
+
@include controls.nestedLinks;
|
|
21
|
+
|
|
22
|
+
@include controls.combinations-apply();
|
|
23
|
+
@if $enable-light {
|
|
24
|
+
@include controls.combinations-apply-light();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (forced-colors: active) {
|
|
28
|
+
border: 1px solid CanvasText;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use "../../variables";
|
|
2
|
+
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/box.mdx
|
|
4
|
+
|
|
5
|
+
$selector: ".box" !default;
|
|
6
|
+
|
|
7
|
+
$enable-light: variables.$feature-light-variants !default;
|
|
8
|
+
|
|
9
|
+
$padding: variables.$size-medium !default;
|
|
10
|
+
$border-radius: variables.$global-border-radius !default;
|
|
11
|
+
|
|
12
|
+
$shadow: var(
|
|
13
|
+
--kc-shadow-sm,
|
|
14
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.05),
|
|
15
|
+
0 1px 3px 0 rgba(0, 0, 0, 0.1)
|
|
16
|
+
) !default;
|
|
17
|
+
|
|
18
|
+
$default-combination: variables.$color-combination-default !default;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
@use "sass:list";
|
|
2
2
|
@use "variables" as *;
|
|
3
3
|
@use "../../variables";
|
|
4
|
-
@use "../../helper/controls" as controls;
|
|
4
|
+
@use "../../helper/controls-internal" as controls;
|
|
5
5
|
@use "../../typography/link/mixins" as link;
|
|
6
6
|
|
|
7
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/button.mdx
|
|
8
|
+
|
|
7
9
|
@if variables.$feature-element-button {
|
|
8
10
|
#{$selector} {
|
|
9
11
|
@include variables.backgroundColor(
|
|
@@ -32,6 +34,23 @@
|
|
|
32
34
|
);
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
// Pin the foreground at every link-state pseudo so `<a class="button">`
|
|
38
|
+
// renders identically to `<button class="button">`. Without this,
|
|
39
|
+
// typography/link's globally-scoped `a:link/:visited/:hover` rules
|
|
40
|
+
// (specificity 0,1,1) out-cascade the bare `.button` color (0,1,0)
|
|
41
|
+
// and bleed link-tone text into the button at rest and on hover.
|
|
42
|
+
// Restating here at (0,2,0) wins over the link rules while ties with
|
|
43
|
+
// the modifier loop below — combinations and `.is-link` sit later in
|
|
44
|
+
// source so they still own their own colour contract.
|
|
45
|
+
&:link,
|
|
46
|
+
&:visited,
|
|
47
|
+
&:hover {
|
|
48
|
+
@include variables.textColor(
|
|
49
|
+
default-fg,
|
|
50
|
+
list.nth($default-combination, 2),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
35
54
|
// `filter: brightness()` is preferred over swapping `(bg, fg)` on hover:
|
|
36
55
|
// brightness scales every channel uniformly so the rest-state contrast
|
|
37
56
|
// ratio is preserved, which means every shipped combination AND any
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use "variables" as *;
|
|
2
2
|
@use "../../variables";
|
|
3
|
-
@use "../../helper/controls" as controls;
|
|
3
|
+
@use "../../helper/controls-internal" as controls;
|
|
4
|
+
|
|
5
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/checkbox.mdx
|
|
4
6
|
|
|
5
7
|
@if variables.$feature-element-checkbox {
|
|
6
8
|
#{$selector} {
|
|
@@ -21,9 +23,6 @@
|
|
|
21
23
|
&:checked {
|
|
22
24
|
background-color: var(--kc-primary-bg, currentColor);
|
|
23
25
|
border-color: var(--kc-primary-bg, currentColor);
|
|
24
|
-
// The SVG strokes with `currentColor`; pinning `color` to the
|
|
25
|
-
// primary foreground token guarantees the tick contrasts the fill
|
|
26
|
-
// whatever the theme's primary palette is.
|
|
27
26
|
color: var(--kc-primary-fg, currentColor);
|
|
28
27
|
background-image: $check-image;
|
|
29
28
|
background-repeat: no-repeat;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/checkbox.mdx
|
|
4
|
+
|
|
3
5
|
// Excludes `.switch`-classed inputs so the switch plugin can fully restyle
|
|
4
6
|
// them. Keep this exclusion in sync if you add another checkbox variant.
|
|
5
7
|
$selector: 'input[type="checkbox"]:not(.switch)' !default;
|
|
@@ -15,10 +17,5 @@ $focus-outline-offset: variables.$global-focus-outline-offset !default;
|
|
|
15
17
|
$disabled-opacity: variables.$global-disabled-opacity !default;
|
|
16
18
|
$border-mix: variables.$global-border-mix !default;
|
|
17
19
|
|
|
18
|
-
// Inline tick mark using `stroke="currentColor"`: the SVG inherits the
|
|
19
|
-
// element's `color`, which the plugin pins to `--kc-primary-fg` on
|
|
20
|
-
// `:checked`. That keeps the tick AAA-readable against any primary-bg
|
|
21
|
-
// the theme picks (deep sage, mid-tone teal, a high-contrast cyan):
|
|
22
|
-
// the fg token is always the contrast pair of the bg token.
|
|
23
20
|
$check-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="none"><path d="M2.5 6.5l2.5 2.5 4.5-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')
|
|
24
21
|
!default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@use "variables" as *;
|
|
2
|
+
@use "../../variables";
|
|
3
|
+
|
|
4
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/divider.mdx
|
|
5
|
+
|
|
6
|
+
@if variables.$feature-element-divider {
|
|
7
|
+
#{$selector} {
|
|
8
|
+
display: block;
|
|
9
|
+
block-size: 0;
|
|
10
|
+
margin-block: $gap;
|
|
11
|
+
border: 0;
|
|
12
|
+
border-block-start: $thickness solid
|
|
13
|
+
color-mix(in srgb, var(--kc-fg, currentColor) #{$color-mix}, transparent);
|
|
14
|
+
|
|
15
|
+
&#{$vertical-selector} {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
block-size: auto;
|
|
18
|
+
inline-size: 0;
|
|
19
|
+
align-self: stretch;
|
|
20
|
+
min-block-size: $vertical-min-height;
|
|
21
|
+
margin-block: 0;
|
|
22
|
+
margin-inline: $gap;
|
|
23
|
+
border-block-start: 0;
|
|
24
|
+
border-inline-start: $thickness solid
|
|
25
|
+
color-mix(
|
|
26
|
+
in srgb,
|
|
27
|
+
var(--kc-fg, currentColor) #{$color-mix},
|
|
28
|
+
transparent
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&#{$has-text-selector} {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: $text-line-gap;
|
|
36
|
+
block-size: auto;
|
|
37
|
+
border: 0;
|
|
38
|
+
// `text-align: center` redundant under flex but kept for the case
|
|
39
|
+
// where consumer JS strips the flex (e.g. test snapshot transforms).
|
|
40
|
+
text-align: center;
|
|
41
|
+
|
|
42
|
+
&::before,
|
|
43
|
+
&::after {
|
|
44
|
+
content: "";
|
|
45
|
+
flex: 1 1 0;
|
|
46
|
+
block-size: 0;
|
|
47
|
+
border-block-start: $thickness solid
|
|
48
|
+
color-mix(
|
|
49
|
+
in srgb,
|
|
50
|
+
var(--kc-fg, currentColor) #{$color-mix},
|
|
51
|
+
transparent
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (forced-colors: active) {
|
|
58
|
+
#{$selector} {
|
|
59
|
+
border-color: CanvasText;
|
|
60
|
+
|
|
61
|
+
&#{$has-text-selector} {
|
|
62
|
+
&::before,
|
|
63
|
+
&::after {
|
|
64
|
+
border-color: CanvasText;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use "../../variables";
|
|
2
|
+
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/divider.mdx
|
|
4
|
+
|
|
5
|
+
$selector: ".divider" !default;
|
|
6
|
+
$vertical-selector: "#{variables.$selector-prefix-is}vertical" !default;
|
|
7
|
+
$has-text-selector: "#{variables.$selector-prefix-is}has-text" !default;
|
|
8
|
+
|
|
9
|
+
$thickness: variables.$global-border-width !default;
|
|
10
|
+
$gap: variables.$global-gap !default;
|
|
11
|
+
|
|
12
|
+
$color-mix: 50% !default;
|
|
13
|
+
|
|
14
|
+
$text-line-gap: variables.$size-small !default;
|
|
15
|
+
|
|
16
|
+
$vertical-min-height: 1em !default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use "sass:math";
|
|
2
2
|
@use "../../variables";
|
|
3
3
|
|
|
4
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/file.mdx
|
|
5
|
+
|
|
4
6
|
$selector: 'input[type="file"]' !default;
|
|
5
7
|
|
|
6
8
|
$padding-y: variables.$size-extra-small !default;
|
|
@@ -16,12 +18,6 @@ $focus-outline-offset: variables.$global-focus-outline-offset !default;
|
|
|
16
18
|
$disabled-opacity: variables.$global-disabled-opacity !default;
|
|
17
19
|
$border-mix: variables.$global-border-mix !default;
|
|
18
20
|
|
|
19
|
-
// Native UA chrome for the "Choose file" button differs (Chrome paints a
|
|
20
|
-
// styled button, Safari paints plain bare text). Style only the wrapper:
|
|
21
|
-
// portable, no surprises across browsers. Vendor pseudos (`::file-selector-
|
|
22
|
-
// button`) get optional polish in their own rule blocks. The inner button
|
|
23
|
-
// is intentionally tighter than a top-level `.button`; padding-y is half the
|
|
24
|
-
// `extra-small` size token, padding-x rounds up to `small`.
|
|
25
21
|
$button-padding-y: math.div(variables.$size-extra-small, 2) !default;
|
|
26
22
|
$button-padding-x: variables.$size-small !default;
|
|
27
23
|
$button-border-radius: variables.$global-border-radius !default;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "variables" as *;
|
|
3
|
+
@use "../../variables";
|
|
4
|
+
|
|
5
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/image.mdx
|
|
6
|
+
|
|
7
|
+
@if variables.$feature-element-image {
|
|
8
|
+
#{$selector} {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: block;
|
|
11
|
+
max-inline-size: 100%;
|
|
12
|
+
|
|
13
|
+
> img,
|
|
14
|
+
> video,
|
|
15
|
+
> iframe,
|
|
16
|
+
> picture > img {
|
|
17
|
+
display: block;
|
|
18
|
+
max-inline-size: 100%;
|
|
19
|
+
block-size: auto;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@each $name, $value in $ratios {
|
|
24
|
+
#{$selector}#{variables.$selector-prefix-is}#{$name} {
|
|
25
|
+
--kc-image-ratio: #{$value};
|
|
26
|
+
aspect-ratio: var(--kc-image-ratio);
|
|
27
|
+
|
|
28
|
+
> img,
|
|
29
|
+
> video,
|
|
30
|
+
> iframe,
|
|
31
|
+
> picture > img {
|
|
32
|
+
position: absolute;
|
|
33
|
+
inset: 0;
|
|
34
|
+
inline-size: 100%;
|
|
35
|
+
block-size: 100%;
|
|
36
|
+
max-inline-size: none;
|
|
37
|
+
object-fit: $object-fit;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@each $name, $size in $fixed-sizes {
|
|
43
|
+
#{$selector}#{variables.$selector-prefix-is}#{$name} {
|
|
44
|
+
inline-size: $size;
|
|
45
|
+
block-size: $size;
|
|
46
|
+
max-inline-size: $size;
|
|
47
|
+
|
|
48
|
+
> img,
|
|
49
|
+
> video,
|
|
50
|
+
> picture > img {
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset: 0;
|
|
53
|
+
inline-size: 100%;
|
|
54
|
+
block-size: 100%;
|
|
55
|
+
max-inline-size: none;
|
|
56
|
+
object-fit: $object-fit;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#{$selector} {
|
|
62
|
+
&#{$rounded-selector} {
|
|
63
|
+
border-radius: $border-radius;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&#{$circle-selector} {
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&#{$thumbnail-selector},
|
|
73
|
+
&#{$thumbnail-alias-selector} {
|
|
74
|
+
padding: $thumbnail-padding;
|
|
75
|
+
background: $thumbnail-background;
|
|
76
|
+
border: $thumbnail-border-width solid
|
|
77
|
+
color-mix(
|
|
78
|
+
in srgb,
|
|
79
|
+
var(--kc-fg, currentColor) #{$thumbnail-border-mix},
|
|
80
|
+
transparent
|
|
81
|
+
);
|
|
82
|
+
border-radius: $thumbnail-border-radius;
|
|
83
|
+
|
|
84
|
+
> img,
|
|
85
|
+
> video,
|
|
86
|
+
> picture > img {
|
|
87
|
+
border-radius: calc(
|
|
88
|
+
#{$thumbnail-border-radius} - #{$thumbnail-padding}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
#{$fluid-selector} {
|
|
95
|
+
display: block;
|
|
96
|
+
max-inline-size: 100%;
|
|
97
|
+
block-size: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (forced-colors: active) {
|
|
101
|
+
#{$selector}#{$thumbnail-selector},
|
|
102
|
+
#{$selector}#{$thumbnail-alias-selector} {
|
|
103
|
+
border-color: CanvasText;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@use "../../variables";
|
|
2
|
+
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/image.mdx
|
|
4
|
+
|
|
5
|
+
$selector: ".image" !default;
|
|
6
|
+
|
|
7
|
+
$rounded-selector: "#{variables.$selector-prefix-is}rounded" !default;
|
|
8
|
+
$circle-selector: "#{variables.$selector-prefix-is}circle" !default;
|
|
9
|
+
$thumbnail-selector: "#{variables.$selector-prefix-is}thumbnail" !default;
|
|
10
|
+
|
|
11
|
+
// Legacy Bulma-compat alias for `.is-thumbnail`. Emits alongside the
|
|
12
|
+
// canonical selector so existing markup keeps working; consumers can
|
|
13
|
+
// override to `''` to strip the alias from the output.
|
|
14
|
+
$thumbnail-alias-selector: "#{variables.$selector-prefix-has}thumbnail"
|
|
15
|
+
!default;
|
|
16
|
+
|
|
17
|
+
// Bootstrap-compat fluid utility (`.img-fluid`). Same role as wrapping
|
|
18
|
+
// the image in `.image` but applied directly to an `<img>` — common in
|
|
19
|
+
// migrated codebases. Override to `''` to drop the rule.
|
|
20
|
+
$fluid-selector: ".img-fluid" !default;
|
|
21
|
+
|
|
22
|
+
$ratios: (
|
|
23
|
+
square: "1 / 1",
|
|
24
|
+
1by1: "1 / 1",
|
|
25
|
+
5by4: "5 / 4",
|
|
26
|
+
4by3: "4 / 3",
|
|
27
|
+
3by2: "3 / 2",
|
|
28
|
+
16by9: "16 / 9",
|
|
29
|
+
21by9: "21 / 9",
|
|
30
|
+
2by3: "2 / 3",
|
|
31
|
+
3by4: "3 / 4",
|
|
32
|
+
9by16: "9 / 16",
|
|
33
|
+
) !default;
|
|
34
|
+
|
|
35
|
+
$fixed-sizes: (
|
|
36
|
+
16x16: 16px,
|
|
37
|
+
24x24: 24px,
|
|
38
|
+
32x32: 32px,
|
|
39
|
+
48x48: 48px,
|
|
40
|
+
64x64: 64px,
|
|
41
|
+
96x96: 96px,
|
|
42
|
+
128x128: 128px,
|
|
43
|
+
) !default;
|
|
44
|
+
|
|
45
|
+
$object-fit: cover !default;
|
|
46
|
+
|
|
47
|
+
$border-radius: variables.$global-border-radius !default;
|
|
48
|
+
|
|
49
|
+
$thumbnail-padding: 0.25rem !default;
|
|
50
|
+
$thumbnail-border-width: variables.$global-border-width !default;
|
|
51
|
+
$thumbnail-border-mix: variables.$global-border-mix !default;
|
|
52
|
+
$thumbnail-background: var(--kc-bg, transparent) !default;
|
|
53
|
+
$thumbnail-border-radius: $border-radius !default;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
@use "variables" as *;
|
|
4
4
|
@use "../../variables";
|
|
5
5
|
|
|
6
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/progress.mdx
|
|
7
|
+
|
|
6
8
|
@if variables.$feature-element-progress {
|
|
7
9
|
#{$selector} {
|
|
8
|
-
// Native UA appearance varies wildly (bar in Chrome, ring in older Safari).
|
|
9
|
-
// Reset to a plain block so our rules below paint a consistent track.
|
|
10
10
|
appearance: none;
|
|
11
11
|
-webkit-appearance: none;
|
|
12
12
|
-moz-appearance: none;
|
|
@@ -16,24 +16,14 @@
|
|
|
16
16
|
border: none;
|
|
17
17
|
border-radius: $border-radius;
|
|
18
18
|
overflow: hidden;
|
|
19
|
-
// Track tint
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// .is-primary, or black-on-black across every HC variant) the
|
|
23
|
-
// `color-mix(... transparent)` track collapses to the page bg and the
|
|
24
|
-
// bar disappears (WCAG 1.4.11 fails at 1:1). Using --kc-fg keeps the
|
|
25
|
-
// track aligned with the page contrast axis regardless of fill colour.
|
|
19
|
+
// Track tint derives from `--kc-fg` (not currentColor) so the track
|
|
20
|
+
// stays aligned with the page contrast axis regardless of which
|
|
21
|
+
// combination fg the bar fill resolves to.
|
|
26
22
|
background-color: color-mix(
|
|
27
23
|
in srgb,
|
|
28
24
|
var(--kc-fg, currentColor) #{$track-mix},
|
|
29
25
|
transparent
|
|
30
26
|
);
|
|
31
|
-
// Bar fill resolves to combination BG (brand surface colour), not FG.
|
|
32
|
-
// Reason: FG is the text colour intended to read on top of BG; for
|
|
33
|
-
// progress the bar IS the visible surface, so BG carries the right
|
|
34
|
-
// semantic. Pre-fix, .is-primary's bar resolved to combination FG
|
|
35
|
-
// (white in default theme) and disappeared on a pale page bg
|
|
36
|
-
// (1.26:1, WCAG 1.4.11 fail). a11y audit, M2.
|
|
37
27
|
@include variables.textColor(default-bg, list.nth($default-combination, 1));
|
|
38
28
|
|
|
39
29
|
@include variables.combinations using ($label, $tuple) {
|
|
@@ -43,14 +33,11 @@
|
|
|
43
33
|
|
|
44
34
|
// Vendor pseudo-elements MUST live in separate rule blocks: mixing
|
|
45
35
|
// ::-webkit-* and ::-moz-* in one selector list makes the engine that
|
|
46
|
-
// doesn't recognise the other pseudo drop the whole rule.
|
|
47
|
-
// keeps each rule independently parseable.
|
|
36
|
+
// doesn't recognise the other pseudo drop the whole rule.
|
|
48
37
|
//
|
|
49
38
|
// selector.append() distributes the pseudo across every entry in the
|
|
50
|
-
// selector list
|
|
51
|
-
//
|
|
52
|
-
// Naive interpolation `#{$selector}::pseudo` would attach the pseudo
|
|
53
|
-
// only to the last entry and leave the rest as bare selectors.
|
|
39
|
+
// selector list. Naive interpolation `#{$selector}::pseudo` would attach
|
|
40
|
+
// the pseudo only to the last entry and leave the rest as bare selectors.
|
|
54
41
|
#{selector.append($selector, "::-webkit-progress-bar")} {
|
|
55
42
|
background: transparent;
|
|
56
43
|
}
|
|
@@ -65,9 +52,7 @@
|
|
|
65
52
|
border-radius: $border-radius;
|
|
66
53
|
}
|
|
67
54
|
|
|
68
|
-
// selector.nest() distributes the child combinator across every entry
|
|
69
|
-
// in the list (`progress, .progress` + `> .progress__value` →
|
|
70
|
-
// `progress > .progress__value, .progress > .progress__value`).
|
|
55
|
+
// selector.nest() distributes the child combinator across every entry.
|
|
71
56
|
// Naive interpolation would attach `>` only to the last entry.
|
|
72
57
|
#{selector.nest($selector, "> #{$value-selector}")} {
|
|
73
58
|
display: block;
|
|
@@ -76,10 +61,6 @@
|
|
|
76
61
|
border-radius: inherit;
|
|
77
62
|
}
|
|
78
63
|
|
|
79
|
-
// Forced-colors: the color-mix track collapses to a near-transparent system
|
|
80
|
-
// colour and the unfilled portion disappears. Force a solid CanvasText
|
|
81
|
-
// border so the bar boundary stays visible; bar fill maps to Highlight.
|
|
82
|
-
// WCAG 1.4.11.
|
|
83
64
|
@media (forced-colors: active) {
|
|
84
65
|
#{$selector} {
|
|
85
66
|
background-color: ButtonFace;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// consumer cannot use the native element (e.g. determinate animation control).
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/progress.mdx
|
|
4
|
+
|
|
6
5
|
$selector: "progress, .progress" !default;
|
|
7
6
|
$value-selector: ".progress__value" !default;
|
|
8
7
|
|
|
9
8
|
$height: 0.5rem !default;
|
|
10
9
|
$border-radius: variables.$global-max-border-radius !default;
|
|
11
10
|
|
|
12
|
-
// Track defaults to the neutral combination so the bar reads against any
|
|
13
|
-
// page bg; foreground (the filled value) draws from the active combination.
|
|
14
11
|
$default-combination: variables.$color-combination-default !default;
|
|
15
12
|
|
|
16
|
-
// Track tint relative to the page foreground. `color-mix` keeps the tint
|
|
17
|
-
// theme-reactive (bg-mix derived from --kc-fg currentColor at 12 %) so the
|
|
18
|
-
// track stays subtle in both light and dark.
|
|
19
13
|
$track-mix: 12% !default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use "variables" as *;
|
|
2
2
|
@use "../../variables";
|
|
3
|
-
@use "../../helper/controls" as controls;
|
|
3
|
+
@use "../../helper/controls-internal" as controls;
|
|
4
|
+
|
|
5
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/radio.mdx
|
|
4
6
|
|
|
5
7
|
@if variables.$feature-element-radio {
|
|
6
8
|
#{$selector} {
|
|
@@ -20,9 +22,7 @@
|
|
|
20
22
|
|
|
21
23
|
&:checked {
|
|
22
24
|
border-color: var(--kc-primary-bg, currentColor);
|
|
23
|
-
// Radial gradient draws the inner dot without an extra pseudo-element
|
|
24
|
-
// keeping the rule footprint tight. Hard stops at 50 % give a crisp
|
|
25
|
-
// edge without anti-aliasing fuzz.
|
|
25
|
+
// Radial gradient draws the inner dot without an extra pseudo-element.
|
|
26
26
|
background-image: radial-gradient(
|
|
27
27
|
circle,
|
|
28
28
|
var(--kc-primary-bg, currentColor) #{$dot-size},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/radio.mdx
|
|
4
|
+
|
|
3
5
|
$selector: 'input[type="radio"]' !default;
|
|
4
6
|
|
|
5
7
|
$size: 1rem !default;
|
|
6
8
|
$border-width: variables.$global-border-width !default;
|
|
7
|
-
// Inner dot diameter relative to the control. 50 % gives a clearly-checked
|
|
8
|
-
// glyph without crowding the border.
|
|
9
9
|
$dot-size: 50% !default;
|
|
10
10
|
|
|
11
11
|
$focus-outline-width: variables.$global-focus-outline-width !default;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
@use "sass:list";
|
|
1
2
|
@use "sass:selector";
|
|
2
3
|
@use "variables" as *;
|
|
3
4
|
@use "../../variables";
|
|
4
5
|
|
|
6
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/range.mdx
|
|
7
|
+
|
|
5
8
|
@if variables.$feature-element-range {
|
|
6
9
|
#{$selector} {
|
|
7
10
|
appearance: none;
|
|
@@ -29,12 +32,8 @@
|
|
|
29
32
|
// doesn't recognise the other pseudo drop the whole rule.
|
|
30
33
|
//
|
|
31
34
|
// selector.append() distributes the pseudo across every entry in
|
|
32
|
-
// `$selector` so rescoping
|
|
33
|
-
//
|
|
34
|
-
// `#{$selector}::pseudo` attaches the pseudo only to the last entry.
|
|
35
|
-
//
|
|
36
|
-
// The track and thumb bodies are identical across webkit/moz so we
|
|
37
|
-
// iterate over the per-engine pseudo names to keep the rules paired.
|
|
35
|
+
// `$selector` so rescoping keeps each entry validly paired with the
|
|
36
|
+
// pseudo. Naive interpolation attaches the pseudo only to the last entry.
|
|
38
37
|
|
|
39
38
|
@each $track-pseudo
|
|
40
39
|
in ("::-webkit-slider-runnable-track", "::-moz-range-track") {
|
|
@@ -49,13 +48,6 @@
|
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
// Thumb fill is `--kc-fg` (not `--kc-primary-bg`). The brand primary is too
|
|
53
|
-
// dark on `#121417` (#21704f gave 1.90:1 vs the 18 %-mixed dark track:
|
|
54
|
-
// failed WCAG 1.4.11). Page-fg is the highest-contrast colour available in
|
|
55
|
-
// any theme by definition (~14.7:1 vs page bg in default, ~15.0:1 in dark),
|
|
56
|
-
// so the thumb is unambiguously distinguishable across themes and surfaces.
|
|
57
|
-
// The bg-coloured halo (`$thumb-border-width` solid `--kc-bg`) further
|
|
58
|
-
// separates the thumb from the track.
|
|
59
51
|
#{selector.append($selector, "::-webkit-slider-thumb")} {
|
|
60
52
|
appearance: none;
|
|
61
53
|
-webkit-appearance: none;
|
|
@@ -63,7 +55,8 @@
|
|
|
63
55
|
height: $thumb-size;
|
|
64
56
|
border-radius: 50%;
|
|
65
57
|
background-color: var(--kc-fg, currentColor);
|
|
66
|
-
border: $thumb-border-width solid
|
|
58
|
+
border: $thumb-border-width solid
|
|
59
|
+
var(--kc-bg, #{list.nth($default-combination, 1)});
|
|
67
60
|
// WebKit aligns thumb to the top of the track box: recenter manually.
|
|
68
61
|
margin-block-start: calc((#{$track-height} - #{$thumb-size}) / 2);
|
|
69
62
|
cursor: pointer;
|
|
@@ -74,15 +67,11 @@
|
|
|
74
67
|
height: $thumb-size;
|
|
75
68
|
border-radius: 50%;
|
|
76
69
|
background-color: var(--kc-fg, currentColor);
|
|
77
|
-
border: $thumb-border-width solid
|
|
70
|
+
border: $thumb-border-width solid
|
|
71
|
+
var(--kc-bg, #{list.nth($default-combination, 1)});
|
|
78
72
|
cursor: pointer;
|
|
79
73
|
}
|
|
80
74
|
|
|
81
|
-
// Forced-colors: the color-mix track collapses to a near-transparent system
|
|
82
|
-
// colour and the unfilled portion disappears. Force a solid ButtonFace track
|
|
83
|
-
// with a CanvasText border so the trough stays visible; thumb maps to
|
|
84
|
-
// Highlight so the active position reads against the track. Kept in
|
|
85
|
-
// separate per-engine blocks for the same reason as above.
|
|
86
75
|
@media (forced-colors: active) {
|
|
87
76
|
@each $track-pseudo
|
|
88
77
|
in ("::-webkit-slider-runnable-track", "::-moz-range-track") {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
|
|
3
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/range.mdx
|
|
4
|
+
|
|
3
5
|
$selector: 'input[type="range"]' !default;
|
|
4
6
|
|
|
5
7
|
$track-height: 0.375rem !default;
|
|
6
8
|
$track-radius: variables.$global-max-border-radius !default;
|
|
7
|
-
// Mix against currentColor so the track tint stays theme-reactive.
|
|
8
9
|
$track-mix: 18% !default;
|
|
9
10
|
|
|
10
11
|
$thumb-size: 1.125rem !default;
|
|
@@ -17,3 +18,8 @@ $focus-outline-style: variables.$global-focus-outline-style !default;
|
|
|
17
18
|
$focus-outline-offset: variables.$global-focus-outline-offset !default;
|
|
18
19
|
|
|
19
20
|
$disabled-opacity: variables.$global-disabled-opacity !default;
|
|
21
|
+
|
|
22
|
+
// Thumb-border fallback colour. Reaches for the default combination's
|
|
23
|
+
// background (page bg) so the cut-out ring against the track keeps theme
|
|
24
|
+
// parity instead of baking a `white` literal that fails in dark themes.
|
|
25
|
+
$default-combination: variables.$color-combination-default !default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use "variables" as *;
|
|
2
2
|
@use "../../variables";
|
|
3
|
-
@use "../../helper/controls" as controls;
|
|
3
|
+
@use "../../helper/controls-internal" as controls;
|
|
4
|
+
|
|
5
|
+
// Documentation: ../../../docs/src/pages/reference/components/element/forms/select.mdx
|
|
4
6
|
|
|
5
7
|
@if variables.$feature-element-select {
|
|
6
8
|
#{$selector} {
|
|
@@ -46,9 +48,6 @@
|
|
|
46
48
|
@include controls.disabledControl($disabled-opacity);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
// `[multiple]` is a list, not a dropdown. No caret, native scroll, normal
|
|
50
|
-
// horizontal padding. Native focus on individual <option> children handles
|
|
51
|
-
// keyboard reach.
|
|
52
51
|
&[multiple] {
|
|
53
52
|
padding-inline-end: $padding-x;
|
|
54
53
|
background-image: none;
|