My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do you structure your media queries?

Ozzie Neher's photo
Ozzie Neher
·Nov 3, 2016

Specifically when you're using a preprocessor.

These are two common ways I've personally done it. How are you doing it?

.foo {
    width: 100%;
}

.bar {
    border-color: red;
}

@media screen and (min-width: 768px) {
    .foo {
        width: 50%;
    }
    .bar {
       border-color: green;
    }
}

and

.foo {
    width: 100%;

    @media screen and (min-width: 768px) {
        width: 50%;
    }
}