Skip to content

Commit 98e4370

Browse files
authored
Update shell.handlebars font backward
Explanation of Changes Backward Compatibility: The font_custom variable is checked to see if it is an array. If not, it is converted to an array using the array helper function. Handling Multiple Fonts: The rest of the logic remains the same to handle multiple fonts and generate the necessary @font-face rules and CSS variables. This approach ensures that the code works correctly whether font_custom is passed as a single string or as a list, maintaining backward compatibility.
1 parent 15b3766 commit 98e4370

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sqlpage/templates/shell.handlebars

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
{{/if}}
1717
{{/each}}
1818

19+
{{!-- Ensure font_custom is an array --}}
20+
{{#if font_custom}}
21+
{{#if (not (isArray font_custom))}}
22+
{{!-- Wrap single font string in an array --}}
23+
{{#set "font_custom" (array font_custom)}}
24+
{{/if}}
25+
{{/if}}
26+
1927
{{#if font_custom}}
2028
<style>
2129
{{#each font_custom}}

0 commit comments

Comments
 (0)