refactor(css/parser): Remove value normalization (#8434)

**Related issue :**

 - https://linear.app/vercel/issue/PACK-2154
This commit is contained in:
Donny/강동윤 2024-01-04 05:40:51 +09:00 committed by GitHub
parent 68b9646681
commit 85be8a4de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
123 changed files with 1246 additions and 1186 deletions

View File

@ -137,6 +137,15 @@ impl PartialEq<JsWord> for FunctionName {
} }
} }
impl FunctionName {
pub fn as_str(&self) -> &str {
match self {
FunctionName::DashedIdent(v) => &v.value,
FunctionName::Ident(v) => &v.value,
}
}
}
#[ast_node("Function")] #[ast_node("Function")]
#[derive(Eq, Hash, EqIgnoreSpan)] #[derive(Eq, Hash, EqIgnoreSpan)]
pub struct Function { pub struct Function {

View File

@ -11,7 +11,7 @@ use swc_css_codegen::{
}; };
use swc_css_parser::parse_file; use swc_css_parser::parse_file;
use swc_css_visit::{VisitMut, VisitMutWith}; use swc_css_visit::{VisitMut, VisitMutWith};
use testing::{assert_eq, run_test2, NormalizedOutput}; use testing::{run_test2, NormalizedOutput};
fn run(input: &Path, minify: bool) { fn run(input: &Path, minify: bool) {
let dir = input.parent().unwrap(); let dir = input.parent().unwrap();
@ -80,6 +80,12 @@ fn run(input: &Path, minify: bool) {
.compare_to_file(output) .compare_to_file(output)
.unwrap(); .unwrap();
if minify {
// We lowercase identifiers to make gzip compression rate better, so we cannot
// make the output equal to the input
return Ok(());
}
let mut errors = vec![]; let mut errors = vec![];
let mut stylesheet_output: Stylesheet = let mut stylesheet_output: Stylesheet =
parse_file(&fm_output, None, Default::default(), &mut errors).map_err(|err| { parse_file(&fm_output, None, Default::default(), &mut errors).map_err(|err| {

View File

@ -1,8 +1,8 @@
@keyframes slidein { @keyframes slidein {
from { from {
transform: translatex(0%); transform: translateX(0%);
} }
to { to {
transform: translatex(100%); transform: translateX(100%);
} }
} }

View File

@ -1,8 +1,8 @@
@keyframes "foo" { @keyframes "foo" {
from { from {
transform: translatex(0%); transform: translateX(0%);
} }
to { to {
transform: translatex(100%); transform: translateX(100%);
} }
} }

View File

@ -7,10 +7,10 @@
} }
} }
@keyframes ONE_TWO_THREE { @keyframes ONE_TWO_THREE {
from { FROM {
transform: translatex(0%); transform: translateX(0%);
} }
to { TO {
transform: translatex(100%); transform: translateX(100%);
} }
} }

View File

@ -111,9 +111,9 @@
@media func(100px) {} @media func(100px) {}
@media screen and func(100px) {} @media screen and func(100px) {}
@media (max-width: 650px), calc(150px + 150px) {} @media (max-width: 650px), calc(150px + 150px) {}
@media all {} @MEDIA ALL {}
@media (prefers-reduced-motion: no-preference) { @MEDIA (PREFERS-reduced-motion: no-preference) {
:root { :ROOT {
scroll-behavior: smooth; scroll-behavior: smooth;
} }
} }

View File

@ -1 +1 @@
@media screen{}@media screen{}@media all{}@media screen{}@media print{}@media screen and (color){}@media screen and (color),projection and (color){}@media screen and (color),projection and (color){}@media print and (min-resolution:118dpcm){}@media all{}@media screen and (color){}@media screen and (color){}@media not all and (monochrome){}@media not screen and (color),print and (color){}@media not (device-aspect-ratio:16/9){}@media not (device-aspect-ratio:16/9){}@media not all{}@media not all{}@media only screen and (color){}@media only screen and (color){}@media(min-width:20px){}@media(min-width:20px){}@media(min-width:20px){}@media(device-aspect-ratio:16/9){}@media(device-aspect-ratio:16/9){}@media(grid)and (max-width:15em){}@media(monochrome){}@media(min-width:20em)and (min-width:20em){}@media(min-width:20em)and (min-width:20em){}@media(min-width:1024px)and (min-width:1024px)and (min-width:1024px){}@media(min-width:20em)and (min-width:20em){}@media(min-width:20em)and (min-width:20em){}@media(update:slow)or (hover:none){}@media(update:slow)or (hover:none){}@media(update:slow)or (hover:none){}@media(height<600px){}@media(height<=600px){}@media(height>600px){}@media(height>=600px){}@media(height=600px){}@media(height<600px){}@media(height<=600px){}@media(height>600px){}@media(height>=600px){}@media(height=600px){}@media(height=600px){}@media(height>=600px){}@media(600px<height){}@media(600px<=height){}@media(600px>height){}@media(600px>=height){}@media(600px=height){}@media(600px<height){}@media(600px<=height){}@media(600px>height){}@media(600px>=height){}@media(600px=height){}@media(600px=height){}@media(600px>=height){}@media(400px<width<700px){}@media(400px<=width<700px){}@media(400px<width<=700px){}@media(400px<=width<=700px){}@media(400px<width<700px){}@media(400px<=width<=700px){}@media(400px<width<700px){}@media(400px<=width<700px){}@media(400px<width<=700px){}@media(400px<=width<=700px){}@media(400px<width<700px){}@media(400px<=width<=700px){}@media(400px>width>700px){}@media(400px>=width>700px){}@media(400px>width>=700px){}@media(400px>=width>=700px){}@media(400px>width>700px){}@media(400px>=width>=700px){}@media(400px>width>700px){}@media(400px>=width>700px){}@media(400px>width>=700px){}@media(400px>=width>=700px){}@media(400px>width>700px){}@media(400px>=width>=700px){}@media(--modern)and (min-width:1024px){}@media(not (color))or (hover){}@media(not (color))or (hover){}@media((color)or (hover))and (width>1024px){}@media(((color))or ((hover)))and (width>1024px){}@media(((((color))or ((hover)))))and (width>1024px){}@media(((((color))or ((hover)))))and (width>1024px){}@media((min-width:800px)and (min-width:800px))or (min-width:800px){}@media(min-width:800px)and ((min-width:800px)or (min-width:800px)){}@media not all{}@media only screen and (color){}@media((min-width:800px)and (min-width:800px))or (min-width:800px){}@media(min-width:800px)and ((min-width:800px)or (min-width:800px)){}@media{}@media{}@media not (min-width:100px){}@media((color)or (hover))and (min-width:1024px){.a{color:green}}@media(height << 600px){}@media(height foo bar){}@media(height foo("bar")){}@media(height + 600px){}@media screen and (min-width: ){}@media(aspect-ratio: 12/){}@media func(100px){}@media screen and func(100px){}@media(max-width:650px),calc(150px + 150px){}@media all{}@media(prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}} @media screen{}@media screen{}@media all{}@media screen{}@media print{}@media screen and (color){}@media screen and (color),projection and (color){}@media screen and (color),projection and (color){}@media print and (min-resolution:118dpcm){}@media all{}@media screen and (color){}@media screen and (color){}@media not all and (monochrome){}@media not screen and (color),print and (color){}@media not (device-aspect-ratio:16/9){}@media not (device-aspect-ratio:16/9){}@media not all{}@media not all{}@media only screen and (color){}@media only screen and (color){}@media(min-width:20px){}@media(min-width:20px){}@media(min-width:20px){}@media(device-aspect-ratio:16/9){}@media(device-aspect-ratio:16/9){}@media(grid)and (max-width:15em){}@media(monochrome){}@media(min-width:20em)and (min-width:20em){}@media(min-width:20em)and (min-width:20em){}@media(min-width:1024px)and (min-width:1024px)and (min-width:1024px){}@media(min-width:20em)and (min-width:20em){}@media(min-width:20em)and (min-width:20em){}@media(update:slow)or (hover:none){}@media(update:slow)or (hover:none){}@media(update:slow)or (hover:none){}@media(height<600px){}@media(height<=600px){}@media(height>600px){}@media(height>=600px){}@media(height=600px){}@media(height<600px){}@media(height<=600px){}@media(height>600px){}@media(height>=600px){}@media(height=600px){}@media(height=600px){}@media(height>=600px){}@media(600px<height){}@media(600px<=height){}@media(600px>height){}@media(600px>=height){}@media(600px=height){}@media(600px<height){}@media(600px<=height){}@media(600px>height){}@media(600px>=height){}@media(600px=height){}@media(600px=height){}@media(600px>=height){}@media(400px<width<700px){}@media(400px<=width<700px){}@media(400px<width<=700px){}@media(400px<=width<=700px){}@media(400px<width<700px){}@media(400px<=width<=700px){}@media(400px<width<700px){}@media(400px<=width<700px){}@media(400px<width<=700px){}@media(400px<=width<=700px){}@media(400px<width<700px){}@media(400px<=width<=700px){}@media(400px>width>700px){}@media(400px>=width>700px){}@media(400px>width>=700px){}@media(400px>=width>=700px){}@media(400px>width>700px){}@media(400px>=width>=700px){}@media(400px>width>700px){}@media(400px>=width>700px){}@media(400px>width>=700px){}@media(400px>=width>=700px){}@media(400px>width>700px){}@media(400px>=width>=700px){}@media(--modern)and (min-width:1024px){}@media(not (color))or (hover){}@media(not (color))or (hover){}@media((color)or (hover))and (width>1024px){}@media(((color))or ((hover)))and (width>1024px){}@media(((((color))or ((hover)))))and (width>1024px){}@media(((((color))or ((hover)))))and (width>1024px){}@media((min-width:800px)and (min-width:800px))or (min-width:800px){}@media(min-width:800px)and ((min-width:800px)or (min-width:800px)){}@media not all{}@media only screen and (color){}@media((min-width:800px)and (min-width:800px))or (min-width:800px){}@media(min-width:800px)and ((min-width:800px)or (min-width:800px)){}@media{}@media{}@media not (min-width:100px){}@media((color)or (hover))and (min-width:1024px){.a{color:green}}@media(height << 600px){}@media(height foo bar){}@media(height foo("bar")){}@media(height + 600px){}@media screen and (min-width: ){}@media(aspect-ratio: 12/){}@media func(100px){}@media screen and func(100px){}@media(max-width:650px),calc(150px + 150px){}@media all{}@media(PREFERS-reduced-motion:no-preference){:root{scroll-behavior:smooth}}

View File

@ -44,6 +44,6 @@
@page :blank:first {} @page :blank:first {}
@page :first {} @page :first {}
@page toc, index {} @page toc, index {}
@page :first { @page :FIRST {
margin: 2cm; margin: 2cm;
} }

View File

@ -20,7 +20,7 @@
background: red; background: red;
} }
} }
@supports selector(a > b) {} @supports selector(A > B) {}
@supports (display: grid) and (not (display: inline-grid)) {} @supports (display: grid) and (not (display: inline-grid)) {}
@supports (display: table-cell) and (display: list-item) and (display: contents) {} @supports (display: table-cell) and (display: list-item) and (display: contents) {}
@supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) {} @supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) {}
@ -32,4 +32,4 @@
@supports ((display: flex) or (display: -webkit-box) or (display: -webkit-flex) or (display: -moz-box) or (display: -ms-flexbox)) or (display: -webkit-box) {} @supports ((display: flex) or (display: -webkit-box) or (display: -webkit-flex) or (display: -moz-box) or (display: -ms-flexbox)) or (display: -webkit-box) {}
@supports ((display: flex) and (display: -webkit-box) and (display: -webkit-flex) and (display: -moz-box) and (display: -ms-flexbox)) and (display: -webkit-box) {} @supports ((display: flex) and (display: -webkit-box) and (display: -webkit-flex) and (display: -moz-box) and (display: -ms-flexbox)) and (display: -webkit-box) {}
@supports ((display: flex) and (display: -webkit-box) and (display: -webkit-flex) and (display: -moz-box) and (display: -ms-flexbox)) or (display: -webkit-box) {} @supports ((display: flex) and (display: -webkit-box) and (display: -webkit-flex) and (display: -moz-box) and (display: -ms-flexbox)) or (display: -webkit-box) {}
@supports not (not (transform-origin: 2px)) {} @supports not (not (Transform-origin: 2px)) {}

View File

@ -3,7 +3,7 @@ div {
width: calc(100px + 100px); width: calc(100px + 100px);
width: calc(100px * 2); width: calc(100px * 2);
width: calc(100px / 2); width: calc(100px / 2);
width: calc(100px / 2); width: CALC(100px / 2);
width: calc(100px / 2); WIDTH: CALC(100px / 2);
font-size: max(10 * (1vw + 1vh) / 2, 12px); font-size: max(10 * (1vw + 1vh) / 2, 12px);
} }

View File

