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

Relative Font Size #2610

Closed
acnorrisuk opened this issue Aug 30, 2017 · 5 comments
Closed

Relative Font Size #2610

acnorrisuk opened this issue Aug 30, 2017 · 5 comments
Labels
Customization Issues related to Phase 2: Customization efforts [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor.

Comments

@acnorrisuk
Copy link

acnorrisuk commented Aug 30, 2017

Issue Overview

In the current version of Gutenberg (1.0.0) changing the font-setting in the paragraph block results in a specific pixel size being set. This will cause issues on smaller screens as any media queries set by a theme author won't have any effect on the font-size.

A better approach would be to set the font-size in ems or rems which would allow the font-size to scale based on the theme author's styling.

@aduth aduth added Design [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor. labels Aug 30, 2017
@iamgabrielma
Copy link
Contributor

This seems to be coming from here:

font-size: $editor-font-size;
, as takes $editor-font-size: 16px; from _variables.scss file, and only affects "paragraph", any other block is unaffected and em applies automatically instead of px.

Changing that line from font-size: $editor-font-size; to font-size: 1em; fixes the issue, but I'm not sure if this is the right way to go about this, or is better to create another variable on _variables.scss for this.

Example:
screen shot 2017-09-03 at 13 57 00

@ellatrix
Copy link
Member

ellatrix commented Sep 23, 2017

I agree with the general issue here. If the user's intention is to have slightly bigger or smaller text, and one switches themes or devices, the pixel is not a great unit of measurement. I'd rather see a control where the default is 1 and you can change the magnitude relative to the paragraph's font-size. Not sure how that is done best in CSS. em is not great as it's relative to the parent, whereas we want it to be relative to the normal paragraph size. rem is not great for the same reason.

@gonzomir
Copy link
Contributor

gonzomir commented Oct 6, 2017

I just found out that even without touching the font size setting on paragraphs all <p> tags in the output contain inline style with font-size: 16px;. I can't stress how wrong is that, this completely ruins the typography of the theme I'm testing on. The font size setting should not use pixels, but relative sizes like small, normal, medium, big, large, huge, applied with classes, so that themes can overwrite the exact font size according the their typographic scale.

@notnownikki
Copy link
Member

Would it be acceptable to have an inner span with the style on it? Then it would pick up the pixel size from the parent paragraph.

Example of what I mean here: http://notnownikki.com/size.html

@mtias mtias added the Customization Issues related to Phase 2: Customization efforts label Oct 27, 2017
@karmatosed
Copy link
Member

karmatosed commented Jan 4, 2018

There is exploration of different fonts happening in #2782 and I think it's ok to focus on that for now. We can always reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customization Issues related to Phase 2: Customization efforts [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

9 participants