Shopify Font 的用法
示例代码1
{%- comment -%}Style 字体{%- endcomment -%}
{%- liquid
style
assign var_fonts = 'body-font,header-font' | split: ','
assign font_handles = 'type_body_font,type_header_font' | split: ','
assign weights = '100,200,300,400,500,600,700,900' | split: ','
for font_handle in font_handles
assign font = settings[font_handle]
for weight in weights
echo font | font_modify: 'weight', weight | font_face: s: 'swap'
endfor
echo ":root {--" | append: var_fonts[forloop.index0] | append: ":" | append: font.family | append: ';}'
endfor
endstyle
-%}