Search code examples
htmlcssgridmedia-queries

How can I get my CSS code more efficient?


I got a lot of repeating CSS conditions (with only numerical differences) in my CSS file. I'm wondering how I can make it have less conditions?

ps. I know LESS or SASS can make it easier, but it will still generate the same amount of CSS in the end.

FIND CSS HERE

Any other feedback is also welcome!


Solution

  • There isn't really much you can do. In the end the browser will interpret the css as it is looking in your file.

    You could do the following though:

    1.Group selectors together. This may affect the readability and structure of your css.

    .row div.gutter-lg-10,.row div.gutter-md-10 { padding-right: 10px; }
    

    2.You can minify your css for production which will save you some bandwidth.