@ -2344,17 +2344,17 @@ textarea.form-control-lg {
} }
.form-floating > .form-control:not(:-moz-placeholder-shown) ~ label { .form-floating > .form-control:not(:-moz-placeholder-shown) ~ label {
opacity: 0.65; opacity: 0.65;
transform: scale(0.85) translatey(-0.5rem) translatex(0.15rem); transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
} }
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label { .form-floating > .form-select ~ label {
opacity: 0.65; opacity: 0.65;
transform: scale(0.85) translatey(-0.5rem) translatex(0.15rem); transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
} }
.form-floating > .form-control:-webkit-autofill ~ label { .form-floating > .form-control:-webkit-autofill ~ label {
opacity: 0.65; opacity: 0.65;
transform: scale(0.85) translatey(-0.5rem) translatex(0.15rem); transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
} }
.input-group { .input-group {
position: relative; position: relative;
@ -5707,11 +5707,11 @@ fieldset:disabled .btn {
} }
.carousel-item-next:not(.carousel-item-start), .carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end { .active.carousel-item-end {
transform: translatex(100%); transform: translateX(100%);
} }
.carousel-item-prev:not(.carousel-item-end), .carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start { .active.carousel-item-start {
transform: translatex(-100%); transform: translateX(-100%);
} }
.carousel-fade .carousel-item { .carousel-fade .carousel-item {
opacity: 0; opacity: 0;
@ -5975,14 +5975,14 @@ fieldset:disabled .btn {
left: 0; left: 0;
width: 400px; width: 400px;
border-right: 1px solid rgba(0, 0, 0, 0.2); border-right: 1px solid rgba(0, 0, 0, 0.2);
transform: translatex(-100%); transform: translateX(-100%);
} }
.offcanvas-end { .offcanvas-end {
top: 0; top: 0;
right: 0; right: 0;
width: 400px; width: 400px;
border-left: 1px solid rgba(0, 0, 0, 0.2); border-left: 1px solid rgba(0, 0, 0, 0.2);
transform: translatex(100%); transform: translateX(100%);
} }
.offcanvas-top { .offcanvas-top {
top: 0; top: 0;
@ -5991,7 +5991,7 @@ fieldset:disabled .btn {
height: 30vh; height: 30vh;
max-height: 100%; max-height: 100%;
border-bottom: 1px solid rgba(0, 0, 0, 0.2); border-bottom: 1px solid rgba(0, 0, 0, 0.2);
transform: translatey(-100%); transform: translateY(-100%);
} }
.offcanvas-bottom { .offcanvas-bottom {
right: 0; right: 0;
@ -5999,7 +5999,7 @@ fieldset:disabled .btn {
height: 30vh; height: 30vh;
max-height: 100%; max-height: 100%;
border-top: 1px solid rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(0, 0, 0, 0.2);
transform: translatey(100%); transform: translateY(100%);
} }
.offcanvas.show { .offcanvas.show {
transform: none; transform: none;
@ -6406,10 +6406,10 @@ fieldset:disabled .btn {
transform: translate(-50%, -50%) !important; transform: translate(-50%, -50%) !important;
} }
.translate-middle-x { .translate-middle-x {
transform: translatex(-50%) !important; transform: translateX(-50%) !important;
} }
.translate-middle-y { .translate-middle-y {
transform: translatey(-50%) !important; transform: translateY(-50%) !important;
} }
.border { .border {
border: 1px solid #dee2e6 !important; border: 1px solid #dee2e6 !important;

View File

@ -177,7 +177,7 @@ fieldset[disabled] .pagination-ellipsis {
left: 50%; left: 50%;
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translatex(-50%) translatey(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg);
transform-origin: center center; transform-origin: center center;
} }
.delete::before, .delete::before,
@ -2859,7 +2859,7 @@ div.icon-text {
left: 50%; left: 50%;
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translatex(-50%) translatey(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg);
transform-origin: center center; transform-origin: center center;
} }
.tag:not(body).is-delete::before { .tag:not(body).is-delete::before {
@ -5605,13 +5605,13 @@ body.has-navbar-fixed-bottom {
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }
.navbar-burger.is-active span:nth-child(1) { .navbar-burger.is-active span:nth-child(1) {
transform: translatey(5px) rotate(45deg); transform: translateY(5px) rotate(45deg);
} }
.navbar-burger.is-active span:nth-child(2) { .navbar-burger.is-active span:nth-child(2) {
opacity: 0; opacity: 0;
} }
.navbar-burger.is-active span:nth-child(3) { .navbar-burger.is-active span:nth-child(3) {
transform: translatey(-5px) rotate(-45deg); transform: translateY(-5px) rotate(-45deg);
} }
.navbar-menu { .navbar-menu {
display: none; display: none;
@ -5838,7 +5838,7 @@ a.navbar-item.is-active,
.navbar-item.is-hoverable:hover .navbar-dropdown.is-boxed { .navbar-item.is-hoverable:hover .navbar-dropdown.is-boxed {
opacity: 1; opacity: 1;
pointer-events: auto; pointer-events: auto;
transform: translatey(0); transform: translateY(0);
} }
.navbar-menu { .navbar-menu {
flex-grow: 1; flex-grow: 1;
@ -5891,7 +5891,7 @@ a.navbar-item.is-active,
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
top: calc(100% + (-4px)); top: calc(100% + (-4px));
transform: translatey(-5px); transform: translateY(-5px);
transition-duration: 86ms; transition-duration: 86ms;
transition-property: opacity, transform; transition-property: opacity, transform;
} }

View File

@ -4218,9 +4218,9 @@ a.button:focus {
.slider-handle { .slider-handle {
position: absolute; position: absolute;
top: 50%; top: 50%;
-webkit-transform: translatey(-50%); -webkit-transform: translateY(-50%);
-ms-transform: translatey(-50%); -ms-transform: translateY(-50%);
transform: translatey(-50%); transform: translateY(-50%);
left: 0; left: 0;
z-index: 1; z-index: 1;
cursor: -webkit-grab; cursor: -webkit-grab;
@ -4272,9 +4272,9 @@ a.button:focus {
left: 50%; left: 50%;
width: 1.4rem; width: 1.4rem;
height: 1.4rem; height: 1.4rem;
-webkit-transform: translatex(-50%); -webkit-transform: translateX(-50%);
-ms-transform: translatex(-50%); -ms-transform: translateX(-50%);
transform: translatex(-50%); transform: translateX(-50%);
} }
.switch { .switch {
position: relative; position: relative;
@ -4342,9 +4342,9 @@ input:disabled ~ .switch-paddle {
.switch-inactive { .switch-inactive {
position: absolute; position: absolute;
top: 50%; top: 50%;
-webkit-transform: translatey(-50%); -webkit-transform: translateY(-50%);
-ms-transform: translatey(-50%); -ms-transform: translateY(-50%);
transform: translatey(-50%); transform: translateY(-50%);
} }
.switch-active { .switch-active {
left: 8%; left: 8%;
@ -4809,9 +4809,9 @@ table.hover:not(.unstriped) tr:nth-of-type(even):hover {
} }
.tooltip.bottom.align-center::before { .tooltip.bottom.align-center::before {
left: 50%; left: 50%;
-webkit-transform: translatex(-50%); -webkit-transform: translateX(-50%);
-ms-transform: translatex(-50%); -ms-transform: translateX(-50%);
transform: translatex(-50%); transform: translateX(-50%);
} }
.tooltip.top::before { .tooltip.top::before {
display: block; display: block;
@ -4827,9 +4827,9 @@ table.hover:not(.unstriped) tr:nth-of-type(even):hover {
} }
.tooltip.top.align-center::before { .tooltip.top.align-center::before {
left: 50%; left: 50%;
-webkit-transform: translatex(-50%); -webkit-transform: translateX(-50%);
-ms-transform: translatex(-50%); -ms-transform: translateX(-50%);
transform: translatex(-50%); transform: translateX(-50%);
} }
.tooltip.left::before { .tooltip.left::before {
display: block; display: block;
@ -4845,9 +4845,9 @@ table.hover:not(.unstriped) tr:nth-of-type(even):hover {
.tooltip.left.align-center::before { .tooltip.left.align-center::before {
bottom: auto; bottom: auto;
top: 50%; top: 50%;
-webkit-transform: translatey(-50%); -webkit-transform: translateY(-50%);
-ms-transform: translatey(-50%); -ms-transform: translateY(-50%);
transform: translatey(-50%); transform: translateY(-50%);
} }
.tooltip.right::before { .tooltip.right::before {
display: block; display: block;
@ -4864,9 +4864,9 @@ table.hover:not(.unstriped) tr:nth-of-type(even):hover {
.tooltip.right.align-center::before { .tooltip.right.align-center::before {
bottom: auto; bottom: auto;
top: 50%; top: 50%;
-webkit-transform: translatey(-50%); -webkit-transform: translateY(-50%);
-ms-transform: translatey(-50%); -ms-transform: translateY(-50%);
transform: translatey(-50%); transform: translateY(-50%);
} }
.tooltip.align-top::before { .tooltip.align-top::before {
bottom: auto; bottom: auto;
@ -5030,9 +5030,9 @@ table.hover:not(.unstriped) tr:nth-of-type(even):hover {
.orbit-next { .orbit-next {
position: absolute; position: absolute;
top: 50%; top: 50%;
-webkit-transform: translatey(-50%); -webkit-transform: translateY(-50%);
-ms-transform: translatey(-50%); -ms-transform: translateY(-50%);
transform: translatey(-50%); transform: translateY(-50%);
z-index: 10; z-index: 10;
padding: 1rem; padding: 1rem;
color: #fefefe; color: #fefefe;
@ -5682,9 +5682,9 @@ a.thumbnail image {
margin: auto; margin: auto;
} }
.submenu-toggle[aria-expanded='true']::after { .submenu-toggle[aria-expanded='true']::after {
-webkit-transform: scaley(-1); -webkit-transform: scaleY(-1);
-ms-transform: scaley(-1); -ms-transform: scaleY(-1);
transform: scaley(-1); transform: scaleY(-1);
-webkit-transform-origin: 50% 50%; -webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%;
transform-origin: 50% 50%; transform-origin: 50% 50%;
@ -5729,14 +5729,14 @@ a.thumbnail image {
.drilldown .is-drilldown-submenu.is-active { .drilldown .is-drilldown-submenu.is-active {
z-index: 1; z-index: 1;
display: block; display: block;
-webkit-transform: translatex(-100%); -webkit-transform: translateX(-100%);
-ms-transform: translatex(-100%); -ms-transform: translateX(-100%);
transform: translatex(-100%); transform: translateX(-100%);
} }
.drilldown .is-drilldown-submenu.is-closing { .drilldown .is-drilldown-submenu.is-closing {
-webkit-transform: translatex(100%); -webkit-transform: translateX(100%);
-ms-transform: translatex(100%); -ms-transform: translateX(100%);
transform: translatex(100%); transform: translateX(100%);
} }
.drilldown .is-drilldown-submenu a { .drilldown .is-drilldown-submenu a {
padding: 0.7rem 1rem; padding: 0.7rem 1rem;
@ -6200,14 +6200,14 @@ a.thumbnail image {
overflow-y: auto; overflow-y: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
width: 250px; width: 250px;
-webkit-transform: translatex(-250px); -webkit-transform: translateX(-250px);
-ms-transform: translatex(-250px); -ms-transform: translateX(-250px);
transform: translatex(-250px); transform: translateX(-250px);
} }
.off-canvas-content .off-canvas.position-left { .off-canvas-content .off-canvas.position-left {
-webkit-transform: translatex(-250px); -webkit-transform: translateX(-250px);
-ms-transform: translatex(-250px); -ms-transform: translateX(-250px);
transform: translatex(-250px); transform: translateX(-250px);
} }
.off-canvas-content .off-canvas.position-left.is-transition-overlap.is-open { .off-canvas-content .off-canvas.position-left.is-transition-overlap.is-open {
-webkit-transform: translate(0, 0); -webkit-transform: translate(0, 0);
@ -6215,9 +6215,9 @@ a.thumbnail image {
transform: translate(0, 0); transform: translate(0, 0);
} }
.off-canvas-content.is-open-left.has-transition-push { .off-canvas-content.is-open-left.has-transition-push {
-webkit-transform: translatex(250px); -webkit-transform: translateX(250px);
-ms-transform: translatex(250px); -ms-transform: translateX(250px);
transform: translatex(250px); transform: translateX(250px);
} }
.position-left.is-transition-push { .position-left.is-transition-push {
-webkit-box-shadow: inset -13px 0 20px -13px rgba(10, 10, 10, 0.25); -webkit-box-shadow: inset -13px 0 20px -13px rgba(10, 10, 10, 0.25);
@ -6230,14 +6230,14 @@ a.thumbnail image {
overflow-y: auto; overflow-y: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
width: 250px; width: 250px;
-webkit-transform: translatex(250px); -webkit-transform: translateX(250px);
-ms-transform: translatex(250px); -ms-transform: translateX(250px);
transform: translatex(250px); transform: translateX(250px);
} }
.off-canvas-content .off-canvas.position-right { .off-canvas-content .off-canvas.position-right {
-webkit-transform: translatex(250px); -webkit-transform: translateX(250px);
-ms-transform: translatex(250px); -ms-transform: translateX(250px);
transform: translatex(250px); transform: translateX(250px);
} }
.off-canvas-content .off-canvas.position-right.is-transition-overlap.is-open { .off-canvas-content .off-canvas.position-right.is-transition-overlap.is-open {
-webkit-transform: translate(0, 0); -webkit-transform: translate(0, 0);
@ -6245,9 +6245,9 @@ a.thumbnail image {
transform: translate(0, 0); transform: translate(0, 0);
} }
.off-canvas-content.is-open-right.has-transition-push { .off-canvas-content.is-open-right.has-transition-push {
-webkit-transform: translatex(-250px); -webkit-transform: translateX(-250px);
-ms-transform: translatex(-250px); -ms-transform: translateX(-250px);
transform: translatex(-250px); transform: translateX(-250px);
} }
.position-right.is-transition-push { .position-right.is-transition-push {
-webkit-box-shadow: inset 13px 0 20px -13px rgba(10, 10, 10, 0.25); -webkit-box-shadow: inset 13px 0 20px -13px rgba(10, 10, 10, 0.25);
@ -6260,14 +6260,14 @@ a.thumbnail image {
overflow-x: auto; overflow-x: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
height: 250px; height: 250px;
-webkit-transform: translatey(-250px); -webkit-transform: translateY(-250px);
-ms-transform: translatey(-250px); -ms-transform: translateY(-250px);
transform: translatey(-250px); transform: translateY(-250px);
} }
.off-canvas-content .off-canvas.position-top { .off-canvas-content .off-canvas.position-top {
-webkit-transform: translatey(-250px); -webkit-transform: translateY(-250px);
-ms-transform: translatey(-250px); -ms-transform: translateY(-250px);
transform: translatey(-250px); transform: translateY(-250px);
} }
.off-canvas-content .off-canvas.position-top.is-transition-overlap.is-open { .off-canvas-content .off-canvas.position-top.is-transition-overlap.is-open {
-webkit-transform: translate(0, 0); -webkit-transform: translate(0, 0);
@ -6275,9 +6275,9 @@ a.thumbnail image {
transform: translate(0, 0); transform: translate(0, 0);
} }
.off-canvas-content.is-open-top.has-transition-push { .off-canvas-content.is-open-top.has-transition-push {
-webkit-transform: translatey(250px); -webkit-transform: translateY(250px);
-ms-transform: translatey(250px); -ms-transform: translateY(250px);
transform: translatey(250px); transform: translateY(250px);
} }
.position-top.is-transition-push { .position-top.is-transition-push {
-webkit-box-shadow: inset 0 -13px 20px -13px rgba(10, 10, 10, 0.25); -webkit-box-shadow: inset 0 -13px 20px -13px rgba(10, 10, 10, 0.25);
@ -6290,14 +6290,14 @@ a.thumbnail image {
overflow-x: auto; overflow-x: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
height: 250px; height: 250px;
-webkit-transform: translatey(250px); -webkit-transform: translateY(250px);
-ms-transform: translatey(250px); -ms-transform: translateY(250px);
transform: translatey(250px); transform: translateY(250px);
} }
.off-canvas-content .off-canvas.position-bottom { .off-canvas-content .off-canvas.position-bottom {
-webkit-transform: translatey(250px); -webkit-transform: translateY(250px);
-ms-transform: translatey(250px); -ms-transform: translateY(250px);
transform: translatey(250px); transform: translateY(250px);
} }
.off-canvas-content .off-canvas.position-bottom.is-transition-overlap.is-open { .off-canvas-content .off-canvas.position-bottom.is-transition-overlap.is-open {
-webkit-transform: translate(0, 0); -webkit-transform: translate(0, 0);
@ -6305,9 +6305,9 @@ a.thumbnail image {
transform: translate(0, 0); transform: translate(0, 0);
} }
.off-canvas-content.is-open-bottom.has-transition-push { .off-canvas-content.is-open-bottom.has-transition-push {
-webkit-transform: translatey(-250px); -webkit-transform: translateY(-250px);
-ms-transform: translatey(-250px); -ms-transform: translateY(-250px);
transform: translatey(-250px); transform: translateY(-250px);
} }
.position-bottom.is-transition-push { .position-bottom.is-transition-push {
-webkit-box-shadow: inset 0 13px 20px -13px rgba(10, 10, 10, 0.25); -webkit-box-shadow: inset 0 13px 20px -13px rgba(10, 10, 10, 0.25);

View File

@ -386,7 +386,7 @@ html {
padding: 0.5em 1em; padding: 0.5em 1em;
color: rgba(0, 0, 0, 0.80); color: rgba(0, 0, 0, 0.80);
border: none rgba(0, 0, 0, 0); border: none rgba(0, 0, 0, 0);
background-color: #e6e6e6; background-color: #E6E6E6;
text-decoration: none; text-decoration: none;
border-radius: 2px; border-radius: 2px;
} }
@ -498,17 +498,17 @@ a.pure-button-selected {
.pure-form select:focus, .pure-form select:focus,
.pure-form textarea:focus { .pure-form textarea:focus {
outline: 0; outline: 0;
border-color: #129fea; border-color: #129FEA;
} }
.pure-form input:not([type]):focus { .pure-form input:not([type]):focus {
outline: 0; outline: 0;
border-color: #129fea; border-color: #129FEA;
} }
.pure-form input[type="file"]:focus, .pure-form input[type="file"]:focus,
.pure-form input[type="radio"]:focus, .pure-form input[type="radio"]:focus,
.pure-form input[type="checkbox"]:focus { .pure-form input[type="checkbox"]:focus {
outline: thin solid #129fea; outline: thin solid #129FEA;
outline: 1px auto #129fea; outline: 1px auto #129FEA;
} }
.pure-form .pure-checkbox, .pure-form .pure-checkbox,
.pure-form .pure-radio { .pure-form .pure-radio {

File diff suppressed because one or more lines are too long

View File

@ -2928,8 +2928,8 @@ code,
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-backface-visibility: hidden; -webkit-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
-webkit-transform: translatez(0); -webkit-transform: translateZ(0);
transform: translatez(0); transform: translateZ(0);
transition: -webkit-transform .25s ease-out; transition: -webkit-transform .25s ease-out;
transition: transform .25s ease-out; transition: transform .25s ease-out;
transition: transform .25s ease-out, -webkit-transform .25s ease-out; transition: transform .25s ease-out, -webkit-transform .25s ease-out;
@ -2947,8 +2947,8 @@ code,
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-backface-visibility: hidden; -webkit-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
-webkit-transform: translatez(0); -webkit-transform: translateZ(0);
transform: translatez(0); transform: translateZ(0);
transition: -webkit-transform .25s ease-in-out; transition: -webkit-transform .25s ease-in-out;
transition: transform .25s ease-in-out; transition: transform .25s ease-in-out;
transition: transform .25s ease-in-out, -webkit-transform .25s ease-in-out; transition: transform .25s ease-in-out, -webkit-transform .25s ease-in-out;

View File

@ -257,46 +257,46 @@
} }
.translate-x-5 { .translate-x-5 {
--tw-translate-x: 1.25rem; --tw-translate-x: 1.25rem;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.-translate-x-4 { .-translate-x-4 {
--tw-translate-x: -1rem; --tw-translate-x: -1rem;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.translate-y-6 { .translate-y-6 {
--tw-translate-y: 1.5rem; --tw-translate-y: 1.5rem;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.-translate-x-3 { .-translate-x-3 {
--tw-translate-x: -0.75rem; --tw-translate-x: -0.75rem;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.rotate-3 { .rotate-3 {
--tw-rotate: 3deg; --tw-rotate: 3deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.skew-y-12 { .skew-y-12 {
--tw-skew-y: 12deg; --tw-skew-y: 12deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.skew-x-12 { .skew-x-12 {
--tw-skew-x: 12deg; --tw-skew-x: 12deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.scale-95 { .scale-95 {
--tw-scale-x: 0.95; --tw-scale-x: 0.95;
--tw-scale-y: 0.95; --tw-scale-y: 0.95;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.-scale-x-100 { .-scale-x-100 {
--tw-scale-x: -1; --tw-scale-x: -1;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.transform { .transform {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.transform-gpu { .transform-gpu {
transform: translate3d(var(--tw-translate-x), var(--tw-translate-y), 0) rotate(var(--tw-rotate)) skewx(var(--tw-skew-x)) skewy(var(--tw-skew-y)) scalex(var(--tw-scale-x)) scaley(var(--tw-scale-y)); transform: translate3d(var(--tw-translate-x), var(--tw-translate-y), 0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.transform-none { .transform-none {
transform: none; transform: none;

View File

@ -9,9 +9,9 @@
[href$=".org"] {} [href$=".org"] {}
[href*="example"] {} [href*="example"] {}
[href*="insensitive" i] {} [href*="insensitive" i] {}
[href*="insensitive" i] {} [href*="insensitive" I] {}
[href*="cAsE" s] {}
[href*="cAsE" s] {} [href*="cAsE" s] {}
[href*="cAsE" S] {}
[foo|att=val] {} [foo|att=val] {}
[*|att] {} [*|att] {}
[*|att] {} [*|att] {}
@ -31,5 +31,5 @@ a[class="test"] {}
[🐈] {} [🐈] {}
[🐈=🐈] {} [🐈=🐈] {}
[🐈|🐈=🐈] {} [🐈|🐈=🐈] {}
[frame=hsides i] {} [frame=hsides I] {}
[href*="cAsE" s] {} [href*="cAsE" S] {}

View File

@ -79,7 +79,7 @@ p:nth-child(-n+1) {
p:nth-child(even) { p:nth-child(even) {
color: blue; color: blue;
} }
p:nth-child(even) { p:nth-child(EVEN) {
color: blue; color: blue;
} }
p:nth-child(2n) { p:nth-child(2n) {

View File

@ -1 +1 @@
p:nth-child(1){color:blue}p:nth-child(7){color:blue}p:nth-child(5n){color:blue}p:nth-child(n+7){color:blue}p:nth-child(3n+4){color:blue}p:nth-child(3n+4){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(n){color:blue}p:nth-child(n){color:blue}p:nth-child(-n){color:blue}p:nth-child(1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(-2n+1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(n+1){color:blue}p:nth-child(n+1){color:blue}p:nth-child(-n+1){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(n+1){color:blue}p:nth-child(n+1){color:blue}p:nth-child(-n+1){color:blue}p:nth-child(even){color:blue}p:nth-child(even){color:blue}p:nth-child(2n){color:blue}p:nth-child(1){color:blue}p:nth-child(0n+1){color:blue}p:nth-child(0n+1){color:blue}p:nth-child(0n+1){color:blue}p:nth-child(0n+5){color:blue}p:nth-child(0n-5){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(n-3){color:blue}p:nth-child(0n-3){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(0n-3){color:blue}p:nth-child(0n-3){color:blue}p:nth-child(n+0){color:blue}p:nth-child(n+0){color:blue}p:nth-child(-n+0){color:blue}p:nth-child(5n+0){color:blue}p:nth-child(-5n+0){color:blue}p:nth-child(5n+0){color:blue}p:nth-child(-2n+1){color:blue}p:nth-of-type(2n+1){color:blue}p:nth-last-col(2n+1){color:blue}p:nth-col(2n+1){color:blue}p:nth-child(n+0){color:blue}p:nth-child(n+0){color:blue}p:nth-child(5){color:blue}p:nth-child(5){color:blue}p:nth-child(-5){color:blue} p:nth-child(1){color:blue}p:nth-child(7){color:blue}p:nth-child(5n){color:blue}p:nth-child(n+7){color:blue}p:nth-child(3n+4){color:blue}p:nth-child(3n+4){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(n){color:blue}p:nth-child(n){color:blue}p:nth-child(-n){color:blue}p:nth-child(1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(-2n+1){color:blue}p:nth-child(2n+1){color:blue}p:nth-child(n+1){color:blue}p:nth-child(n+1){color:blue}p:nth-child(-n+1){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(n+1){color:blue}p:nth-child(n+1){color:blue}p:nth-child(-n+1){color:blue}p:nth-child(even){color:blue}p:nth-child(EVEN){color:blue}p:nth-child(2n){color:blue}p:nth-child(1){color:blue}p:nth-child(0n+1){color:blue}p:nth-child(0n+1){color:blue}p:nth-child(0n+1){color:blue}p:nth-child(0n+5){color:blue}p:nth-child(0n-5){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(-n+3){color:blue}p:nth-child(n+3){color:blue}p:nth-child(n-3){color:blue}p:nth-child(0n-3){color:blue}p:nth-child(0n+3){color:blue}p:nth-child(0n-3){color:blue}p:nth-child(0n-3){color:blue}p:nth-child(n+0){color:blue}p:nth-child(n+0){color:blue}p:nth-child(-n+0){color:blue}p:nth-child(5n+0){color:blue}p:nth-child(-5n+0){color:blue}p:nth-child(5n+0){color:blue}p:nth-child(-2n+1){color:blue}p:nth-of-type(2n+1){color:blue}p:nth-last-col(2n+1){color:blue}p:nth-col(2n+1){color:blue}p:nth-child(n+0){color:blue}p:nth-child(n+0){color:blue}p:nth-child(5){color:blue}p:nth-child(5){color:blue}p:nth-child(-5){color:blue}

View File

@ -15,6 +15,6 @@ a:has( <> img, > img) {}
a:has(> img, <> img) {} a:has(> img, <> img) {}
a:has(> img, <> img ) {} a:has(> img, <> img ) {}
a:has(> img, <> img , > img) {} a:has(> img, <> img , > img) {}
a:has(> img) { A:has(> IMG) {
color: RED; COLOR: RED;
} }

View File

@ -4,7 +4,7 @@ foo|* {}
|h1 {} |h1 {}
*|h1 {} *|h1 {}
h1 {} h1 {}
body {} BODY {}
html {} HTML {}
td {} TD {}
template {} TEMPLATE {}

View File

@ -51,7 +51,7 @@ _::selection,
html > body .selector {} html > body .selector {}
*:first-child + html .selector {} *:first-child + html .selector {}
.selector, .selector,
x:-ie7 {} x:-IE7 {}
* + html .selector {} * + html .selector {}
body *.selector {} body *.selector {}
.selector\ {} .selector\ {}

View File

@ -1,8 +1,8 @@
div { div {
color: #fff; color: #fff;
color: #ffffff; color: #ffffff;
color: #fff; color: #FFF;
color: #ffffff; color: #FFFFFF;
color: #dc143c; color: #dc143c;
color: #ff0000; color: #ff0000;
color: #ff0000ff; color: #ff0000ff;
@ -22,6 +22,6 @@ div {
border: thick double #32a1ce; border: thick double #32a1ce;
} }
.bar { .bar {
color: #123abcff; color: #123abcFF;
color: #123f; color: #123F;
} }

View File

@ -1 +1 @@
div{color:#fff;color:#fff;color:#fff;color:#fff;color:#dc143c;color:#f00;color:#f00;color:#f09;color:#f09;color:#0f38;color:#0f38;color:#0a0a0a;color:#0a0a0afa}div{background:url("starsolid.gif")#99f repeat-y fixed;background:url("starsolid.gif")repeat-y fixed#99f;background:url("starsolid.gif")repeat-y 12#99f}.foo{border:thick double#32a1ce}.bar{color:#123abcff;color:#123f} div{color:#fff;color:#fff;color:#FFF;color:#FFF;color:#dc143c;color:#f00;color:#f00;color:#f09;color:#f09;color:#0f38;color:#0f38;color:#0a0a0a;color:#0a0a0afa}div{background:url("starsolid.gif")#99f repeat-y fixed;background:url("starsolid.gif")repeat-y fixed#99f;background:url("starsolid.gif")repeat-y 12#99f}.foo{border:thick double#32a1ce}.bar{color:#123abcFF;color:#123F}

View File

@ -11,8 +11,8 @@ div {
width: 0.00254cm; width: 0.00254cm;
} }
.foo { .foo {
width: 100px; width: 100PX;
transform: rotate(45deg); TRANSFORM: ROTATE(45DEG);
} }
a { a {
width: 10e\30px; width: 10e\30px;

View File

@ -4,8 +4,8 @@ div {
background: url(https://example.com/image.png); background: url(https://example.com/image.png);
background: url("https://example.com/image.png"); background: url("https://example.com/image.png");
background: url('https://example.com/image.png'); background: url('https://example.com/image.png');
background: url('https://example.com/image.png'); background: URL('https://example.com/image.png');
background: url('https://example.com/image.png'); background: URL('https://example.com/image.png');
background: url(data:image/png;base64,iRxVB0); background: url(data:image/png;base64,iRxVB0);
background: url(#IDofSVGpath); background: url(#IDofSVGpath);
background: url("//aa.com/img.svg" prefetch); background: url("//aa.com/img.svg" prefetch);
@ -16,7 +16,7 @@ div {
background: url(''); background: url('');
--foo: "http://www.example.com/pinkish.gif"; --foo: "http://www.example.com/pinkish.gif";
background: src("http://www.example.com/pinkish.gif"); background: src("http://www.example.com/pinkish.gif");
background: src("http://www.example.com/pinkish.gif"); background: SRC("http://www.example.com/pinkish.gif");
background: src(var(--foo)); background: src(var(--foo));
background: url(https://example.com/image.png); background: url(https://example.com/image.png);
background: url(https://example.com/image.png); background: url(https://example.com/image.png);

View File

@ -15,10 +15,10 @@ impl Compiler {
} }
}; };
if name.value == "rgb" { if name.value.eq_ignore_ascii_case("rgb") {
name.value = "rgba".into(); name.value = "rgba".into();
name.raw = None; name.raw = None;
} else if name.value == "hsl" { } else if name.value.eq_ignore_ascii_case("hsl") {
name.value = "hsla".into(); name.value = "hsla".into();
name.raw = None; name.raw = None;
} }
@ -30,10 +30,10 @@ impl Compiler {
} }
}; };
if name.value == "rgba" { if name.value.eq_ignore_ascii_case("rgba") {
name.value = "rgb".into(); name.value = "rgb".into();
name.raw = None; name.raw = None;
} else if name.value == "hsla" { } else if name.value.eq_ignore_ascii_case("hsla") {
name.value = "hsl".into(); name.value = "hsl".into();
name.raw = None; name.raw = None;
} }

View File

@ -27,6 +27,9 @@ impl Compiler {
.and_then(|color| color.as_mut_absolute_color_base()) .and_then(|color| color.as_mut_absolute_color_base())
.and_then(|color| color.as_mut_hex_color()) .and_then(|color| color.as_mut_hex_color())
{ {
hex_color.value = hex_color.value.to_ascii_lowercase();
hex_color.raw = None;
if hex_color.value.len() != 4 && hex_color.value.len() != 8 { if hex_color.value.len() != 4 && hex_color.value.len() != 8 {
return; return;
} }

View File

@ -1,7 +1,9 @@
use std::mem::take; use std::mem::take;
use swc_common::DUMMY_SP; use swc_common::DUMMY_SP;
use swc_css_ast::{matches_eq, AbsoluteColorBase, ComponentValue, Delimiter, DelimiterValue}; use swc_css_ast::{
matches_eq_ignore_ascii_case, AbsoluteColorBase, ComponentValue, Delimiter, DelimiterValue,
};
use crate::compiler::Compiler; use crate::compiler::Compiler;
@ -11,7 +13,8 @@ impl Compiler {
n: &mut AbsoluteColorBase, n: &mut AbsoluteColorBase,
) { ) {
if let AbsoluteColorBase::Function(function) = n { if let AbsoluteColorBase::Function(function) = n {
if !matches_eq!(function.name, "rgb", "rgba", "hsl", "hsla") { if !matches_eq_ignore_ascii_case!(function.name.as_str(), "rgb", "rgba", "hsl", "hsla")
{
return; return;
} }

View File

@ -16,13 +16,10 @@ pub(super) struct CustomMediaHandler {
impl CustomMediaHandler { impl CustomMediaHandler {
pub(crate) fn store_custom_media(&mut self, n: &mut AtRule) { pub(crate) fn store_custom_media(&mut self, n: &mut AtRule) {
if let AtRuleName::Ident(name) = &n.name { if let AtRuleName::Ident(..) = &n.name {
if name.value == "custom-media" { if let Some(AtRulePrelude::CustomMediaPrelude(prelude)) = &mut n.prelude.as_deref_mut()
if let Some(AtRulePrelude::CustomMediaPrelude(prelude)) = {
&mut n.prelude.as_deref_mut() self.medias.push(prelude.take());
{
self.medias.push(prelude.take());
}
} }
} }
} }
@ -30,7 +27,10 @@ impl CustomMediaHandler {
pub(crate) fn process_rules(&mut self, n: &mut Vec<Rule>) { pub(crate) fn process_rules(&mut self, n: &mut Vec<Rule>) {
n.retain(|n| match n { n.retain(|n| match n {
Rule::AtRule(n) => { Rule::AtRule(n) => {
if matches!(&n.name, AtRuleName::Ident(ident) if ident.value == "custom-media") { if matches!(
n.prelude.as_deref(),
Some(AtRulePrelude::CustomMediaPrelude(..))
) {
return false; return false;
} }

View File

@ -1,7 +1,8 @@
use std::f64::consts::PI; use std::f64::consts::PI;
use swc_css_ast::{ use swc_css_ast::{
matches_eq, AbsoluteColorBase, AlphaValue, Angle, ComponentValue, Number, Percentage, matches_eq_ignore_ascii_case, AbsoluteColorBase, AlphaValue, Angle, ComponentValue, Number,
Percentage,
}; };
use swc_css_utils::{clamp_unit_f64, round_alpha}; use swc_css_utils::{clamp_unit_f64, round_alpha};
@ -10,8 +11,8 @@ use crate::compiler::Compiler;
impl Compiler { impl Compiler {
pub(crate) fn process_rgb_and_hsl(&mut self, n: &mut AbsoluteColorBase) { pub(crate) fn process_rgb_and_hsl(&mut self, n: &mut AbsoluteColorBase) {
if let AbsoluteColorBase::Function(function) = n { if let AbsoluteColorBase::Function(function) = n {
let is_rgb = matches_eq!(function.name, "rgb", "rgba"); let is_rgb = matches_eq_ignore_ascii_case!(function.name.as_str(), "rgb", "rgba");
let is_hsl = matches_eq!(function.name, "hsl", "hsla"); let is_hsl = matches_eq_ignore_ascii_case!(function.name.as_str(), "hsl", "hsla");
if is_rgb { if is_rgb {
function.value = function function.value = function

View File

@ -0,0 +1,3 @@
body {
transform: translateY(-50%);
}

View File

@ -0,0 +1,3 @@
body {
transform: translateY(-50%);
}

View File

@ -9,10 +9,10 @@
} }
.test-rgba { .test-rgba {
color: rgb(178, 34, 34); color: rgb(178, 34, 34);
color: rgba(178, 34, 34, 1); color: rgbA(178, 34, 34, 1);
color: rgba(178, 34, 34, .5); color: rgba(178, 34, 34, .5);
color: rgba(178, 34, 34, var(--alpha-50)); color: rgba(178, 34, 34, VaR(--alpha-50));
color: rgba(178, 34, 34, calc(1 / 2)); color: rgba(178, 34, 34, CaLC(1 / 2));
} }
.test-rgb-percentages { .test-rgb-percentages {
color: rgb(179, 34, 34); color: rgb(179, 34, 34);
@ -79,7 +79,7 @@
.test-ignore { .test-ignore {
color: rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.1);
color: rgba(0, 0, 0, 0.2); color: rgba(0, 0, 0, 0.2);
color: rgb(178, 34, 34); color: rGB(178, 34, 34);
} }
.order-0 { .order-0 {
order: rgba(178, 34, 34, 1) !important; order: rgba(178, 34, 34, 1) !important;

View File

@ -202,3 +202,24 @@ fn test_color_hwb(input: PathBuf) {
}) })
.unwrap(); .unwrap();
} }
#[testing::fixture("tests/all/**/*.css", exclude("expect.css"))]
fn test_all(input: PathBuf) {
let output = input.with_extension("expect.css");
testing::run_test(false, |cm, _| {
let fm = cm.load_file(&input).unwrap();
let mut ss = parse_stylesheet(&fm);
ss.visit_mut_with(&mut Compiler::new(Config {
process: Features::all(),
}));
let s = print_stylesheet(&ss);
NormalizedOutput::from(s).compare_to_file(&output).unwrap();
Ok(())
})
.unwrap();
}

View File

@ -2,7 +2,7 @@ body {
order: 1; order: 1;
} }
body, body,
not { Not {
order: 2; order: 2;
} }
em[attr=:not], em[attr=:not],

View File

@ -1,5 +1,5 @@
x Hex color value '#fff' should be written into: '#ffffff'. x Hex color value '#FFF' should be written into: '#FFFFFF'.
,-[$DIR/tests/rules/fail/color-hex-length/long/input.css:1:1] ,-[$DIR/tests/rules/fail/color-hex-length/long/input.css:1:1]
1 | a { 1 | a {
2 | color: #FFF; 2 | color: #FFF;

View File

@ -1,5 +1,5 @@
x Hex color value '#ffffff' should be written into: '#fff'. x Hex color value '#FFFFFF' should be written into: '#FFF'.
,-[$DIR/tests/rules/fail/color-hex-length/short/input.css:1:1] ,-[$DIR/tests/rules/fail/color-hex-length/short/input.css:1:1]
1 | a { 1 | a {
2 | color: #FFFFFF; 2 | color: #FFFFFF;

View File

@ -5,7 +5,9 @@ use super::Compressor;
impl Compressor { impl Compressor {
pub(super) fn compress_declaration(&self, declaration: &mut Declaration) { pub(super) fn compress_declaration(&self, declaration: &mut Declaration) {
if let DeclarationName::Ident(Ident { value: name, .. }) = &declaration.name { if let DeclarationName::Ident(Ident { value: name, .. }) = &mut declaration.name {
*name = name.to_ascii_lowercase();
match &**name { match &**name {
"display" if declaration.value.len() > 1 => { "display" if declaration.value.len() > 1 => {
let mut outside = None; let mut outside = None;
@ -484,15 +486,19 @@ impl Compressor {
match (node_1, node_2) { match (node_1, node_2) {
(ComponentValue::Dimension(dimension_1), ComponentValue::Dimension(dimension_2)) => { (ComponentValue::Dimension(dimension_1), ComponentValue::Dimension(dimension_2)) => {
let result_1 = dimension_1 let Some(result_1) = dimension_1.as_length() else {
.as_length() return false;
.map(|length| (&length.value.value, &length.unit.value)); };
let result_2 = dimension_2 let Some(result_2) = dimension_2.as_length() else {
.as_length() return false;
.map(|length| (&length.value.value, &length.unit.value)); };
result_1.is_some() && result_1 == result_2 result_1.value.value == result_2.value.value
&& result_1
.unit
.value
.eq_ignore_ascii_case(&result_2.unit.value)
} }
( (
ComponentValue::Percentage(percentage_1), ComponentValue::Percentage(percentage_1),

View File

@ -32,6 +32,10 @@ impl Compressor {
} }
pub(super) fn compress_keyframe_selector(&mut self, keyframe_selector: &mut KeyframeSelector) { pub(super) fn compress_keyframe_selector(&mut self, keyframe_selector: &mut KeyframeSelector) {
if let KeyframeSelector::Ident(i) = keyframe_selector {
i.value = i.value.to_ascii_lowercase();
}
match keyframe_selector { match keyframe_selector {
KeyframeSelector::Ident(i) if i.value == "from" => { KeyframeSelector::Ident(i) if i.value == "from" => {
*keyframe_selector = KeyframeSelector::Percentage(Percentage { *keyframe_selector = KeyframeSelector::Percentage(Percentage {

View File

@ -54,46 +54,111 @@ impl VisitMut for Compressor {
self.compress_alpha_value(n); self.compress_alpha_value(n);
} }
fn visit_mut_stylesheet(&mut self, n: &mut Stylesheet) { fn visit_mut_an_plus_b(&mut self, n: &mut AnPlusB) {
if let AnPlusB::Ident(n) = n {
n.value = n.value.to_ascii_lowercase();
n.raw = None;
}
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_stylesheet(n); self.compress_an_plus_b(n);
}
if !self.need_utf8_at_rule fn visit_mut_angle(&mut self, n: &mut Angle) {
&& n.rules n.visit_mut_children_with(self);
.first()
.and_then(|rule| rule.as_at_rule()) self.compress_angle(n);
.and_then(|at_rule| at_rule.prelude.as_ref()) }
.and_then(|prelude| prelude.as_charset_prelude())
.filter(|x| x.value.eq_ignore_ascii_case("utf-8")) fn visit_mut_at_rule(&mut self, n: &mut AtRule) {
.is_some() n.visit_mut_children_with(self);
{
n.rules.remove(0); self.compress_keyframes_at_rule(n);
}
fn visit_mut_at_rule_name(&mut self, n: &mut AtRuleName) {
if let AtRuleName::Ident(n) = n {
n.value = n.value.to_ascii_lowercase();
n.raw = None;
}
n.visit_mut_children_with(self);
}
fn visit_mut_attribute_selector(&mut self, n: &mut AttributeSelector) {
n.visit_mut_children_with(self);
self.compress_attribute_selector(n);
}
fn visit_mut_calc_sum(&mut self, n: &mut CalcSum) {
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_math_function: true,
..self.ctx
}));
// Don't touch `@supports`, it can be used to check a browser's support for one
// or more specific CSS features
if !self.in_supports_condition {
self.compress_calc_sum(n);
} }
} }
fn visit_mut_simple_block(&mut self, n: &mut SimpleBlock) { fn visit_mut_color(&mut self, n: &mut Color) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_simple_block(n); self.compress_color(n);
} }
fn visit_mut_time(&mut self, n: &mut Time) { fn visit_mut_component_value(&mut self, n: &mut ComponentValue) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_time(n); if self.in_supports_condition {
return;
}
self.compress_calc_sum_in_component_value(n);
self.compress_alpha_value_in_component_value(n);
self.compress_component_value_for_length(n);
self.compress_easing_function(n);
self.compress_transform_function(n);
self.compress_angle_in_component_value(n);
} }
fn visit_mut_unicode_range(&mut self, n: &mut UnicodeRange) { fn visit_mut_compound_selector(&mut self, n: &mut CompoundSelector) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_unicode_range(n); self.compress_compound_selector(n);
} }
fn visit_mut_url(&mut self, n: &mut Url) { fn visit_mut_custom_ident(&mut self, custom_ident: &mut CustomIdent) {
n.visit_mut_children_with(self); custom_ident.visit_mut_children_with(self);
self.compress_url(n); if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&custom_ident.value);
}
}
fn visit_mut_custom_property_name(&mut self, custom_property_name: &mut CustomPropertyName) {
custom_property_name.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&custom_property_name.value);
}
}
fn visit_mut_dashed_ident(&mut self, dashed_ident: &mut DashedIdent) {
dashed_ident.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&dashed_ident.value);
}
} }
fn visit_mut_declaration(&mut self, n: &mut Declaration) { fn visit_mut_declaration(&mut self, n: &mut Declaration) {
@ -125,22 +190,64 @@ impl VisitMut for Compressor {
} }
} }
fn visit_mut_color(&mut self, n: &mut Color) { fn visit_mut_forgiving_relative_selector_list(
&mut self,
n: &mut ForgivingRelativeSelectorList,
) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_color(n); self.compress_forgiving_relative_selector_list(n);
}
fn visit_mut_forgiving_selector_list(&mut self, n: &mut ForgivingSelectorList) {
n.visit_mut_children_with(self);
self.compress_forgiving_selector_list(n);
} }
fn visit_mut_frequency(&mut self, n: &mut Frequency) { fn visit_mut_frequency(&mut self, n: &mut Frequency) {
n.unit.value = n.unit.value.to_ascii_lowercase();
n.unit.raw = None;
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_frequency(n); self.compress_frequency(n);
} }
fn visit_mut_at_rule(&mut self, n: &mut AtRule) { fn visit_mut_function(&mut self, n: &mut Function) {
n.visit_mut_children_with(self); if let FunctionName::Ident(n) = &mut n.name {
n.value = n.value.to_ascii_lowercase();
n.raw = None;
}
self.compress_keyframes_at_rule(n); if matches_eq!(
n.name, "rotate", "skew", "skewx", "skewy", "rotate3d", "rotatex", "rotatey", "rotatez"
) {
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_transform_function: true,
..self.ctx
}));
} else {
n.visit_mut_children_with(self);
}
}
fn visit_mut_hex_color(&mut self, n: &mut HexColor) {
let new = n.value.to_ascii_lowercase();
if new != n.value {
n.value = new;
n.raw = None;
}
n.visit_mut_children_with(self);
}
fn visit_mut_ident(&mut self, ident: &mut Ident) {
ident.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&ident.value);
}
} }
fn visit_mut_import_href(&mut self, n: &mut ImportHref) { fn visit_mut_import_href(&mut self, n: &mut ImportHref) {
@ -149,10 +256,26 @@ impl VisitMut for Compressor {
self.compress_import_href(n); self.compress_import_href(n);
} }
fn visit_mut_media_query_list(&mut self, n: &mut MediaQueryList) { fn visit_mut_keyframe_block(&mut self, n: &mut KeyframeBlock) {
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_keyframe_block: true,
..self.ctx
}));
}
fn visit_mut_keyframe_selector(&mut self, n: &mut KeyframeSelector) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_media_query_list(n); self.compress_keyframe_selector(n);
}
fn visit_mut_length(&mut self, n: &mut Length) {
n.unit.value = n.unit.value.to_ascii_lowercase();
n.unit.raw = None;
n.visit_mut_children_with(self);
self.compress_length(n);
} }
fn visit_mut_media_condition(&mut self, n: &mut MediaCondition) { fn visit_mut_media_condition(&mut self, n: &mut MediaCondition) {
@ -167,12 +290,6 @@ impl VisitMut for Compressor {
self.compress_media_condition_without_or(n); self.compress_media_condition_without_or(n);
} }
fn visit_mut_media_in_parens(&mut self, n: &mut MediaInParens) {
n.visit_mut_children_with(self);
self.compress_media_in_parens(n);
}
fn visit_mut_media_feature(&mut self, n: &mut MediaFeature) { fn visit_mut_media_feature(&mut self, n: &mut MediaFeature) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
@ -186,6 +303,114 @@ impl VisitMut for Compressor {
self.compress_media_feature_value_length(n); self.compress_media_feature_value_length(n);
} }
fn visit_mut_media_in_parens(&mut self, n: &mut MediaInParens) {
n.visit_mut_children_with(self);
self.compress_media_in_parens(n);
}
fn visit_mut_media_query_list(&mut self, n: &mut MediaQueryList) {
n.visit_mut_children_with(self);
self.compress_media_query_list(n);
}
fn visit_mut_pseudo_class_selector(&mut self, n: &mut PseudoClassSelector) {
match &mut n.name {
Ident { value, .. }
if matches_eq_ignore_ascii_case!(
&**value,
"not",
"is",
"where",
"matches",
"-moz-any",
"-webkit-any"
) =>
{
n.name.value = n.name.value.to_ascii_lowercase();
n.name.raw = None;
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_logic_combinator_selector: true,
..self.ctx
}));
}
_ => {
n.visit_mut_children_with(self);
}
}
}
fn visit_mut_pseudo_element_selector(&mut self, n: &mut PseudoElementSelector) {
n.name.value = n.name.value.to_ascii_lowercase();
n.name.raw = None;
n.visit_mut_children_with(self);
}
fn visit_mut_relative_selector_list(&mut self, n: &mut RelativeSelectorList) {
n.visit_mut_children_with(self);
self.compress_relative_selector_list(n);
}
fn visit_mut_selector_list(&mut self, n: &mut SelectorList) {
n.visit_mut_children_with(self);
self.compress_selector_list(n);
}
fn visit_mut_simple_block(&mut self, n: &mut SimpleBlock) {
n.visit_mut_children_with(self);
self.compress_simple_block(n);
}
fn visit_mut_size_feature_value(&mut self, n: &mut SizeFeatureValue) {
n.visit_mut_children_with(self);
self.compress_calc_sum_in_size_feature_value(n);
self.compress_size_feature_value_length(n);
}
fn visit_mut_str(&mut self, string: &mut Str) {
string.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&string.value);
}
}
fn visit_mut_stylesheet(&mut self, n: &mut Stylesheet) {
n.visit_mut_children_with(self);
self.compress_stylesheet(n);
if !self.need_utf8_at_rule
&& n.rules
.first()
.and_then(|rule| rule.as_at_rule())
.and_then(|at_rule| at_rule.prelude.as_ref())
.and_then(|prelude| prelude.as_charset_prelude())
.filter(|x| x.value.eq_ignore_ascii_case("utf-8"))
.is_some()
{
n.rules.remove(0);
}
}
fn visit_mut_subclass_selector(&mut self, n: &mut SubclassSelector) {
if let SubclassSelector::PseudoClass(PseudoClassSelector { name, .. }) = n {
name.value = name.value.to_ascii_lowercase();
name.raw = None;
}
n.visit_mut_children_with(self);
self.compress_subclass_selector(n);
}
fn visit_mut_supports_condition(&mut self, n: &mut SupportsCondition) { fn visit_mut_supports_condition(&mut self, n: &mut SupportsCondition) {
let old_in_support_condition = self.in_supports_condition; let old_in_support_condition = self.in_supports_condition;
@ -204,192 +429,17 @@ impl VisitMut for Compressor {
self.compress_supports_in_parens(n); self.compress_supports_in_parens(n);
} }
fn visit_mut_size_feature_value(&mut self, n: &mut SizeFeatureValue) { fn visit_mut_tag_name_selector(&mut self, n: &mut TagNameSelector) {
n.name.value.value = n.name.value.value.to_ascii_lowercase();
n.name.value.raw = None;
n.visit_mut_children_with(self);
}
fn visit_mut_time(&mut self, n: &mut Time) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);
self.compress_calc_sum_in_size_feature_value(n); self.compress_time(n);
self.compress_size_feature_value_length(n);
}
fn visit_mut_keyframe_selector(&mut self, n: &mut KeyframeSelector) {
n.visit_mut_children_with(self);
self.compress_keyframe_selector(n);
}
fn visit_mut_calc_sum(&mut self, n: &mut CalcSum) {
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_math_function: true,
..self.ctx
}));
// Don't touch `@supports`, it can be used to check a browser's support for one
// or more specific CSS features
if !self.in_supports_condition {
self.compress_calc_sum(n);
}
}
fn visit_mut_component_value(&mut self, n: &mut ComponentValue) {
n.visit_mut_children_with(self);
if self.in_supports_condition {
return;
}
self.compress_calc_sum_in_component_value(n);
self.compress_alpha_value_in_component_value(n);
self.compress_component_value_for_length(n);
self.compress_easing_function(n);
self.compress_transform_function(n);
self.compress_angle_in_component_value(n);
}
fn visit_mut_length(&mut self, n: &mut Length) {
n.visit_mut_children_with(self);
self.compress_length(n);
}
fn visit_mut_pseudo_class_selector(&mut self, n: &mut PseudoClassSelector) {
match &n.name {
Ident { value, .. }
if matches!(
&**value,
"not" | "is" | "where" | "matches" | "-moz-any" | "-webkit-any"
) =>
{
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_logic_combinator_selector: true,
..self.ctx
}));
}
_ => {
n.visit_mut_children_with(self);
}
}
}
fn visit_mut_selector_list(&mut self, n: &mut SelectorList) {
n.visit_mut_children_with(self);
self.compress_selector_list(n);
}
fn visit_mut_forgiving_selector_list(&mut self, n: &mut ForgivingSelectorList) {
n.visit_mut_children_with(self);
self.compress_forgiving_selector_list(n);
}
fn visit_mut_relative_selector_list(&mut self, n: &mut RelativeSelectorList) {
n.visit_mut_children_with(self);
self.compress_relative_selector_list(n);
}
fn visit_mut_forgiving_relative_selector_list(
&mut self,
n: &mut ForgivingRelativeSelectorList,
) {
n.visit_mut_children_with(self);
self.compress_forgiving_relative_selector_list(n);
}
fn visit_mut_an_plus_b(&mut self, n: &mut AnPlusB) {
n.visit_mut_children_with(self);
self.compress_an_plus_b(n);
}
fn visit_mut_subclass_selector(&mut self, n: &mut SubclassSelector) {
n.visit_mut_children_with(self);
self.compress_subclass_selector(n);
}
fn visit_mut_compound_selector(&mut self, n: &mut CompoundSelector) {
n.visit_mut_children_with(self);
self.compress_compound_selector(n);
}
fn visit_mut_attribute_selector(&mut self, n: &mut AttributeSelector) {
n.visit_mut_children_with(self);
self.compress_attribute_selector(n);
}
fn visit_mut_keyframe_block(&mut self, n: &mut KeyframeBlock) {
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_keyframe_block: true,
..self.ctx
}));
}
fn visit_mut_function(&mut self, n: &mut Function) {
if matches_eq!(
n.name, "rotate", "skew", "skewx", "skewy", "rotate3d", "rotatex", "rotatey", "rotatez"
) {
n.visit_mut_children_with(&mut *self.with_ctx(Ctx {
in_transform_function: true,
..self.ctx
}));
} else {
n.visit_mut_children_with(self);
}
}
fn visit_mut_angle(&mut self, n: &mut Angle) {
n.visit_mut_children_with(self);
self.compress_angle(n);
}
fn visit_mut_ident(&mut self, ident: &mut Ident) {
ident.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&ident.value);
}
}
fn visit_mut_custom_ident(&mut self, custom_ident: &mut CustomIdent) {
custom_ident.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&custom_ident.value);
}
}
fn visit_mut_dashed_ident(&mut self, dashed_ident: &mut DashedIdent) {
dashed_ident.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&dashed_ident.value);
}
}
fn visit_mut_str(&mut self, string: &mut Str) {
string.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&string.value);
}
}
fn visit_mut_custom_property_name(&mut self, custom_property_name: &mut CustomPropertyName) {
custom_property_name.visit_mut_children_with(self);
if !self.need_utf8_at_rule {
self.need_utf8_at_rule = !contains_only_ascii_characters(&custom_property_name.value);
}
} }
fn visit_mut_token_and_span(&mut self, token_and_span: &mut TokenAndSpan) { fn visit_mut_token_and_span(&mut self, token_and_span: &mut TokenAndSpan) {
@ -421,6 +471,21 @@ impl VisitMut for Compressor {
} }
} }
} }
fn visit_mut_unicode_range(&mut self, n: &mut UnicodeRange) {
n.visit_mut_children_with(self);
self.compress_unicode_range(n);
}
fn visit_mut_url(&mut self, n: &mut Url) {
n.name.value = n.name.value.to_ascii_lowercase();
n.name.raw = None;
n.visit_mut_children_with(self);
self.compress_url(n);
}
} }
fn contains_only_ascii_characters(string: &str) -> bool { fn contains_only_ascii_characters(string: &str) -> bool {

View File

@ -4,6 +4,11 @@ use super::Compressor;
impl Compressor { impl Compressor {
pub(super) fn compress_unicode_range(&self, unicode_range: &mut UnicodeRange) { pub(super) fn compress_unicode_range(&self, unicode_range: &mut UnicodeRange) {
unicode_range.start = unicode_range.start.to_ascii_lowercase();
if let Some(end) = &mut unicode_range.end {
*end = end.to_ascii_lowercase();
}
if unicode_range.end.is_none() { if unicode_range.end.is_none() {
unicode_range.start = self.remove_leading_zeros(&unicode_range.start).into(); unicode_range.start = self.remove_leading_zeros(&unicode_range.start).into();

View File

@ -1,7 +1,7 @@
@import url(test.css); @import url(test.css);
@import url('test.css'); @import url('test.css');
@import url("test.css"); @import url("test.css");
@import url(test.css); @IMPORT url(test.css);
@import url(test.css); @import url(test.css);
@import url(test.css); @import url(test.css);
@import url(test.css); @import url(test.css);
@ -21,7 +21,7 @@
@import url(''); @import url('');
@import url(""); @import url("");
@import url(test.css) screen and (orientation: landscape); @import url(test.css) screen and (orientation: landscape);
@import url(test.css) screen and (orientation: landscape); @import url(test.css) SCREEN and (ORIENTATION: LANDSCAPE);
@import url(test.css) screen and (orientation: landscape); @import url(test.css) screen and (orientation: landscape);
@import url(test.css) screen and (orientation: landscape); @import url(test.css) screen and (orientation: landscape);
@import url(test-media.css) screen and (orientation: landscape); @import url(test-media.css) screen and (orientation: landscape);
@ -141,7 +141,7 @@ st.css');
@import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px); @import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px);
@import url("./test.css") screen and (min-width: 400px); @import url("./test.css") screen and (min-width: 400px);
@import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px); @import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px);
@import url("./test.css") layer(DEFAULT) supports(display: FLEX) screen and (min-width: 400px); @import url("./test.css") LAYER(DEFAULT) SUPPORTS(DISPLAY: FLEX) SCREEN and (MIN-WIDTH: 400PX);
@import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px); @import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px);
@import url(test.css); @import url(test.css);
@import url(test.css); @import url(test.css);

View File

@ -3,21 +3,21 @@
} }
@keyframes __local__bounce { @keyframes __local__bounce {
0% { 0% {
transform: translatey(-100%); transform: translateY(-100%);
opacity: 0; opacity: 0;
} }
5% { 5% {
transform: translatey(-100%); transform: translateY(-100%);
opacity: 0; opacity: 0;
} }
} }
@-webkit-keyframes __local__bounce2 { @-webkit-keyframes __local__bounce2 {
0% { 0% {
transform: translatey(-100%); transform: translateY(-100%);
opacity: 0; opacity: 0;
} }
5% { 5% {
transform: translatey(-100%); transform: translateY(-100%);
opacity: 0; opacity: 0;
} }
} }

View File

@ -1,6 +1,6 @@
@value small from './file.css'; @value small from './file.css';
@media small { @media small {
.__local__header { .__local__header {
box-shadow: 0 0 4px #1f4f7f; box-shadow: 0 0 4px #1F4F7F;
} }
} }

View File

@ -1,6 +1,6 @@
@value small: (max-width: 599px); @value small: (max-width: 599px);
@media small { @media small {
.__local__header { .__local__header {
box-shadow: 0 0 4px #1f4f7f; box-shadow: 0 0 4px #1F4F7F;
} }
} }

View File

@ -31,9 +31,7 @@ where
if value.starts_with("--") { if value.starts_with("--") {
ColorProfileName::DashedIdent(self.parse()?) ColorProfileName::DashedIdent(self.parse()?)
} else { } else {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
ColorProfileName::Ident(name) ColorProfileName::Ident(name)
} }
@ -904,11 +902,10 @@ where
fn parse(&mut self) -> PResult<KeyframeSelector> { fn parse(&mut self) -> PResult<KeyframeSelector> {
match cur!(self) { match cur!(self) {
tok!("ident") => { tok!("ident") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
let lower = ident.value.to_ascii_lowercase();
ident.value = ident.value.to_ascii_lowercase(); if lower != "from" && lower != "to" {
if ident.value != "from" && ident.value != "to" {
return Err(Error::new( return Err(Error::new(
ident.span, ident.span,
ErrorKind::Expected("'from' or 'to' idents"), ErrorKind::Expected("'from' or 'to' idents"),
@ -1020,9 +1017,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -1054,9 +1049,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -1088,9 +1081,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -1432,9 +1423,7 @@ where
fn parse(&mut self) -> PResult<MediaType> { fn parse(&mut self) -> PResult<MediaType> {
match cur!(self) { match cur!(self) {
_ if !is_one_of_case_insensitive_ident!(self, "not", "and", "or", "only", "layer") => { _ if !is_one_of_case_insensitive_ident!(self, "not", "and", "or", "only", "layer") => {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
Ok(MediaType::Ident(name)) Ok(MediaType::Ident(name))
} }
@ -1558,9 +1547,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -1592,9 +1579,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -1626,9 +1611,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -1907,9 +1890,7 @@ where
Ok(MediaFeatureValue::Number(left)) Ok(MediaFeatureValue::Number(left))
} }
tok!("ident") => { tok!("ident") => {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
Ok(MediaFeatureValue::Ident(name)) Ok(MediaFeatureValue::Ident(name))
} }
@ -2036,9 +2017,7 @@ where
Token::Ident { value, .. } Token::Ident { value, .. }
if matches_eq_ignore_ascii_case!(value, "left", "right", "first", "blank") => if matches_eq_ignore_ascii_case!(value, "left", "right", "first", "blank") =>
{ {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
name name
} }
@ -2192,9 +2171,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -2226,9 +2203,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -2260,9 +2235,7 @@ where
let span = self.input.cur_span(); let span = self.input.cur_span();
let keyword = match cur!(self) { let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Some(ident) Some(ident)
} }
@ -2519,9 +2492,7 @@ where
Ok(SizeFeatureValue::Number(left)) Ok(SizeFeatureValue::Number(left))
} }
tok!("ident") => { tok!("ident") => {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
Ok(SizeFeatureValue::Ident(name)) Ok(SizeFeatureValue::Ident(name))
} }

View File

@ -493,9 +493,7 @@ where
match cur!(self) { match cur!(self) {
tok!("ident") => { tok!("ident") => {
let mut value: Ident = self.parse()?; let value: Ident = self.parse()?;
value.value = value.value.to_ascii_lowercase();
return Ok(TypeSelector::TagName(TagNameSelector { return Ok(TypeSelector::TagName(TagNameSelector {
span: span!(self, span.lo), span: span!(self, span.lo),
@ -828,9 +826,7 @@ where
match cur!(self) { match cur!(self) {
tok!("ident") => { tok!("ident") => {
let mut value: Ident = self.parse()?; let value: Ident = self.parse()?;
value.value = value.value.to_ascii_lowercase();
Ok(AttributeSelectorModifier { Ok(AttributeSelectorModifier {
span: span!(self, span.lo), span: span!(self, span.lo),
@ -892,9 +888,7 @@ where
"dir" => { "dir" => {
self.input.skip_ws(); self.input.skip_ws();
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
self.input.skip_ws(); self.input.skip_ws();
@ -994,9 +988,7 @@ where
self.input.skip_ws(); self.input.skip_ws();
if is!(self, "ident") { if is!(self, "ident") {
let mut of: Ident = self.parse()?; let of: Ident = self.parse()?;
of.value = of.value.to_ascii_lowercase();
children.push(PseudoClassSelectorChildren::Ident(of)); children.push(PseudoClassSelectorChildren::Ident(of));
@ -1059,9 +1051,7 @@ where
children: Some(children), children: Some(children),
}) })
} else if is!(self, Ident) { } else if is!(self, Ident) {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
Ok(PseudoClassSelector { Ok(PseudoClassSelector {
span: span!(self, span.lo), span: span!(self, span.lo),
@ -1183,9 +1173,7 @@ where
children: Some(children), children: Some(children),
}) })
} else if is!(self, Ident) { } else if is!(self, Ident) {
let mut name: Ident = self.parse()?; let name: Ident = self.parse()?;
name.value = name.value.to_ascii_lowercase();
Ok(PseudoElementSelector { Ok(PseudoElementSelector {
span: span!(self, span.lo), span: span!(self, span.lo),
@ -1212,9 +1200,8 @@ where
Token::Ident { value, .. } Token::Ident { value, .. }
if matches_eq_ignore_ascii_case!(value, "odd", "even") => if matches_eq_ignore_ascii_case!(value, "odd", "even") =>
{ {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
Ok(AnPlusB::Ident(ident)) Ok(AnPlusB::Ident(ident))
} }

View File

@ -157,7 +157,7 @@ where
} else { } else {
AtRuleName::Ident(Ident { AtRuleName::Ident(Ident {
span: Span::new(span.lo + BytePos(1), span.hi, Default::default()), span: Span::new(span.lo + BytePos(1), span.hi, Default::default()),
value: at_keyword_name.0.to_ascii_lowercase(), value: at_keyword_name.0,
raw: Some(at_keyword_name.1), raw: Some(at_keyword_name.1),
}) })
}; };
@ -616,9 +616,7 @@ where
DeclarationName::DashedIdent(ident) DeclarationName::DashedIdent(ident)
} else { } else {
let mut ident: Ident = self.parse()?; let ident: Ident = self.parse()?;
ident.value = ident.value.to_ascii_lowercase();
DeclarationName::Ident(ident) DeclarationName::Ident(ident)
}; };
@ -940,7 +938,7 @@ where
} else { } else {
FunctionName::Ident(Ident { FunctionName::Ident(Ident {
span: Span::new(span.lo, span.hi - BytePos(1), Default::default()), span: Span::new(span.lo, span.hi - BytePos(1), Default::default()),
value: function_name.0.to_ascii_lowercase(), value: function_name.0,
raw: Some(function_name.1), raw: Some(function_name.1),
}) })
}; };

View File

@ -197,7 +197,9 @@ where
let mut values = vec![]; let mut values = vec![];
match &**function_name { let lower_fname = function_name.to_ascii_lowercase();
match &*lower_fname {
"calc" | "-moz-calc" | "-webkit-calc" | "sin" | "cos" | "tan" | "asin" | "acos" "calc" | "-moz-calc" | "-webkit-calc" | "sin" | "cos" | "tan" | "asin" | "acos"
| "atan" | "sqrt" | "exp" | "abs" | "sign" => { | "atan" | "sqrt" | "exp" | "abs" | "sign" => {
self.input.skip_ws(); self.input.skip_ws();
@ -402,7 +404,7 @@ where
_ => {} _ => {}
} }
match &**function_name { match &*lower_fname {
"rgb" | "rgba" => { "rgb" | "rgba" => {
let percentage_or_number_or_none = self.try_parse_variable_function( let percentage_or_number_or_none = self.try_parse_variable_function(
|parser, has_variable_before| match cur!(parser) { |parser, has_variable_before| match cur!(parser) {
@ -515,7 +517,7 @@ where
is_legacy_syntax = false; is_legacy_syntax = false;
} }
match &**function_name { match &*lower_fname {
"rgb" | "rgba" => { "rgb" | "rgba" => {
let percentage_or_number = self.try_parse_variable_function( let percentage_or_number = self.try_parse_variable_function(
|parser, has_variable_before| match cur!(parser) { |parser, has_variable_before| match cur!(parser) {
@ -631,7 +633,7 @@ where
} }
} }
match &**function_name { match &*lower_fname {
"rgb" | "rgba" => { "rgb" | "rgba" => {
let percentage_or_number = self.try_parse_variable_function( let percentage_or_number = self.try_parse_variable_function(
|parser, has_variable_before| match cur!(parser) { |parser, has_variable_before| match cur!(parser) {
@ -819,7 +821,7 @@ where
match cur!(self) { match cur!(self) {
Token::Ident { value, .. } Token::Ident { value, .. }
if matches_eq_ignore_ascii_case!(value, "from") if matches_eq_ignore_ascii_case!(value, "from")
&& *function_name != "device-cmyk" => && lower_fname != "device-cmyk" =>
{ {
values.push(ComponentValue::Ident(self.parse()?)); values.push(ComponentValue::Ident(self.parse()?));
@ -839,7 +841,7 @@ where
_ => {} _ => {}
} }
match &**function_name { match &*lower_fname {
"hwb" => { "hwb" => {
let hue_or_none = self.try_parse_variable_function( let hue_or_none = self.try_parse_variable_function(
|parser, has_variable_before| match cur!(parser) { |parser, has_variable_before| match cur!(parser) {
@ -947,7 +949,7 @@ where
} }
if !is_one_of!(self, EOF, "/") { if !is_one_of!(self, EOF, "/") {
match &**function_name { match &*lower_fname {
"hwb" => { "hwb" => {
let percentage_or_none = self.try_parse_variable_function( let percentage_or_none = self.try_parse_variable_function(
|parser, has_variable_before| match cur!(parser) { |parser, has_variable_before| match cur!(parser) {
@ -1064,7 +1066,7 @@ where
} }
if !is_one_of!(self, EOF, "/") { if !is_one_of!(self, EOF, "/") {
match &**function_name { match &*lower_fname {
"hwb" => { "hwb" => {
let percentage_or_none = self.try_parse_variable_function( let percentage_or_none = self.try_parse_variable_function(
|parser, has_variable_before| match cur!(parser) { |parser, has_variable_before| match cur!(parser) {
@ -1226,7 +1228,7 @@ where
} }
} }
if !is_one_of!(self, EOF, "/") && function_name == "device-cmyk" { if !is_one_of!(self, EOF, "/") && lower_fname == "device-cmyk" {
let cmyk_component = self.try_parse_variable_function( let cmyk_component = self.try_parse_variable_function(
|parser, _| Ok(Some(ComponentValue::CmykComponent(parser.parse()?))), |parser, _| Ok(Some(ComponentValue::CmykComponent(parser.parse()?))),
&mut has_variable, &mut has_variable,
@ -1252,7 +1254,7 @@ where
Token::Function { value, .. } if is_math_function(value) => { Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?))) Ok(Some(ComponentValue::Function(parser.parse()?)))
} }
tok!("ident") if !matches!(&**function_name, "device-cmyk") => { tok!("ident") if !matches!(&*lower_fname, "device-cmyk") => {
let ident: Box<Ident> = parser.parse()?; let ident: Box<Ident> = parser.parse()?;
if ident.value.eq_ignore_ascii_case("none") { if ident.value.eq_ignore_ascii_case("none") {
@ -1539,7 +1541,7 @@ where
Token::Function { value, .. } if is_math_function(value) => { Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?))) Ok(Some(ComponentValue::Function(parser.parse()?)))
} }
tok!("ident") if !matches!(&**function_name, "device-cmyk") => { tok!("ident") if !matches!(&*lower_fname, "device-cmyk") => {
let ident: Box<Ident> = parser.parse()?; let ident: Box<Ident> = parser.parse()?;
if ident.value.eq_ignore_ascii_case("none") { if ident.value.eq_ignore_ascii_case("none") {
@ -2027,7 +2029,7 @@ where
}, },
unit: Ident { unit: Ident {
span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()),
value: unit.to_ascii_lowercase(), value: unit,
raw: Some(raw_unit), raw: Some(raw_unit),
}, },
}) })
@ -2078,7 +2080,7 @@ where
}, },
unit: Ident { unit: Ident {
span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()),
value: unit.to_ascii_lowercase(), value: unit,
raw: Some(raw_unit), raw: Some(raw_unit),
}, },
}) })
@ -2126,7 +2128,7 @@ where
}, },
unit: Ident { unit: Ident {
span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()),
value: unit.to_ascii_lowercase(), value: unit,
raw: Some(raw_unit), raw: Some(raw_unit),
}, },
}) })
@ -2174,7 +2176,7 @@ where
}, },
unit: Ident { unit: Ident {
span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()),
value: unit.to_ascii_lowercase(), value: unit,
raw: Some(raw_unit), raw: Some(raw_unit),
}, },
}) })
@ -2225,7 +2227,7 @@ where
}, },
unit: Ident { unit: Ident {
span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()),
value: unit.to_ascii_lowercase(), value: unit,
raw: Some(raw_unit), raw: Some(raw_unit),
}, },
}) })
@ -2273,7 +2275,7 @@ where
}, },
unit: Ident { unit: Ident {
span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()),
value: unit.to_ascii_lowercase(), value: unit,
raw: Some(raw_unit), raw: Some(raw_unit),
}, },
}) })
@ -2424,7 +2426,7 @@ where
Ok(HexColor { Ok(HexColor {
span, span,
value: value.to_ascii_lowercase(), value,
raw: Some(raw), raw: Some(raw),
}) })
} }
@ -2620,7 +2622,7 @@ where
let name = Ident { let name = Ident {
span: Span::new(span.lo, span.hi - BytePos(1), Default::default()), span: Span::new(span.lo, span.hi - BytePos(1), Default::default()),
value: function_name.to_ascii_lowercase(), value: function_name,
raw: Some(raw_function_name), raw: Some(raw_function_name),
}; };
@ -2905,7 +2907,7 @@ where
next = chars.next(); next = chars.next();
} }
Some(c @ 'A'..='F') | Some(c @ 'a'..='f') => { Some(c @ 'A'..='F') | Some(c @ 'a'..='f') => {
start.push(c.to_ascii_lowercase()); start.push(c);
next = chars.next(); next = chars.next();
} }
@ -3005,7 +3007,7 @@ where
next = chars.next(); next = chars.next();
} }
Some(c @ 'A'..='F') | Some(c @ 'a'..='f') => { Some(c @ 'A'..='F') | Some(c @ 'a'..='f') => {
end.push(c.to_ascii_lowercase()); end.push(c);
next = chars.next(); next = chars.next();
} }
_ => { _ => {

View File

@ -224,7 +224,7 @@
"end": 250, "end": 250,
"ctxt": 0 "ctxt": 0
}, },
"value": "device-cmyk", "value": "DEVICE-CMYK",
"raw": "DEVICE-CMYK" "raw": "DEVICE-CMYK"
}, },
"block": { "block": {

View File

@ -7198,7 +7198,7 @@
"end": 2486, "end": 2486,
"ctxt": 0 "ctxt": 0
}, },
"value": "width", "value": "WIDTH",
"raw": "WIDTH" "raw": "WIDTH"
}, },
"comparison": "<=", "comparison": "<=",

View File

@ -272,7 +272,7 @@
"end": 136, "end": 136,
"ctxt": 0 "ctxt": 0
}, },
"value": "import", "value": "IMPORT",
"raw": "IMPORT" "raw": "IMPORT"
}, },
"prelude": { "prelude": {
@ -412,7 +412,7 @@
"end": 194, "end": 194,
"ctxt": 0 "ctxt": 0
}, },
"value": "url", "value": "URL",
"raw": "URL" "raw": "URL"
}, },
"value": { "value": {
@ -1057,7 +1057,7 @@
"end": 494, "end": 494,
"ctxt": 0 "ctxt": 0
}, },
"value": "layer", "value": "LAYER",
"raw": "LAYER" "raw": "LAYER"
}, },
"value": [ "value": [
@ -1547,7 +1547,7 @@
"end": 709, "end": 709,
"ctxt": 0 "ctxt": 0
}, },
"value": "supports", "value": "SUPPORTS",
"raw": "SUPPORTS" "raw": "SUPPORTS"
}, },
"value": [ "value": [
@ -2016,7 +2016,7 @@
"end": 904, "end": 904,
"ctxt": 0 "ctxt": 0
}, },
"value": "import", "value": "IMPORT",
"raw": "IMPORT" "raw": "IMPORT"
}, },
"prelude": { "prelude": {
@ -3160,7 +3160,7 @@
"end": 1318, "end": 1318,
"ctxt": 0 "ctxt": 0
}, },
"value": "screen", "value": "SCREEN",
"raw": "SCREEN" "raw": "SCREEN"
}, },
"keyword": { "keyword": {
@ -3195,7 +3195,7 @@
"end": 1335, "end": 1335,
"ctxt": 0 "ctxt": 0
}, },
"value": "orientation", "value": "ORIENTATION",
"raw": "ORIENTATION" "raw": "ORIENTATION"
}, },
"value": { "value": {
@ -3205,7 +3205,7 @@
"end": 1346, "end": 1346,
"ctxt": 0 "ctxt": 0
}, },
"value": "landscape", "value": "LANDSCAPE",
"raw": "LANDSCAPE" "raw": "LANDSCAPE"
} }
} }
@ -9192,7 +9192,7 @@
"end": 4755, "end": 4755,
"ctxt": 0 "ctxt": 0
}, },
"value": "layer", "value": "LAYER",
"raw": "LAYER" "raw": "LAYER"
}, },
"value": [ "value": [
@ -9239,7 +9239,7 @@
"end": 4773, "end": 4773,
"ctxt": 0 "ctxt": 0
}, },
"value": "supports", "value": "SUPPORTS",
"raw": "SUPPORTS" "raw": "SUPPORTS"
}, },
"value": [ "value": [
@ -9257,7 +9257,7 @@
"end": 4781, "end": 4781,
"ctxt": 0 "ctxt": 0
}, },
"value": "display", "value": "DISPLAY",
"raw": "DISPLAY" "raw": "DISPLAY"
}, },
"value": [ "value": [
@ -9299,7 +9299,7 @@
"end": 4795, "end": 4795,
"ctxt": 0 "ctxt": 0
}, },
"value": "screen", "value": "SCREEN",
"raw": "SCREEN" "raw": "SCREEN"
}, },
"keyword": { "keyword": {
@ -9334,7 +9334,7 @@
"end": 4810, "end": 4810,
"ctxt": 0 "ctxt": 0
}, },
"value": "min-width", "value": "MIN-WIDTH",
"raw": "MIN-WIDTH" "raw": "MIN-WIDTH"
}, },
"value": { "value": {
@ -9361,7 +9361,7 @@
"end": 4817, "end": 4817,
"ctxt": 0 "ctxt": 0
}, },
"value": "px", "value": "PX",
"raw": "PX" "raw": "PX"
} }
} }

View File

@ -256,7 +256,7 @@
"end": 158, "end": 158,
"ctxt": 0 "ctxt": 0
}, },
"value": "translatex", "value": "translateX",
"raw": "translateX" "raw": "translateX"
}, },
"value": [ "value": [
@ -354,7 +354,7 @@
"end": 209, "end": 209,
"ctxt": 0 "ctxt": 0
}, },
"value": "translatex", "value": "translateX",
"raw": "translateX" "raw": "translateX"
}, },
"value": [ "value": [
@ -1513,7 +1513,7 @@
"end": 686, "end": 686,
"ctxt": 0 "ctxt": 0
}, },
"value": "from", "value": "fRoM",
"raw": "fRoM" "raw": "fRoM"
} }
], ],
@ -1566,7 +1566,7 @@
"end": 718, "end": 718,
"ctxt": 0 "ctxt": 0
}, },
"value": "translatex", "value": "translateX",
"raw": "translateX" "raw": "translateX"
}, },
"value": [ "value": [
@ -1611,7 +1611,7 @@
"end": 737, "end": 737,
"ctxt": 0 "ctxt": 0
}, },
"value": "to", "value": "tO",
"raw": "tO" "raw": "tO"
} }
], ],
@ -1664,7 +1664,7 @@
"end": 769, "end": 769,
"ctxt": 0 "ctxt": 0
}, },
"value": "translatex", "value": "translateX",
"raw": "translateX" "raw": "translateX"
}, },
"value": [ "value": [

View File

@ -12558,7 +12558,7 @@
"end": 3814, "end": 3814,
"ctxt": 0 "ctxt": 0
}, },
"value": "and", "value": "AND",
"raw": "AND" "raw": "AND"
}, },
"condition": { "condition": {
@ -12624,7 +12624,7 @@
"end": 3837, "end": 3837,
"ctxt": 0 "ctxt": 0
}, },
"value": "or", "value": "OR",
"raw": "OR" "raw": "OR"
}, },
"condition": { "condition": {
@ -12801,7 +12801,7 @@
"end": 3889, "end": 3889,
"ctxt": 0 "ctxt": 0
}, },
"value": "and", "value": "AND",
"raw": "AND" "raw": "AND"
}, },
"condition": { "condition": {
@ -12872,7 +12872,7 @@
"end": 3912, "end": 3912,
"ctxt": 0 "ctxt": 0
}, },
"value": "or", "value": "OR",
"raw": "OR" "raw": "OR"
}, },
"condition": { "condition": {
@ -13614,7 +13614,7 @@
"end": 4122, "end": 4122,
"ctxt": 0 "ctxt": 0
}, },
"value": "not", "value": "NOT",
"raw": "NOT" "raw": "NOT"
}, },
"condition": { "condition": {
@ -13652,7 +13652,7 @@
"end": 4134, "end": 4134,
"ctxt": 0 "ctxt": 0
}, },
"value": "or", "value": "OR",
"raw": "OR" "raw": "OR"
}, },
"condition": { "condition": {
@ -16835,7 +16835,7 @@
"end": 4837, "end": 4837,
"ctxt": 0 "ctxt": 0
}, },
"value": "screen", "value": "SCREEN",
"raw": "SCREEN" "raw": "SCREEN"
}, },
"keyword": { "keyword": {
@ -16870,7 +16870,7 @@
"end": 4849, "end": 4849,
"ctxt": 0 "ctxt": 0
}, },
"value": "update", "value": "UPDATE",
"raw": "UPDATE" "raw": "UPDATE"
}, },
"value": { "value": {
@ -16880,7 +16880,7 @@
"end": 4855, "end": 4855,
"ctxt": 0 "ctxt": 0
}, },
"value": "slow", "value": "SLOW",
"raw": "SLOW" "raw": "SLOW"
} }
}, },
@ -16898,7 +16898,7 @@
"end": 4860, "end": 4860,
"ctxt": 0 "ctxt": 0
}, },
"value": "and", "value": "AND",
"raw": "AND" "raw": "AND"
}, },
"condition": { "condition": {
@ -16915,7 +16915,7 @@
"end": 4867, "end": 4867,
"ctxt": 0 "ctxt": 0
}, },
"value": "width", "value": "WIDTH",
"raw": "WIDTH" "raw": "WIDTH"
}, },
"comparison": ">", "comparison": ">",
@ -17505,7 +17505,7 @@
"end": 5019, "end": 5019,
"ctxt": 0 "ctxt": 0
}, },
"value": "media", "value": "MEDIA",
"raw": "MEDIA" "raw": "MEDIA"
}, },
"prelude": { "prelude": {
@ -17531,7 +17531,7 @@
"end": 5023, "end": 5023,
"ctxt": 0 "ctxt": 0
}, },
"value": "all", "value": "ALL",
"raw": "ALL" "raw": "ALL"
}, },
"keyword": null, "keyword": null,
@ -17572,7 +17572,7 @@
"end": 5033, "end": 5033,
"ctxt": 0 "ctxt": 0
}, },
"value": "media", "value": "MEDIA",
"raw": "MEDIA" "raw": "MEDIA"
}, },
"prelude": { "prelude": {
@ -17615,7 +17615,7 @@
"end": 5057, "end": 5057,
"ctxt": 0 "ctxt": 0
}, },
"value": "prefers-reduced-motion", "value": "PREFERS-reduced-motion",
"raw": "PREFERS-reduced-motion" "raw": "PREFERS-reduced-motion"
}, },
"value": { "value": {
@ -17698,7 +17698,7 @@
"end": 5085, "end": 5085,
"ctxt": 0 "ctxt": 0
}, },
"value": "root", "value": "ROOT",
"raw": "ROOT" "raw": "ROOT"
}, },
"children": null "children": null

View File

@ -3236,7 +3236,7 @@
"end": 1066, "end": 1066,
"ctxt": 0 "ctxt": 0
}, },
"value": "first", "value": "FIRST",
"raw": "FIRST" "raw": "FIRST"
} }
} }
@ -3311,7 +3311,7 @@
"end": 1081, "end": 1081,
"ctxt": 0 "ctxt": 0
}, },
"value": "left", "value": "LEFT",
"raw": "LEFT" "raw": "LEFT"
} }
} }

