fix(css/minifier): Fix a bug with a modern hash (#6664)

This commit is contained in:
Alexander Akait 2022-12-19 07:15:23 +03:00 committed by GitHub
parent 23e27a9b28
commit 1d3e06aa88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -151,8 +151,9 @@ macro_rules! make_color {
let is_alpha_hex_supported = false;
if is_alpha_hex_supported {
let alpha = (($a * 255.0) as f64).round().max(0.0).min(255.0) as u8;
let hex: u32 =
((r as u32) << 24) | ((g as u32) << 16) | ((b as u32) << 8) | ($a as u32);
((r as u32) << 24) | ((g as u32) << 16) | ((b as u32) << 8) | (alpha as u32);
let compact = get_short_hex(hex);
let value = if hex == get_long_hex(compact) {

View File

@ -436,3 +436,8 @@
color: #123f;
color: #123abcff;
}
.a {
color: hsl(270, 100%, 50%, 50%);
background: hsl(270, 100%, 50%, 0.5);
}

View File

@ -1 +1 @@
.color{color:rgb(from rgba(0,0,0,0)255 255 255)}.color-1,.color-2{color:rgb(from red 255 255 255)}.color-3{color:rgb(from#f00 255 255 255)}.color-4{color:rgb(from#eee8aa 255 255 255)}.color-5{color:rgb(from#ff0 255 255 255)}.color-6{color:rgb(from snow 255 255 255)}.color-7{color:rgba(123,123,123,0)}.color-8,.color-9,.color-10,.color-11{color:#7b7b7b}.color-12{color:rgba(51,102,77,.23)}.color-13{color:#7b7b7b}.color-14{color:#6496c8}.class-15{color:#7b7b7b}.class-16{color:rgba(123,123,123,.99)}.class-17{color:#7b7b7b}.class-18{color:rgba(179,82,31,.13)}.class-19{color:rgba(180,82,31,.13)}.class-20{color:rgba(181,82,31,.13)}.class-21{color:rgba(182,82,31,.13)}.class-22{color:rgba(184,82,31,.13)}.class-23{color:rgba(181,181,181,.13)}.class-24{color:rgba(182,181,181,.13)}.class-25{color:rgba(181,181,181,.1%)}.class-26{color:rgba(181,181,181,.4%)}.color-27{color:rgb(from#eee8aa 255 255 255)}.color-28{color:rgb(from teal 255 255 255)}.color-29,.color-30{color:rgb(from red 255 255 255)}.class-31{color:#ff0800;color:gray;color:#000;color:#80ff00;color:#a6ff00;color:#f9ff00;color:#80ff00;color:red;color:#00ffae;color:red;color:#ff00bf;color:#8000ff;color:#0040ff;color:#0ff;color:#00ff40;color:#80ff00;color:#ffbf00;color:red;color:#ff00bf;color:rgba(128,0,255,.5);color:rgba(0,64,255,.5);color:rgba(0,255,255,.5);color:rgba(0,255,64,.5);color:rgba(128,255,0,.5);color:rgba(255,191,0,.5);color:rgba(255,0,0,.5);color:red;color:#ff00bf;color:#8000ff;color:#0040ff;color:#0ff;color:#00ff40;color:#80ff00;color:#ffbf00;color:red;color:#ff00bf;color:rgba(128,0,255,.5);color:rgba(0,64,255,.5);color:rgba(0,255,255,.5);color:rgba(0,255,64,.5);color:rgba(128,255,0,.5);color:rgba(255,191,0,.5);color:rgba(255,0,0,.5);color:#ff0400;color:#ff0800;color:#ff0d00}.class-32{color:gray;color:#4d7f4d;color:#fff;color:#fd3;color:#ccb333;color:green;color:#000;color:gray;color:#33b333;color:gray;color:rgba(128,128,128,.2);color:gray;color:rgba(128,128,128,.2);color:#6b8056;color:#4d7f4d;color:rgba(77,127,77,.5);color:red;color:rgba(255,0,0,0);color:#0f0;color:#cfc;color:green;color:rgba(77,127,77,0);color:rgba(170,170,170,0);color:#4d7f4d}.class-33{color:red}.class-34,.class-35{color:rgba(2,3,4,.5)}.class-36{color:#0f0}.class-37{color:rgba(0,255,0,.25)}.class-38{color:#000304}.class-39{color:#64c8ff}.class-40{color:rgba(20,10,0,0)}.class-41{color:#fff;color:#000}.class-42{color:rgba(0,0,0,0)}.class-43{color:maroon}.class-44{color:rgba(128,0,0,0)}.class-45{color:rgba(0,0,0,.5)}.class-46{color:#300}.class-47{color:rgba(51,0,0,0)}.class-48{color:rgba(0,0,0,.5)}.class-49{color:#000}.class-50{color:rgba(0,0,0,0)}.class-51{color:maroon}.class-52{color:rgba(128,0,0,0)}.class-53{color:rgba(0,0,0,.5)}.class-54{color:#300}.class-55{color:rgba(51,0,0,0)}.class-56{color:rgba(0,0,0,.5)}.class-57{color:#59a659}.class-58{color:rgba(77,127,77,.5)}.class-59,.class-60{color:red}.class-61,.class-62{color:rgba(255,0,0,0)}.class-63,.class-64{color:#0f0}.class-65,.class-66{color:#cfc}.class-67,.class-68{color:green}.class-69,.class-70{color:rgba(77,127,77,0)}.class-71,.class-72{color:rgba(170,170,170,0)}.class-73{color:#fff}.class-74{color:#000}.class-75{color:#fff}.class-76,.class-77,.class-78{color:#000}.class-79{color:#fff}.class-80,.class-81{color:#646464}.class-82,.class-83{color:rgba(100,100,100,0)}.color{color:red}.alpha{color:#fff;color:#fff;color:#123;color:#123abc}
.color{color:rgb(from rgba(0,0,0,0)255 255 255)}.color-1,.color-2{color:rgb(from red 255 255 255)}.color-3{color:rgb(from#f00 255 255 255)}.color-4{color:rgb(from#eee8aa 255 255 255)}.color-5{color:rgb(from#ff0 255 255 255)}.color-6{color:rgb(from snow 255 255 255)}.color-7{color:rgba(123,123,123,0)}.color-8,.color-9,.color-10,.color-11{color:#7b7b7b}.color-12{color:rgba(51,102,77,.23)}.color-13{color:#7b7b7b}.color-14{color:#6496c8}.class-15{color:#7b7b7b}.class-16{color:rgba(123,123,123,.99)}.class-17{color:#7b7b7b}.class-18{color:rgba(179,82,31,.13)}.class-19{color:rgba(180,82,31,.13)}.class-20{color:rgba(181,82,31,.13)}.class-21{color:rgba(182,82,31,.13)}.class-22{color:rgba(184,82,31,.13)}.class-23{color:rgba(181,181,181,.13)}.class-24{color:rgba(182,181,181,.13)}.class-25{color:rgba(181,181,181,.1%)}.class-26{color:rgba(181,181,181,.4%)}.color-27{color:rgb(from#eee8aa 255 255 255)}.color-28{color:rgb(from teal 255 255 255)}.color-29,.color-30{color:rgb(from red 255 255 255)}.class-31{color:#ff0800;color:gray;color:#000;color:#80ff00;color:#a6ff00;color:#f9ff00;color:#80ff00;color:red;color:#00ffae;color:red;color:#ff00bf;color:#8000ff;color:#0040ff;color:#0ff;color:#00ff40;color:#80ff00;color:#ffbf00;color:red;color:#ff00bf;color:rgba(128,0,255,.5);color:rgba(0,64,255,.5);color:rgba(0,255,255,.5);color:rgba(0,255,64,.5);color:rgba(128,255,0,.5);color:rgba(255,191,0,.5);color:rgba(255,0,0,.5);color:red;color:#ff00bf;color:#8000ff;color:#0040ff;color:#0ff;color:#00ff40;color:#80ff00;color:#ffbf00;color:red;color:#ff00bf;color:rgba(128,0,255,.5);color:rgba(0,64,255,.5);color:rgba(0,255,255,.5);color:rgba(0,255,64,.5);color:rgba(128,255,0,.5);color:rgba(255,191,0,.5);color:rgba(255,0,0,.5);color:#ff0400;color:#ff0800;color:#ff0d00}.class-32{color:gray;color:#4d7f4d;color:#fff;color:#fd3;color:#ccb333;color:green;color:#000;color:gray;color:#33b333;color:gray;color:rgba(128,128,128,.2);color:gray;color:rgba(128,128,128,.2);color:#6b8056;color:#4d7f4d;color:rgba(77,127,77,.5);color:red;color:rgba(255,0,0,0);color:#0f0;color:#cfc;color:green;color:rgba(77,127,77,0);color:rgba(170,170,170,0);color:#4d7f4d}.class-33{color:red}.class-34,.class-35{color:rgba(2,3,4,.5)}.class-36{color:#0f0}.class-37{color:rgba(0,255,0,.25)}.class-38{color:#000304}.class-39{color:#64c8ff}.class-40{color:rgba(20,10,0,0)}.class-41{color:#fff;color:#000}.class-42{color:rgba(0,0,0,0)}.class-43{color:maroon}.class-44{color:rgba(128,0,0,0)}.class-45{color:rgba(0,0,0,.5)}.class-46{color:#300}.class-47{color:rgba(51,0,0,0)}.class-48{color:rgba(0,0,0,.5)}.class-49{color:#000}.class-50{color:rgba(0,0,0,0)}.class-51{color:maroon}.class-52{color:rgba(128,0,0,0)}.class-53{color:rgba(0,0,0,.5)}.class-54{color:#300}.class-55{color:rgba(51,0,0,0)}.class-56{color:rgba(0,0,0,.5)}.class-57{color:#59a659}.class-58{color:rgba(77,127,77,.5)}.class-59,.class-60{color:red}.class-61,.class-62{color:rgba(255,0,0,0)}.class-63,.class-64{color:#0f0}.class-65,.class-66{color:#cfc}.class-67,.class-68{color:green}.class-69,.class-70{color:rgba(77,127,77,0)}.class-71,.class-72{color:rgba(170,170,170,0)}.class-73{color:#fff}.class-74{color:#000}.class-75{color:#fff}.class-76,.class-77,.class-78{color:#000}.class-79{color:#fff}.class-80,.class-81{color:#646464}.class-82,.class-83{color:rgba(100,100,100,0)}.color{color:red}.alpha{color:#fff;color:#fff;color:#123;color:#123abc}.a{color:rgba(128,0,255,.5);background:rgba(128,0,255,.5)}