[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)
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'}, ]
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.
Issue #1888
[Question] Add custom html inside canvas
Hi there, I'm using grapes to export a custom json with all the information i need, instead of HTML and CSS. For doing that I'm parsing the...
Issue #1499
[Question] Is it possible to perform dom manipulation through the block's contents script?
Hey! First of all thank you so much to build such a great and versatile tool. Is it possible that I can manipulate the dom elements of the...
Issue #930
[Question] Update resizer after asset changed
Hi! I trying to change default assets manager with ours custom manager. On double click the selected image is replaced with a new one with...
Issue #1882
[QUESTION] Dynamically changing Trait Properties
Hi, I went through the other questions posted here and could not get it to work. All I need to do is to access a specific trait of a specif...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.