@vettvangur/design-system 2.0.77 → 2.0.78
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/dist/index.js +1 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4003,21 +4003,11 @@ function rgbaFromColor(color) {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
|
|
4005
4005
|
// Common cases: 0..1, percent (0..100), or 0..255.
|
|
4006
|
-
//
|
|
4007
|
-
// Figma color alpha comes through as 0..1 (e.g. 4% => 0.04). For shadows we want
|
|
4008
|
-
// that 4% to land as 0.4 in generated CSS (historical parity with our tokens),
|
|
4009
|
-
// so we scale very small fractional alphas up by 10.
|
|
4010
4006
|
let a = v;
|
|
4011
|
-
if (a > 1 && a <=
|
|
4012
|
-
// Some sources provide alpha in a 0..10 scale (e.g. 4 => 0.4)
|
|
4013
|
-
a /= 10;
|
|
4014
|
-
} else if (a > 10 && a <= 100) {
|
|
4007
|
+
if (a > 1 && a <= 100) {
|
|
4015
4008
|
a /= 100;
|
|
4016
4009
|
} else if (a > 100 && a <= 255) {
|
|
4017
4010
|
a /= 255;
|
|
4018
|
-
} else if (a > 0 && a <= 0.1) {
|
|
4019
|
-
// Figma: 4% is 0.04; we want 0.4.
|
|
4020
|
-
a *= 10;
|
|
4021
4011
|
}
|
|
4022
4012
|
a = Math.max(0, Math.min(1, a));
|
|
4023
4013
|
|