premailer / css_parser

Ruby CSS Parser
Other
279 stars 110 forks source link

[question] How to filter by media query #96

Open JonathanKolnik opened 6 years ago

JonathanKolnik commented 6 years ago

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)")
 => []