Documentation
Ctrl+K
Changing Fonts
This are in string.-
body_font_family
- for font style of body"body_font_family": "Inter",
-
heading_font_family
- for font style of heading"heading_font_family": "Inter",
There are two ways you can change the setting of your fonts:
With the use of live customizer
You can work on fonts using Live Customizer in three different ways:
-
You can change the font-size and font-family with the property name and its value here by declaring property name and its values in
gulp.config.json
file.- This is the example ofgulp.config.json
file."options":{ "saveLocal": "sessionStorage", "storeKey": "huisetting", "setting":{ "app_name": { "value" : "Hope UI" }, "theme_font_size": {"value": "theme-fs-md"}, "body_font_family": {"value" : null}, "heading_font_family": {"value" : null} } },
-
Go to the live customizer and click on the
'Copy Config'
button available at the top-right to copy the json file from the setting panel. Paste the copied code in theIQSetting(setting_options)
at thesetting-init.js
file.-Before
let setting_options = document.querySelector('meta[name="setting_options"]') setting_options = JSON.parse(setting_options.getAttribute('content')) const setting = window.IQSetting = new IQSetting(setting_options);
-After
let setting_options = document.querySelector('meta[name="setting_options"]') setting_options = JSON.parse(setting_options.getAttribute('content')) const setting = window.IQSetting = new IQSetting({ "saveLocal": "sessionStorage", "storeKey": "huisetting", "setting": { "app_name": {"value": "Hope UI"}, "theme_font_size": {"value": "theme-fs-md"}, "body_font_family": {"value" : null}, "heading_font_family": {"value" : null} } });
-
You can change the font by adding property name and its values in the
<meta>
tag given in<head>
section.- This is the example of<meta>
data<head> <meta name="setting_options" content="{ "saveLocal":"sessionStorage", "storeKey":"huisetting", "setting":{ "app_name":{"value":"Hope UI"}, "theme_font_size": {"value": "theme-fs-md"}, "body_font_family": {"value" : null}, "heading_font_family": {"value" : null} } }> </head>
Manual
You can change the fonts with a single action.
-
By adding some
classes
in html tag. Example is given below.
Font Size
If you wish to change the font size, you can follow the below action.
For example you have to set font size as
small
then you will have to addtheme-fs-sm
class athtml
tag.- For font size as small<html .... class="theme-fs-sm"> ....... </html>
- For font size as medium<html .... class="theme-fs-md"> ....... </html>
- For font size as large<html .... class="theme-fs-lg"> ....... </html>
Font Family
If you wish to change the font family, you can follow the below action.
For example you have to set font family of body as
inter
and font-family of heading asinter
then you will have to add--bs-heading-font-family:"Inter", sans-serif; --bs-body-font-family:Inter;
style athtml
tag.- For font family of body and font family of heading as inter<html .... style="--bs-heading-font-family:"Inter", sans-serif; --bs-body-font-family:Inter;"> ....... </html>
-
By adding some