Skip to content

Commit

Permalink
feat(site): separate variable for whole google Font url
Browse files Browse the repository at this point in the history
This PR simplifies a possible need to import multiple google fonts, so one only needs to change 1 variable @googlefonts
I also put the import url into a separate variable so even the whole url could be changed by only one variable (perhaps needed to use together with googles css2. See #2895 (comment) )

The change is completely backward compatible
  • Loading branch information
lubber-de committed Sep 4, 2023
1 parent bc1849c commit c9f9dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/theme.less
Expand Up @@ -63,7 +63,7 @@

.loadFonts() {
& when (@importGoogleFonts) {
@import (css) url("@{googleProtocol}fonts.googleapis.com/css2?family=@{googleFontRequest}");
@import (css) url("@{googleFontUrl}");
}
& when (@importFonts) and not (@fontName = "") {
each(@fonts, {
Expand Down
4 changes: 3 additions & 1 deletion src/themes/default/globals/site.variables
Expand Up @@ -123,7 +123,9 @@
@googleFontDisplay: "swap";

@googleProtocol: "https://";
@googleFontRequest: "@{googleFontName}:@{googleFontSizes}&subset=@{googleSubset}&display=@{googleFontDisplay}";
@googleFonts: "@{googleFontName}:@{googleFontSizes}";
@googleFontRequest: "@{googleFonts}&subset=@{googleSubset}&display=@{googleFontDisplay}";
@googleFontUrl: "@{googleProtocol}fonts.googleapis.com/css2?family=@{googleFontRequest}";

@bold: bold;
@normal: normal;
Expand Down

0 comments on commit c9f9dea

Please sign in to comment.