Issue #900Opened February 26, 2018by chthomos3 reactions

[QUESTION] Apply styles to all media queries

Question

Again, congratulations on the great job. We have heavily extended Grapes and we managed to add almost all the functionality we need.

We plan to use it for mobile first pages. So we have set up the Device manager to default to "Mobile Portrait". Styling is done through classes, and we have extended all components to create a new class when being added on the canvas. This suits us and so far it works great.

Yet, when a style is changed on a class, only the media query for @media (max-width:480px) is changed. Thus, the user may have to repeat the same changes for other media queries (or the main CSS). How can we control this behaviour. Can we define which style properties are set up on the non media query based CSS and which are set up on the media query ones?

Or if this is quite complex, can we make the CSS mobile first? Ie: change the break points so that css is formed like this

-Non media query css

  • @media (min-width:481px)
  • @media (min-width:993px)

This way the "primary css" is set up for mobile and overrides take place in Tablet and Mobile

Thnx again!

Answers (2)

chthomosMarch 1, 20183 reactions

I figured out how to make it mobile first and it solves my issue for now:

Set the editor config.mediaCondition: 'min-width'

and on deviceManager: [ {name: 'Mobile portrait', width:'320px',widthMedia:'0px'} {name: 'Tablet', width:'568px',widthMedia:'320px'}, {name: 'Desktop', width:'568px',widthMedia:'768px'}, ]

lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.