Wednesday 10 December 2014

Responsive Design: Include @media queries as mixins using LESS

I have to includ the @media queries as a seperate file and sections before.
That was very circumstantial and took a long time to find and redefine each elemnt to display properly on Mobile Devices.

Since LESS has included the support of mixins, it is very comfortable to define such queries.

All you need is:

  1. Define your preferred Breakpoints as Variables 
  2. Include the queries inside the main element 
Sample:


Step 1: Define your preferred Breakpoints as Variables


Step 2: Include the queries inside the main element