@carbon/element-styles 0.3.14-rc.0 → 0.3.15-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/element-styles",
3
- "version": "0.3.14-rc.0",
3
+ "version": "0.3.15-rc.0",
4
4
  "description": "An experimental styling system for native HTML elements, relying on semantic, attribute-focused selectors instead of class names.",
5
5
  "keywords": [
6
6
  "carbon",
@@ -37,13 +37,11 @@ $-default-config: (
37
37
 
38
38
  @if map.get($props, "axis") == "block" {
39
39
  @include layout.mode--label;
40
- // flex-direction: column;
41
40
  grid-auto-flow: row;
42
41
  }
43
42
 
44
43
  @if map.get($props, "axis") == "inline" {
45
44
  @include layout.mode--body-compact;
46
- // flex-direction: row;
47
45
  grid-auto-flow: column;
48
46
  align-items: center;
49
47
  inline-size: fit-content;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ @use "sass:map";
9
+
10
+ @use "@carbon/styles/scss/theme";
11
+
12
+ @use "../label";
13
+
14
+ @use "../../layout";
15
+
16
+ $config: () !default;
17
+
18
+ $-default-config: (
19
+ selector: "label:has(meter)",
20
+ axis: "block",
21
+ );
22
+
23
+ /// @group meter
24
+ /// @param {Map} config [()]
25
+ /// @param {Selector} config.selector ['label:has(meter)']
26
+ /// @param {'block' | 'axis'} config.axis ['block']
27
+ @mixin styles($config: $config) {
28
+ $props: map.deep-merge($-default-config, $config);
29
+
30
+ #{map.get($props, "selector")} {
31
+ @include label.styles(
32
+ (
33
+ selector: "&",
34
+ axis: map.get($props, "axis"),
35
+ )
36
+ );
37
+
38
+ meter {
39
+ min-inline-size: 6rem;
40
+ background: theme.$layer;
41
+ block-size: 0.5rem;
42
+ inline-size: 100%;
43
+ }
44
+
45
+ meter::-webkit-meter-bar {
46
+ background: theme.$layer;
47
+ block-size: 0.5rem;
48
+ }
49
+
50
+ meter::-webkit-meter-optimum-value {
51
+ background: theme.$support-success;
52
+ }
53
+
54
+ meter:-moz-meter-optimum::-moz-meter-bar {
55
+ background: theme.$support-success;
56
+ }
57
+
58
+ meter::-webkit-meter-suboptimum-value {
59
+ background: theme.$support-caution-minor;
60
+ }
61
+
62
+ meter:-moz-meter-sub-optimum::-moz-meter-bar {
63
+ background: theme.$support-caution-minor;
64
+ }
65
+
66
+ meter::-webkit-meter-even-less-good-value {
67
+ background: theme.$support-caution-major;
68
+ }
69
+
70
+ meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
71
+ background: theme.$support-caution-major;
72
+ }
73
+ }
74
+ }
@@ -25,8 +25,6 @@ $-default-config: (
25
25
  thickness: "thick",
26
26
  );
27
27
 
28
- $-indeterminate-ratio: 0.25;
29
-
30
28
  /// @group progress-bar
31
29
  /// @param {Map} config [()]
32
30
  /// @param {Selector} config.selector ['progress']
@@ -45,6 +43,11 @@ $-indeterminate-ratio: 0.25;
45
43
 
46
44
  & progress {
47
45
  appearance: none;
46
+ background-color: theme.$layer;
47
+ border: none;
48
+ box-shadow: none;
49
+ border-radius: 0;
50
+ overflow: hidden;
48
51
 
49
52
  @if map.get($props, "thickness") == "thick" {
50
53
  block-size: 0.5rem;
@@ -68,8 +71,29 @@ $-indeterminate-ratio: 0.25;
68
71
  background-color: theme.$interactive;
69
72
  }
70
73
 
71
- & progress:not([value])::-webkit-progress-value {
72
- inline-size: calc(100% * $-indeterminate-ratio);
74
+ & progress::-moz-progress-bar {
75
+ background-color: theme.$interactive;
76
+ }
77
+
78
+ & progress:not([value])::-moz-progress-bar {
79
+ background-color: transparent;
80
+ background-image: linear-gradient(90deg, theme.$interactive 12.5%, transparent 12.5%);
81
+ background-position-x: 0%;
82
+ background-size: 200% 100%;
83
+ animation-name: #{carbon-config.$prefix}--#{config.$prefix}--progress-bar--indeterminate;
84
+ animation-duration: calc(motion.$duration-slow-02 * 5);
85
+ animation-timing-function: linear;
86
+ animation-iteration-count: infinite;
87
+
88
+ @include guards.motion {
89
+ animation-duration: calc(motion.$duration-slow-02 * 2);
90
+ }
91
+ }
92
+
93
+ & progress:not([value])::-webkit-progress-bar {
94
+ background-image: linear-gradient(90deg, theme.$interactive 12.5%, transparent 12.5%);
95
+ background-position-x: 0%;
96
+ background-size: 200% 100%;
73
97
  animation-name: #{carbon-config.$prefix}--#{config.$prefix}--progress-bar--indeterminate;
74
98
  animation-duration: calc(motion.$duration-slow-02 * 5);
75
99
  animation-timing-function: linear;
@@ -82,11 +106,12 @@ $-indeterminate-ratio: 0.25;
82
106
 
83
107
  @keyframes #{carbon-config.$prefix}--#{config.$prefix}--progress-bar--indeterminate {
84
108
  0% {
85
- translate: -100% 0;
109
+ background-position-x: 25%;
86
110
  }
87
111
 
112
+ 80%,
88
113
  100% {
89
- translate: calc(100% / $-indeterminate-ratio) 0;
114
+ background-position-x: -105%;
90
115
  }
91
116
  }
92
117
  }