Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for media-query scoped properties #337

Open
pgregorova opened this issue Feb 7, 2018 · 1 comment
Open

Support for media-query scoped properties #337

pgregorova opened this issue Feb 7, 2018 · 1 comment
Assignees

Comments

@pgregorova
Copy link
Member

it would be nice to be able to separate logic from design by using dynamic variables, where we set the variables and change its value as desired within breakpoint within :root.

Expected Behavior

:root { --fontSize: 2rem; }

@media (min-width: 64rem) {
   :root { --font-size: 3rem; }
}

Current Behavior

Currently it's impossible change value for a variable in :root, which is wrapped within media query. It simply throws errors and doesn't compile. Similar issue has been also reported in PostCSS's issue ticket related to custom properties, where you can see more examples.

Steps to Reproduce (for bugs)

You can use my codepen for responsive table, where I was testing it just using PostCSS, no CSSNext and it works like a charm.

@drolsen
Copy link
Member

drolsen commented Feb 8, 2018

@pgregorova just for a context sake, did the following approach fail too for you?

:root { 
    --fontSize: 2rem; 
    @media (min-width: 64rem) {
        --font-size: 3rem;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants