UI Deploy

Curated, Short, Web UI Dev we Love.

Exporting breakpoints from CSS to JavaScript with include-media

If you’re using include-media or any other pre-processor library for managing breakpoints in CSS, you probably like the idea of declaring the values once and reference them by name whenever necessary, keeping the code DRY. But when you also need to make decisions based on the viewport dimensions on the JavaScript side, things can get a bit ugly.

view source

Advertisement