View File

@ -825,7 +825,7 @@
"end": 330, "end": 330,
"ctxt": 0 "ctxt": 0
}, },
"value": "supports", "value": "SUPPORTS",
"raw": "SUPPORTS" "raw": "SUPPORTS"
}, },
"prelude": { "prelude": {
@ -2930,7 +2930,7 @@
"end": 1255, "end": 1255,
"ctxt": 0 "ctxt": 0
}, },
"value": "not", "value": "NOT",
"raw": "NOT" "raw": "NOT"
}, },
"condition": { "condition": {
@ -3064,7 +3064,7 @@
"end": 1317, "end": 1317,
"ctxt": 0 "ctxt": 0
}, },
"value": "or", "value": "OR",
"raw": "OR" "raw": "OR"
}, },
"condition": { "condition": {
@ -3115,7 +3115,7 @@
"end": 1344, "end": 1344,
"ctxt": 0 "ctxt": 0
}, },
"value": "and", "value": "AND",
"raw": "AND" "raw": "AND"
}, },
"condition": { "condition": {
@ -3279,7 +3279,7 @@
"end": 1416, "end": 1416,
"ctxt": 0 "ctxt": 0
}, },
"value": "or", "value": "OR",
"raw": "OR" "raw": "OR"
}, },
"condition": { "condition": {
@ -3335,7 +3335,7 @@
"end": 1443, "end": 1443,
"ctxt": 0 "ctxt": 0
}, },
"value": "and", "value": "AND",
"raw": "AND" "raw": "AND"
}, },
"condition": { "condition": {
@ -3479,7 +3479,7 @@
"end": 1489, "end": 1489,
"ctxt": 0 "ctxt": 0
}, },
"value": "not", "value": "NOT",
"raw": "NOT" "raw": "NOT"
}, },
"condition": { "condition": {

View File

@ -269,7 +269,7 @@
"end": 229, "end": 229,
"ctxt": 0 "ctxt": 0
}, },
"value": "url", "value": "URL",
"raw": "URL" "raw": "URL"
}, },
"value": { "value": {

View File

@ -174,7 +174,7 @@
"end": 57, "end": 57,
"ctxt": 0 "ctxt": 0
}, },
"value": "ffffff", "value": "FFFFFF",
"raw": "FFFFFF" "raw": "FFFFFF"
} }
], ],
@ -236,7 +236,7 @@
"end": 97, "end": 97,
"ctxt": 0 "ctxt": 0
}, },
"value": "0000ffcc", "value": "0000FFCC",
"raw": "0000FFCC" "raw": "0000FFCC"
} }
], ],
@ -329,7 +329,7 @@
"end": 142, "end": 142,
"ctxt": 0 "ctxt": 0
}, },
"value": "fff", "value": "FFF",
"raw": "FFF" "raw": "FFF"
} }
], ],
@ -422,7 +422,7 @@
"end": 190, "end": 190,
"ctxt": 0 "ctxt": 0
}, },
"value": "ffff", "value": "FFFF",
"raw": "FFFF" "raw": "FFFF"
} }
], ],
@ -484,7 +484,7 @@
"end": 217, "end": 217,
"ctxt": 0 "ctxt": 0
}, },
"value": "ff", "value": "FF",
"raw": "FF" "raw": "FF"
} }
], ],

