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

Add ability to change font size #104

Closed
kopeckyf opened this issue Mar 18, 2021 · 7 comments
Closed

Add ability to change font size #104

kopeckyf opened this issue Mar 18, 2021 · 7 comments
Labels
needs info Needs information to reproduce/better understand the issue question Where a user asks something about usage

Comments

@kopeckyf
Copy link

The default font size is a bit too small for me to read the documentation comfortably. I always find myself zooming the page to about 120-140%. This may be personal preference, of course.

I found some variables for font size, but I was unable to set them with html_theme_options.

The way Alabaster does that seems good to me. There one can do:

html_theme_options = {
   'font-size': '14px'
}

(Other than that, I think that Furo makes for a very good doc reading experience!)

@kopeckyf kopeckyf added the enhancement New feature or request label Mar 18, 2021
@pradyunsg
Copy link
Owner

pradyunsg commented Mar 19, 2021

Hiya! Thanks for filing this issue! ^.^

Furo uses the user's browser's default font size to... well, determine the sizes of everything. The entire theme uses rem units, where 1rem means the font size set on the html tag.

Part of why I've not provided a direct knob for font size controls at the theme level, is because what font size someone needs is not a decision for the theme/documentation author to make IMO. It should be something that the user manages/configures, which in this case would be the browser's default font size (which users can configure).

If Furo isn't respecting that, please provide me with some context (OS, Browser, screen size, default browser font size etc) so that I can reproduce it!

FWIW, if you really want to do this, you can add a tiny bit of CSS ("html {font-size: some-number-here}“) but I'd strongly encourage you to allow this to be configurable on the user's end rather than enforcing this on all the readers of the documentation.

Of course, if you're the primary author and reader of the docs, none of the above applies and you can just set the font size as suggested above. :)

@pradyunsg pradyunsg added the needs info Needs information to reproduce/better understand the issue label Mar 19, 2021
@kopeckyf
Copy link
Author

Right, this makes sense. I may have looked at it from the wrong angle, since users who are zooming into Furo-themed pages probably are also zooming into other web pages, and so they should change their configuration globally.

@kopeckyf
Copy link
Author

Mh, one question though on the font size in admonitions (these look very appealing in your theme, btw): Have you considered enlarging the font size in them to be of the same size as the main text? I think admonitions are often used for important content, and then it seems counter-intuitive to me to have them in a smaller font compared to the rest of the text.

@pradyunsg
Copy link
Owner

pradyunsg commented Mar 20, 2021

It's essentially an opinionated design choice, and there's a knob for it too -- admonitions are supposed to be side content, something that's an aside from the regular text in the document. At the same size as the rest of the page, they look significantly more eye catching and distract the content's flow way more than I'd like.

I looked around and there seemed to be an even split in how they're handled, and I picked the approach that mkdocs-material takes on that front; since that's where I borrowed the admonitions' design from. :)

@pradyunsg pradyunsg added question Where a user asks something about usage and removed enhancement New feature or request labels Mar 20, 2021
@kopeckyf
Copy link
Author

Thanks, @pradyunsg! I updated the font sizes using

html_theme_options = {
    "light_css_variables": {
        "admonition-font-size": "92%",
        "admonition-title-font-size": "92%"
        }
}

Now that I tried it, I agree that a font size of 100% would be too big even if admonitions are used for important content.

(I wasn't sure whether it would be OK to close this issue since you added some tags to it)

@pradyunsg
Copy link
Owner

Awesome! Glad we're on the same page on that!

And also that you were able to figure out how this theme's configuration works! ^.^

@madjxatw
Copy link

madjxatw commented Oct 4, 2021

These options don't seem to be mentioned in the doucmentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Needs information to reproduce/better understand the issue question Where a user asks something about usage
Projects
None yet
Development

No branches or pull requests

3 participants