66@use ' ../internal/styles/tokens' as awsui ;
77@use ' ../internal/styles' as styles ;
88@use ' ../internal/generated/custom-css-properties/index.scss' as custom-props ;
9+ @use ' ../internal/styles/style-api' as style-api ;
910@use ' ./motion' ;
1011
11- $progress-height : var (#{custom-props .$progressBarHeight } , 0.4 * styles .$base-size );
12- $progress-border-radius : var (#{custom-props .$progressBarBorderRadius } , 10px );
13- $progress-background-color : var (
14- #{custom-props .$progressBarBackgroundColor } ,
15- awsui .$color-background-progress-bar-default
12+ $progress-bar-tokens : style-api .resolve ((track- color, value- color, border-radius , block-size ), carrier );
13+ @include style-api .register ($progress-bar-tokens );
14+ @include style-api .docs (' bar' , $progress-bar-tokens );
15+ @include style-api .docs (' percentage' , $properties : (color , font-family , font-size , font-weight ));
16+
17+ $progress-height : style-api .value (
18+ $progress-bar-tokens ,
19+ block-size ,
20+ var (#{custom-props .$progressBarHeight } , 0.4 * styles .$base-size )
21+ );
22+ $progress-border-radius : style-api .value (
23+ $progress-bar-tokens ,
24+ border-radius ,
25+ var (#{custom-props .$progressBarBorderRadius } , 10px )
26+ );
27+ $progress-background-color : style-api .value (
28+ $progress-bar-tokens ,
29+ track-color ,
30+ var (#{custom-props .$progressBarBackgroundColor } , awsui .$color-background-progress-bar-default )
31+ );
32+ $progress-value-background-color : style-api .value (
33+ $progress-bar-tokens ,
34+ value-color ,
35+ var (#{custom-props .$progressValueBackgroundColor } , awsui .$color-background-progress-bar-value-default )
1636);
17- $progress-value-background-color : var (
18- #{custom-props .$progressValueBackgroundColor } ,
19- awsui .$color-background-progress-bar-value-default
37+ $progress-flash-background-color : style-api .value (
38+ $progress-bar-tokens ,
39+ track-color ,
40+ var (#{custom-props .$progressBarBackgroundColor } , awsui .$color-background-progress-bar-flash )
41+ );
42+ $progress-flash-value-background-color : style-api .value (
43+ $progress-bar-tokens ,
44+ value-color ,
45+ var (#{custom-props .$progressValueBackgroundColor } , awsui .$color-background-progress-bar-value-flash )
2046);
2147
2248.root {
@@ -79,7 +105,19 @@ $progress-value-background-color: var(
79105}
80106
81107.percentage {
82- /* used in test-utils */
108+ display : inline-block ;
109+ font-family : awsui .$font-family-base ;
110+ -webkit-font-smoothing : auto ;
111+ -moz-osx-font-smoothing : auto ;
112+ line-height : awsui .$line-height-body-s ;
113+ letter-spacing : awsui .$letter-spacing-body-s ;
114+ color : awsui .$color-text-small ;
115+ font-size : awsui .$font-size-body-s ;
116+ font-weight : styles .$font-weight-normal ;
117+
118+ & .percentage-flash {
119+ color : currentColor ;
120+ }
83121}
84122
85123@mixin general-progress-background-style {
@@ -101,6 +139,7 @@ $progress-value-background-color: var(
101139}
102140
103141.progress {
142+ @include style-api .carriers ($progress-bar-tokens );
104143 inline-size : 100% ;
105144 margin-inline-end : awsui .$space-s ;
106145 min-inline-size : 0 ;
@@ -131,22 +170,16 @@ $progress-value-background-color: var(
131170 }
132171
133172 & .progress-flash {
134- background-color : var ( #{ custom-props . $progressBarBackgroundColor } , awsui . $color-background- progress-bar- flash) ;
173+ background-color : $ progress-flash-background-color ;
135174
136175 & ::-webkit-progress-bar {
137- background-color : var ( #{ custom-props . $progressBarBackgroundColor } , awsui . $color-background- progress-bar- flash) ;
176+ background-color : $ progress-flash-background-color ;
138177 }
139178 & ::-webkit-progress-value {
140- background-color : var (
141- #{custom-props .$progressValueBackgroundColor } ,
142- awsui .$color-background-progress-bar-value-flash
143- );
179+ background-color : $progress-flash-value-background-color ;
144180 }
145181 & ::-moz-progress-bar {
146- background-color : var (
147- #{custom-props .$progressValueBackgroundColor } ,
148- awsui .$color-background-progress-bar-value-flash
149- );
182+ background-color : $progress-flash-value-background-color ;
150183 }
151184 }
152185}
0 commit comments