View File

@ -1253,7 +1253,7 @@
"end": 232, "end": 232,
"ctxt": 0 "ctxt": 0
}, },
"value": "i", "value": "I",
"raw": "I" "raw": "I"
} }
} }
@ -1497,7 +1497,7 @@
"end": 272, "end": 272,
"ctxt": 0 "ctxt": 0
}, },
"value": "s", "value": "S",
"raw": "S" "raw": "S"
} }
} }

View File

@ -6002,7 +6002,7 @@
"end": 1373, "end": 1373,
"ctxt": 0 "ctxt": 0
}, },
"value": "odd", "value": "ODD",
"raw": "ODD" "raw": "ODD"
} }
] ]
@ -6090,7 +6090,7 @@
"end": 1392, "end": 1392,
"ctxt": 0 "ctxt": 0
}, },
"value": "odd", "value": "oDd",
"raw": "oDd" "raw": "oDd"
} }
] ]
@ -6266,7 +6266,7 @@
"end": 1432, "end": 1432,
"ctxt": 0 "ctxt": 0
}, },
"value": "even", "value": "eVeN",
"raw": "eVeN" "raw": "eVeN"
} }
] ]
@ -6354,7 +6354,7 @@
"end": 1452, "end": 1452,
"ctxt": 0 "ctxt": 0
}, },
"value": "even", "value": "EVEN",
"raw": "EVEN" "raw": "EVEN"
} }
] ]

