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

em units are not working #17

Open
perrin4869 opened this issue Jun 7, 2016 · 5 comments · Fixed by #19
Open

em units are not working #17

perrin4869 opened this issue Jun 7, 2016 · 5 comments · Fixed by #19

Comments

@perrin4869
Copy link
Contributor

I reproduced the problem here: https://github.com/perrin4869/responsive_type_test

I am getting the warning this combination of units is not supported [postcss-responsive-type] while attempting to process the following:

div {
    font-size: responsive 1.2em 1.4em;
}
@perrin4869
Copy link
Contributor Author

OK, I figured out why this is impossible to do... might need some documentation for other people to avoid confusion maybe?

@madeleineostoja
Copy link
Owner

madeleineostoja commented Jun 11, 2016

Yep the exact combination of units that can be used needs to be documented somewhere. You can use em units for sizing, you just have to use them for the range as well

div {
  font-size: responsive 1.2em 1.4em;
  font-range: 26em 80em;
}

@perrin4869
Copy link
Contributor Author

Wait, actually, there's something I am failing to understand. Why can't:

.foo {
  font-size: responsive 3rem 6rem;
  font-range: 420px 1280px;
}

be converted simply to:

.foo {
  font-size: calc(3rem + 3 * ((100vw - 420px) / 860));
}

@media screen and (min-width: 1280px) {
  .foo {
    font-size: 6rem;
  }
}

@media screen and (max-width: 420px) {
  .foo {
    font-size: 3rem;
  }
}

@madeleineostoja
Copy link
Owner

there was definitely a reason for this, but it's been quite a while since I've worked on this repo and can't remember what it was for the life of me. I'll do a bit of digging...

@ackushiw
Copy link

I found a work around here:
#30 (comment)

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

Successfully merging a pull request may close this issue.

3 participants