Simplify Your Media Queries with Sass “Breakpoint”

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 10

  • @gregscurr
    @gregscurr 10 лет назад

    Awesome, was looking for simple way to get IE8 to understand media queries without js, Thanks for a very good tuts+

  • @crazy2hell
    @crazy2hell 8 лет назад

    Thanks a lot !!

  • @burmeseclips1952
    @burmeseclips1952 7 лет назад

    I love it

  • @damianperez7736
    @damianperez7736 10 лет назад

    This doesn't work properly with .sass files
    when I do:
    +breakpoint(300px)
    .box
    color:red
    it output this:
    @media and (min-width: 300px) {
    .box {
    color: red; }
    }
    The "and" didn''t make it work, so I have to create this mixing:
    //set some variables first
    $mw:min-width
    $phone:300px
    //then the mixing
    =mq($vw,$w)
    @media($vw: $w)
    @content
    //example
    +mq($mw, $phone)
    .box
    color:red
    this is the result now:
    @media(min-width: 300px) {
    .box {
    color: red; }

  • @jinim1983
    @jinim1983 6 лет назад

    I cannot get it to compile, am I missing a step?

  • @emanuelsaramago1039
    @emanuelsaramago1039 10 лет назад

    I think the problem with this method is that the output has a lot of repeating media queries, however, the best practice is to define each media querie only once.

    • @JorenVanHee
      @JorenVanHee 10 лет назад +1

      Hi Emanuel. Thanks for the comment!
      I use gulp-combine-media-queries for that (it also exists for Grunt). Also, it shouldn't be a problem if you gzip your files. Gzip eats repetition for breakfast.

    • @emanuelsaramago1039
      @emanuelsaramago1039 10 лет назад +1

      ***** I did some research and you're right! Good to know. Thanks, Joren!

  • @cryspypotato
    @cryspypotato 10 лет назад

    Having CSS selectors in camel case is something I would never personally encourage to do, good stuff otherwise.

    • @JorenVanHee
      @JorenVanHee 10 лет назад

      Glad you like it. I'm using the Suit CSS naming conventions, that's where the camel case in the class names come from. (github.com/suitcss/suit/blob/master/doc/naming-conventions.md)