View File

@ -502,7 +502,7 @@
"end": 75, "end": 75,
"ctxt": 0 "ctxt": 0
}, },
"value": "input", "value": "iNpUt",
"raw": "iNpUt" "raw": "iNpUt"
} }
} }
@ -2373,7 +2373,7 @@
"end": 461, "end": 461,
"ctxt": 0 "ctxt": 0
}, },
"value": "hover", "value": "hOvEr",
"raw": "hOvEr" "raw": "hOvEr"
}, },
"children": null "children": null

View File

@ -416,7 +416,7 @@
"end": 76, "end": 76,
"ctxt": 0 "ctxt": 0
}, },
"value": "rtl", "value": "RTL",
"raw": "RTL" "raw": "RTL"
} }
] ]

View File

@ -682,7 +682,7 @@
"end": 83, "end": 83,
"ctxt": 0 "ctxt": 0
}, },
"value": "foo", "value": "FOO",
"raw": "FOO" "raw": "FOO"
} }
} }
@ -3120,7 +3120,7 @@
"end": 399, "end": 399,
"ctxt": 0 "ctxt": 0
}, },
"value": "foo", "value": "FOO",
"raw": "FOO" "raw": "FOO"
} }
} }

View File

@ -1771,7 +1771,7 @@
"end": 366, "end": 366,
"ctxt": 0 "ctxt": 0
}, },
"value": "before", "value": "bEfOrE",
"raw": "bEfOrE" "raw": "bEfOrE"
}, },
"children": null "children": null

