Skip to content

Commit

Permalink
Kazuhiro-Mimaki/media-feature-name-no-unknown: add example case
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazuhiro-Mimaki committed May 7, 2024
1 parent ab12668 commit e4a7b8d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ declare_rule! {
/// @media (400px <= width <= 700px) {}
/// ```
///
/// ```css
/// @media screen and (-webkit-width > 320px) {}
/// ```
///
pub NoUnknownMediaFeatureName {
version: "next",
name: "noUnknownMediaFeatureName",
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_css_analyze/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub fn is_media_feature_name(prop: &str) -> bool {
}
for prefix in VENDER_PREFIXES.iter() {
for feature_name in MEDIA_FEATURE_NAMES.iter() {
if input == format!("{}-{}", prefix, feature_name) {
if input == format!("{}{}", prefix, feature_name) {
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
@media screen and (min-width: 320px) {
}

@media screen and (-webkit-min-width: 320px) {
}

@media only screen and (min-width: 320px) and (max-width: 480px) and (resolution: 150dpi) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ expression: valid.css
@media screen and (min-width: 320px) {
}
@media screen and (-webkit-min-width: 320px) {
}
@media only screen and (min-width: 320px) and (max-width: 480px) and (resolution: 150dpi) {
}
Expand Down

0 comments on commit e4a7b8d

Please sign in to comment.