HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.19k stars 2.9k forks source link

direct settings of font size in custom fonts #1632

Closed qiushiyan closed 4 years ago

qiushiyan commented 4 years ago

For custom fonts in data/fonts/custom.toml, can you include a direct way to adjust font size in correspondence to the font_size option in config/_default/params.toml without css, such as providing keys like font_size_extraS, font_size_small, font_size_medium, font_size_large and font_size_extraL in data/fonts/custom.toml? To my mind the current font_size and font_size_small doesn't work in a very intuitive way.

Thanks for your time!

gcushen commented 4 years ago

I think you are referring to an old version of Academic? Font size is no longer defined by the font theme author in the font theme, but by the site admin in the site's params.toml. Here's an example of a current font theme, https://github.com/gcushen/hugo-academic/blob/master/data/fonts/minimal.toml

qiushiyan commented 4 years ago

I mean that while I can, say, specifiy font_size = "L" in params.toml, it would nice to directly set a size for the large font by adding additional parameters, for example font_large = 20px, font_extra_small = 10px. And I think an ideal place to place such parameters would be in the custom font folder data/fonts/custom.toml

gcushen commented 4 years ago

Thanks for the suggestion, but there are some important points to consider here:

  1. The Font Theme defines the style of font rather than the size and is defined by a theme author rather than site admin. Those are 2 different roles. A font theme author should not impose on site admins and end users a specific font size.
  2. We already provide 5 popular options for font size - it's a very niche requirement to add support for more sizes
  3. It's only ~1 line of CSS to add to your custom.scss if you don't like any of the built-in font sizes
  4. The optimal font size is really something that is specific to each visitor, and controlled via the browser, rather than just the site admin