-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support all descre media queries, add some webkit prefixes, and other…
… stuff
- Loading branch information
Showing
116 changed files
with
1,210 additions
and
877 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::macros::discrete_media_feature; | ||
|
||
discrete_media_feature!(AnyHoverMediaFeature[atom!("any-hover")] { | ||
None: atom!("none"), | ||
Hover: atom!("hover"), | ||
}); | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use crate::test_helpers::*; | ||
|
||
#[test] | ||
fn size_test() { | ||
assert_size!(AnyHoverMediaFeature, 1); | ||
} | ||
|
||
#[test] | ||
fn test_writes() { | ||
assert_parse!(AnyHoverMediaFeature, "any-hover"); | ||
assert_parse!(AnyHoverMediaFeature, "any-hover: hover"); | ||
assert_parse!(AnyHoverMediaFeature, "any-hover: none"); | ||
} | ||
|
||
#[test] | ||
fn test_minify() { | ||
assert_minify!(AnyHoverMediaFeature, "any-hover: hover", "any-hover:hover"); | ||
assert_minify!(AnyHoverMediaFeature, "any-hover: none", "any-hover:none"); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
crates/hdx_ast/src/css/rules/media/features/any_pointer.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use crate::macros::discrete_media_feature; | ||
|
||
discrete_media_feature!(AnyPointerMediaFeature[atom!("any-pointer")] { | ||
None: atom!("none"), | ||
Coarse: atom!("coarse"), | ||
Fine: atom!("fine"), | ||
}); | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use crate::test_helpers::*; | ||
|
||
#[test] | ||
fn size_test() { | ||
assert_size!(AnyPointerMediaFeature, 1); | ||
} | ||
|
||
#[test] | ||
fn test_writes() { | ||
assert_parse!(AnyPointerMediaFeature, "any-pointer"); | ||
assert_parse!(AnyPointerMediaFeature, "any-pointer: none"); | ||
assert_parse!(AnyPointerMediaFeature, "any-pointer: coarse"); | ||
assert_parse!(AnyPointerMediaFeature, "any-pointer: fine"); | ||
} | ||
|
||
#[test] | ||
fn test_minify() { | ||
assert_minify!(AnyPointerMediaFeature, "any-pointer", "any-pointer"); | ||
assert_minify!(AnyPointerMediaFeature, "any-pointer: none", "any-pointer:none"); | ||
assert_minify!(AnyPointerMediaFeature, "any-pointer: coarse", "any-pointer:coarse"); | ||
assert_minify!(AnyPointerMediaFeature, "any-pointer: fine", "any-pointer:fine"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
crates/hdx_ast/src/css/rules/media/features/color_gamut.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use crate::macros::discrete_media_feature; | ||
|
||
discrete_media_feature!(ColorGamutMediaFeature[atom!("color-gamut")] { | ||
Srgb: atom!("srgb"), | ||
P3: atom!("p3"), | ||
Rec2020: atom!("rec2020"), | ||
}); | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use crate::test_helpers::*; | ||
|
||
#[test] | ||
fn size_test() { | ||
assert_size!(ColorGamutMediaFeature, 1); | ||
} | ||
|
||
#[test] | ||
fn test_writes() { | ||
assert_parse!(ColorGamutMediaFeature, "color-gamut"); | ||
assert_parse!(ColorGamutMediaFeature, "color-gamut: srgb"); | ||
assert_parse!(ColorGamutMediaFeature, "color-gamut: p3"); | ||
assert_parse!(ColorGamutMediaFeature, "color-gamut: rec2020"); | ||
} | ||
|
||
#[test] | ||
fn test_minify() { | ||
assert_minify!(ColorGamutMediaFeature, "color-gamut: srgb", "color-gamut:srgb"); | ||
assert_minify!(ColorGamutMediaFeature, "color-gamut: p3", "color-gamut:p3"); | ||
assert_minify!(ColorGamutMediaFeature, "color-gamut: rec2020", "color-gamut:rec2020"); | ||
} | ||
|
||
#[test] | ||
fn test_errors() { | ||
assert_parse_error!(ColorGamutMediaFeature, "color-gamut:"); | ||
assert_parse_error!(ColorGamutMediaFeature, "color-gamut: pointer"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.