zachleat’s avatarzachleat’s Twitter Archive—№ 25,506

  1. SASS users: Do you ever nest @​media queries inside of a @​mixin?
    1. …in reply to @zachleat
      Y’all might be interested to learn a few things about SASS output. First, SASS will output (min-width: 1200px) and (min-width: 400px) which *should* only apply at 1200px+. But IE11 applies it at 400px+ which is a bug! If min|max-width + and conflicts, it uses the last one
      oh my god twitter doesn’t include alt text from images in their API
      1. …in reply to @zachleat
        Second, SASS will output (min-width: 1200px) and (max-width: 400px), which should never apply. It’s wasted bytes. And no CSS minifier that I found would remove this wasted code.
        oh my god twitter doesn’t include alt text from images in their API
        1. …in reply to @zachleat
          This is all code that you would never write by hand but you could very easily fall into a tool (like SASS, less, et al) generating it. (it me)
          1. …in reply to @zachleat
            I wrote a quick @PostCSS plugin to work around these issues (I wanted something that worked independent of SASS) and normalize/simplify/remove these @​media queries. It will solve the above problems, hope it’s useful to you! github.com/filamentgroup/postcss-media-query-optimizer/