Media query – breakpoints

Creating breakpoints for @media query using @mixin scss.

Breakpoints: (1rem = 16px)

  • 576px = 36em;
  • 768px = 48em;
  • 992px = 62em;
  • 1200px = 75em;

SCSS code

$media-queries-up: (
    small: (
        "breakpoint": '(min-width: 36em)',
    medium: (
        "breakpoint": '(min-width: 48em)',
    large: (
        "breakpoint": '(min-width: 62em)',
    xlarge: (
        "breakpoint": '(min-width: 75em)',

@mixin media-query-up ($size) {
    @each $item, $value in $media-queries-up {
        @if $item == $size {
            @if map-get($value, "breakpoint") != null {
                @media only screen and #{map-get($value, "breakpoint")} {
}//mixin media-query
p {
    background-color: $color_2;
    color: color.complement($color-2);
    font-size: 0.8rem;
    padding: 0.4em;
@include media-query-up(medium) {
    p {
        background-color: $color-5;
        color: color.complement($color-5);
        font-size: 1rem;
@include media-query-up(large) {
    p {
        background-color: $color-3;
        color: color.complement($color-3);
        font-size: 1.2rem;
@include media-query-up(xlarge) {
    p {
        background-color: $color-10;
        color: color.complement($color-10);
        font-size: 1.4rem;

CSS code

p {


I bet my nine lives on you-oooo-ooo-hooo lick face hiss at owner, pee a lot, and meow repeatedly scratch at fence purrrrrr eat muffins and poutine until owner comes back, yet meow meow, and nap all day lick the curtain just to be annoying but love you, then bite you sleeps on my head. do not try to mix old food with new one to fool me! meow meow, i tell my human so i like frogs and 0 gravity yet

HTML code

<p>I bet my nine lives on you-oooo-ooo-hooo lick face hiss at owner...</p>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.