View File

@ -414,7 +414,7 @@
"end": 75, "end": 75,
"ctxt": 0 "ctxt": 0
}, },
"value": "span", "value": "SPAN",
"raw": "SPAN" "raw": "SPAN"
} }
} }

View File

@ -941,7 +941,7 @@
"end": 100, "end": 100,
"ctxt": 0 "ctxt": 0
}, },
"value": "foreignobject", "value": "foreignObject",
"raw": "foreignObject" "raw": "foreignObject"
} }
} }
@ -1070,7 +1070,7 @@
"end": 117, "end": 117,
"ctxt": 0 "ctxt": 0
}, },
"value": "textpath", "value": "textPath",
"raw": "textPath" "raw": "textPath"
} }
} }

View File

@ -491,7 +491,7 @@
"end": 171, "end": 171,
"ctxt": 0 "ctxt": 0
}, },
"value": "rgb", "value": "rGb",
"raw": "rGb" "raw": "rGb"
}, },
"value": [ "value": [
@ -2419,7 +2419,7 @@
"end": 812, "end": 812,
"ctxt": 0 "ctxt": 0
}, },
"value": "rgba", "value": "rGbA",
"raw": "rGbA" "raw": "rGbA"
}, },
"value": [ "value": [
@ -3850,7 +3850,7 @@
"end": 1299, "end": 1299,
"ctxt": 0 "ctxt": 0
}, },
"value": "hsl", "value": "HsL",
"raw": "HsL" "raw": "HsL"
}, },
"value": [ "value": [

View File

@ -276,7 +276,7 @@
"end": 79, "end": 79,
"ctxt": 0 "ctxt": 0
}, },
"value": "px", "value": "PX",
"raw": "PX" "raw": "PX"
} }
} }

