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

rule within media query not overriding other rule #52

Open
jmlee2k opened this issue May 15, 2015 · 2 comments
Open

rule within media query not overriding other rule #52

jmlee2k opened this issue May 15, 2015 · 2 comments

Comments

@jmlee2k
Copy link

jmlee2k commented May 15, 2015

First of all, thanks a TON for this! It definitely spared me at least a couple grey hairs.

Not sure if this is a bug or not, but I thought I would mention it here in case anyone runs into it. If you have a standard rule, something like:

.sidebar
{
    flex-basis: 80vmax;
}

and a rule within a media query which overrides it:

@media all and (orientation:portrait)
{
    .sidebar
    {
        flex-basis: auto;
    }
}

the "auto" won't take effect when the media query is active. In this case, the easy workaround is to just specify both flex-basis values in their own media queries as follows:

@media all and (orientation:landscape)
{
    .sidebar
    {
        flex-basis: 80vmax;
    }
}

@media all and (orientation:portrait)
{
    .sidebar
    {
        flex-basis: auto;
    }
}

Again, thanks a lot to everyone that's worked on this, and I hope this helps out!

@rodneyrehm
Copy link
Owner

The problem is that you're overwriting a vp-unit with something that is not a vp-unit. what's not a vp-unit is ignored by the buggyfill, so you never get the override. Making your CSS conditional removes the need to overwrite it, so it's not a problem to begin with.

This looks like a duplicate of #13

@jmlee2k
Copy link
Author

jmlee2k commented May 15, 2015

Yeah, I didn't really think it was a problem, I just wanted to mention it in case anyone ran into it.

Thanks!

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