DEV Community

Discussion on: JSSheet - A javascript to css parser

Collapse
 
nicolalc profile image
Nicola

I'm still thinking about a solution.
The first idea in my mind is the following:

Add a mediaQuery property for an object:

{
  [...]
  mediaQuery: [
    selector: 'screen and (max-width: 600px)',
    ...props
  ]
}

So this will render a @media rule for each object.

What do you think about this proposal?

Another solution is to create a separate jss file (e.g. body-600.js) wich defines the media query for the body partial.