View File

@ -129,7 +129,7 @@
"end": 20, "end": 20,
"ctxt": 0 "ctxt": 0
}, },
"value": "hz", "value": "Hz",
"raw": "Hz" "raw": "Hz"
} }
} }
@ -178,7 +178,7 @@
"end": 36, "end": 36,
"ctxt": 0 "ctxt": 0
}, },
"value": "khz", "value": "kHz",
"raw": "kHz" "raw": "kHz"
} }
} }

View File

@ -276,7 +276,7 @@
"end": 78, "end": 78,
"ctxt": 0 "ctxt": 0
}, },
"value": "px", "value": "PX",
"raw": "PX" "raw": "PX"
} }
} }
@ -325,7 +325,7 @@
"end": 96, "end": 96,
"ctxt": 0 "ctxt": 0
}, },
"value": "px", "value": "pX",
"raw": "pX" "raw": "pX"
} }
} }

View File

@ -213,7 +213,7 @@
"ctxt": 0 "ctxt": 0
}, },
"start": "0", "start": "0",
"end": "7f", "end": "7F",
"raw": "U+0-7F" "raw": "U+0-7F"
} }
], ],
@ -245,7 +245,7 @@
"ctxt": 0 "ctxt": 0
}, },
"start": "0025", "start": "0025",
"end": "00ff", "end": "00FF",
"raw": "U+0025-00FF" "raw": "U+0025-00FF"
} }
], ],
@ -309,7 +309,7 @@
"ctxt": 0 "ctxt": 0
}, },
"start": "0025", "start": "0025",
"end": "00ff", "end": "00FF",
"raw": "U+0025-00FF" "raw": "U+0025-00FF"
}, },
{ {
@ -360,7 +360,7 @@
"end": 398, "end": 398,
"ctxt": 0 "ctxt": 0
}, },
"start": "a5", "start": "A5",
"end": null, "end": null,
"raw": "U+A5" "raw": "U+A5"
}, },
@ -380,8 +380,8 @@
"end": 411, "end": 411,
"ctxt": 0 "ctxt": 0
}, },
"start": "4e00", "start": "4E00",
"end": "9fff", "end": "9FFF",
"raw": "U+4E00-9FFF" "raw": "U+4E00-9FFF"
}, },
{ {
@ -420,8 +420,8 @@
"end": 432, "end": 432,
"ctxt": 0 "ctxt": 0
}, },
"start": "ff00", "start": "FF00",
"end": "ff9f", "end": "FF9F",
"raw": "U+FF00-FF9F" "raw": "U+FF00-FF9F"
} }
], ],
@ -613,7 +613,7 @@
"ctxt": 0 "ctxt": 0
}, },
"start": "1e1ee1", "start": "1e1ee1",
"end": "ffffff", "end": "FFFFFF",
"raw": "U+1e1ee1-FFFFFF" "raw": "U+1e1ee1-FFFFFF"
} }
], ],

