Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Does not support REM units in media queries #62

Closed
ghost opened this issue Oct 8, 2015 · 3 comments
Closed

Does not support REM units in media queries #62

ghost opened this issue Oct 8, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 8, 2015

Like it says in the general.css, media queries like

@media screen and (min-width: 480px) {
    p {
        font-size: 10rem;
    }
    .test {
        background-color: red;
        border: 1px solid yellow;
        font-size: 3rem;
    }
}

are not supported. Does this mean in my stylesheet that if I use media queries based on REM units I will have to make a separate stylesheet for IE8 and there use PX units for my media queries?

Is there a way to tell REM.js to accept REM units in media queries perhaps?
Would love to be able to use REM.js with something like below.

@media screen and (min-width: 30rem) {
    p {
        font-size: 10rem;
    }
    .test {
        background-color: red;
        border: 1px solid yellow;
        font-size: 3rem;
    }
}

If that is not possibly I assume it was a wanted decision to not support REM units in media queries. If so I would like to hear why those have been left out, apparently with a purpose. Curious to what that purpose is. Perhaps that can help me understand better.

If you can just let me know if or why REM units in media queries are not supported that would be great.

Thank you for your time and help.

@ghost
Copy link
Author

ghost commented Oct 10, 2015

I have not checked the closed tickets. Duh!

Though reading the closed tickets and in particular the discussion about media queries I am not entirely sure I understand everything that has been said. MQ support was there and has been abandoned? If so where is the version of the REM polyfill that did support MQs?

In particular I don't understand this post: #60 (comment)

What do you mean with "but the decision was made awhile ago to ignore MQ rules when the polyfill was kicked in"? So the "polyfill kicked in" means it was created(?) and then you decided to not have MQ support because it is only needed on desktop? What about those users that do not have their browser open full screen but half or a third? Make those scroll the horizontal scrollbar to see content?

So yeah if you could clarify to let me know if there is a version out there supporting REM units in MQs that would be great.

If by any chance you have an idea how to support MQs with REM units (separate stylesheet with MQ in PX for IE8 and lower?) in IE8 I am all ears.

Thank you.

@chuckcarpenter
Copy link
Owner

@monolux the short version of it is that we decided not to support rem values in a MQ is because browsers that do not support rem values, also do not support MQs. Therein, it's not really within the scope of this polyfill to provide support for a MQ. There's no version of it that has MQ support, outside of ignoring values within them.

@ghost
Copy link
Author

ghost commented Nov 10, 2015

Thank you for your reply. Using Respond for media queries and this polyfill for rem values alongside Shiv, all working fine down to ie8 and lower possibly. Respond and Shiv are kinda so widely spread I thought this would close the circle and also make it support rem inside mqs. But hey great nonetheless and very useful!

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

No branches or pull requests

1 participant