font_modify
Modifies a specific property of a font object and returns a new font object.
Supported Properties & Values
| Property | Valid Values | Description |
|---|---|---|
style | "normal" | Converts the font to its regular (non-italic) variant. |
"italic" | Converts the font to its italic variant (if available). | |
"oblique" | Converts the font to its oblique variant (SHOPLINE fonts typically offer either italic or oblique, not both). | |
weight | 100–900 (in 100-unit steps) | Adjusts the font weight to the specified value (e.g., 400 for normal, 700 for bold). |
"normal" | Shortcut for weight: 400. | |
"bold" | Shortcut for weight: 700. | |
"+/-N" (e.g., "+200") | Increases/decreases the current weight by N (e.g., 400 → 600 with "+200"). | |
"lighter" | Reduces weight using CSS fallback rules (e.g., 700 → 400). | |
"bolder" | Increases weight using CSS fallback rules (e.g., 400 → 700). |
font | font_modify(key, value) returns string
Params
-
fontfont: A font object. -
keystring: Property to modify. -
valuestring: New value for the property.
Example
Original weight: {{ settings.sort_title_font.weight }}
{{#var lighterFont = settings.sort_title_font | font_modify("weight", "lighter") /}}
h2 {
font-weight: {{ lighterFont.weight }};
}
Was this article helpful to you?