View File

@ -369,7 +369,7 @@
"end": 291, "end": 291,
"ctxt": 0 "ctxt": 0
}, },
"value": "url", "value": "URL",
"raw": "URL" "raw": "URL"
}, },
"value": { "value": {
@ -419,7 +419,7 @@
"end": 346, "end": 346,
"ctxt": 0 "ctxt": 0
}, },
"value": "url", "value": "URL",
"raw": "\\URL" "raw": "\\URL"
}, },
"value": { "value": {
@ -1087,7 +1087,7 @@
"end": 948, "end": 948,
"ctxt": 0 "ctxt": 0
}, },
"value": "src", "value": "SRC",
"raw": "SRC" "raw": "SRC"
}, },
"value": { "value": {

View File

@ -112,7 +112,7 @@
"end": 17, "end": 17,
"ctxt": 0 "ctxt": 0
}, },
"value": "abcd", "value": "ABCD",
"raw": "ABCD" "raw": "ABCD"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "abbbccdd", "value": "ABBBCCDD",
"raw": "ABBBCCDD" "raw": "ABBBCCDD"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbccff", "value": "AABBCCFF",
"raw": "AABBCCFF" "raw": "AABBCCFF"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabcccdd", "value": "AABCCCDD",
"raw": "AABCCCDD" "raw": "AABCCCDD"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 19, "end": 19,
"ctxt": 0 "ctxt": 0
}, },
"value": "abbbcc", "value": "ABBBCC",
"raw": "ABBBCC" "raw": "ABBBCC"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 19, "end": 19,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabccc", "value": "AABCCC",
"raw": "AABCCC" "raw": "AABCCC"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbccde", "value": "AABBCCDE",
"raw": "AABBCCDE" "raw": "AABBCCDE"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbccef", "value": "AABBCCEF",
"raw": "AABBCCEF" "raw": "AABBCCEF"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 17, "end": 17,
"ctxt": 0 "ctxt": 0
}, },
"value": "abcf", "value": "ABCF",
"raw": "ABCF" "raw": "ABCF"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 19, "end": 19,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbcd", "value": "AABBCD",
"raw": "AABBCD" "raw": "AABBCD"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbccdd", "value": "AABBCCDD",
"raw": "AABBCCDD" "raw": "AABBCCDD"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbcdff", "value": "AABBCDFF",
"raw": "AABBCDFF" "raw": "AABBCDFF"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabcccff", "value": "AABCCCFF",
"raw": "AABCCCFF" "raw": "AABCCCFF"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbcddd", "value": "AABBCDDD",
"raw": "AABBCDDD" "raw": "AABBCDDD"
} }
], ],

View File

@ -98,7 +98,7 @@
"end": 11, "end": 11,
"ctxt": 0 "ctxt": 0
}, },
"value": "i", "value": "I",
"raw": "I" "raw": "I"
} }
} }

View File

@ -112,7 +112,7 @@
"end": 19, "end": 19,
"ctxt": 0 "ctxt": 0
}, },
"value": "aabbcc", "value": "AABBCC",
"raw": "AABBCC" "raw": "AABBCC"
} }
], ],

View File

@ -112,7 +112,7 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"value": "abbbccff", "value": "ABBBCCFF",
"raw": "ABBBCCFF" "raw": "ABBBCCFF"
} }
], ],

View File

@ -651,7 +651,7 @@
"end": 234, "end": 234,
"ctxt": 0 "ctxt": 0
}, },
"value": "content", "value": "CONTENT",
"raw": "CONTENT" "raw": "CONTENT"
}, },
"value": [ "value": [
@ -685,7 +685,7 @@
"end": 255, "end": 255,
"ctxt": 0 "ctxt": 0
}, },
"value": "margin-left", "value": "MARGIN-LEFT",
"raw": "MARGIN-LEFT" "raw": "MARGIN-LEFT"
}, },
"value": [ "value": [

View File

@ -55,7 +55,7 @@
"end": 17, "end": 17,
"ctxt": 0 "ctxt": 0
}, },
"value": "display", "value": "DISPLAY",
"raw": "DISPLAY" "raw": "DISPLAY"
}, },
"value": [ "value": [

View File

@ -1181,7 +1181,7 @@
"end": 239, "end": 239,
"ctxt": 0 "ctxt": 0
}, },
"value": "s", "value": "S",
"raw": "S" "raw": "S"
} }
} }

View File

@ -5942,7 +5942,7 @@
"end": 1980, "end": 1980,
"ctxt": 0 "ctxt": 0
}, },
"value": "-ie7", "value": "-IE7",
"raw": "-IE7" "raw": "-IE7"
}, },
"children": null "children": null

View File

@ -456,7 +456,7 @@
"end": 172, "end": 172,
"ctxt": 0 "ctxt": 0
}, },
"value": "blur", "value": "Blur",
"raw": "Blur" "raw": "Blur"
}, },
"value": [ "value": [
@ -608,7 +608,7 @@
"end": 227, "end": 227,
"ctxt": 0 "ctxt": 0
}, },
"value": "wheel", "value": "Wheel",
"raw": "Wheel" "raw": "Wheel"
}, },
"value": [ "value": [

View File

@ -566,7 +566,7 @@ impl VisitMut for CalcReplacer<'_> {
return; return;
} }
let is_calc = n.name == "calc"; let is_calc = n.name.as_str().eq_ignore_ascii_case("calc");
self.inside_calc = is_calc || is_webkit_calc || is_moz_calc; self.inside_calc = is_calc || is_webkit_calc || is_moz_calc;

View File

@ -4,6 +4,6 @@ input:-webkit-autofill {
input:autofill { input:autofill {
border: 3px solid blue; border: 3px solid blue;
} }
input:autofill { input:AUTOFILL {
border: 3px solid blue; border: 3px solid blue;
} }

View File

@ -1,6 +1,6 @@
input:autofill { input:autofill {
border: 3px solid blue; border: 3px solid blue;
} }
input:autofill { input:AUTOFILL {
border: 3px solid blue; border: 3px solid blue;
} }

Some files were not shown because too many files have changed in this diff Show More