DEV Community

Discussion on: How do you structure your css (media queries)?

Collapse
 
ohadbaehr profile image
OhadBaehr • Edited

adopting a css preprocessor can help greatly with ordering as it enables for hierarchy,
it will look something like this:

.main-container{
    background:blue;
    .inner-class{
        width:30px
        height:30px
    }
}

it also enables for other epic stuff, like functions, math operations, mixin and more
personally I'm using less, you can find out more at:
lesscss.org/

personally, I'm trying to avoid using media queries as much as possible, also, using variables can also help alot if you are overwriting