css_parser icon indicating copy to clipboard operation
css_parser copied to clipboard

[question] How to filter by media query

Open JonathanKolnik opened this issue 8 years ago • 0 comments

Hi, I'm struggling to filter by a media type. Any help would be greatly appreciated!

CSS

@media (max-width: 767px) {
  h1 {
    font-size: 12px
  }
}

Console: It has the media query

parser.rules_by_media_query.keys
 => [:all, :print,  :"(max-width:767px)", ...]

I can't figure out the syntax to filter by that media type though

#symbol
parser.find_by_selector("h1", :"(max-width:767px)")
 => []

#string
parser.find_by_selector("h1", "(max-width:767px)")
 => []

JonathanKolnik avatar Jan 29 '18 21:01 JonathanKolnik