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

Responsive typography + line height? #31

Closed
DanielPintilei opened this issue Jan 22, 2016 · 8 comments
Closed

Responsive typography + line height? #31

DanielPintilei opened this issue Jan 22, 2016 · 8 comments
Labels

Comments

@DanielPintilei
Copy link

Would it be a good idea?
Something like:

html {
    font-size: responsive 12px/1.4 21px/1.8;
}

or

html {
    line-height: responsive 1.4 1.8;
}

Unitless line height is fine, but if you want to set a specific line height for a specific font range, you have to do it without Rucksack, the result being unnecessary multiple media queries.
I guess it wouldn't work just by adding the line height along font size, since that would result in line heights like 1.4654643?

@madeleineostoja
Copy link
Owner

How you'd do this is have Rucksack parse font: declarations, where you can define font-size/line-height shorthand.

Though I'm not sure what you're trying to achieve. By definition unitless line height is 'responsive'. Are there certain points where you want a different line height unit? How would rucksack know this?

@DanielPintilei
Copy link
Author

Yes, I was talking about

certain points where you want a different line height unit

That's why I said that unitless line height works fine. But if you want to get artsy with the line height, rucksack can't help you.
like when your
font-size is 12px you want your line height to be 1.4
and when it's 21px, line height 1.8

How would rucksack know this?

By using something like

html {
font: responsive 12px/1.4 21px/1.8;
}

or

html {
line-height: responsive 1.4 1.8;

}

I guess

@madeleineostoja
Copy link
Owner

Seems the font shorthand processing wouldn't work because of this bug in Firefox. So the only option would be to add a new feature to postcss-responsive-type to parse line-height properties with the same logic. I probably don't have the time for this right now, and not sure if there's enough demand for it at the moment. But would probably welcome a PR if anyone's keen.

@madeleineostoja
Copy link
Owner

This feature has been added upstream in postcss-responsive-type. Just needs documentation.

@yocontra
Copy link

yocontra commented Oct 5, 2016

Any chance somebody can update the postcss-responsive-type dependency so we can start using this feature?

@madeleineostoja
Copy link
Owner

madeleineostoja commented Nov 25, 2016

@contra sorry missed this, will bump it now and release a new version

@kodekoder
Copy link

So, is there a fix or not? I have issue with Firefox - Responsive doesn't work like it should!

@madeleineostoja
Copy link
Owner

This was released in the linked commit, you can use responsive line heights with new line height declarations

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

No branches or pull requests

4 participants