From 21e52c5867cc592144599f05683c9b9492e67d66 Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Thu, 8 Aug 2024 11:42:05 +0200 Subject: [PATCH] Add "PT Sans" and sans-serif as fallback font-family --- sass/_archives.scss | 2 +- sass/_event.scss | 4 +-- sass/_fonts.scss | 56 -------------------------------------- sass/_header.scss | 2 +- sass/_layout.scss | 4 +-- sass/_themes.scss | 6 ++-- sass/_typography.scss | 20 +++++++------- sass/_widgets.scss | 4 +-- sass/wp-blocks/button.scss | 2 +- sass/wp-blocks/cover.scss | 2 +- sass/wp-blocks/person.scss | 4 +-- sass/wp-blocks/quote.scss | 2 +- sass/wp-blocks/rss.scss | 2 +- theme.json | 12 ++++---- 14 files changed, 33 insertions(+), 89 deletions(-) diff --git a/sass/_archives.scss b/sass/_archives.scss index 96924c33..143a3a50 100644 --- a/sass/_archives.scss +++ b/sass/_archives.scss @@ -37,7 +37,7 @@ a { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; diff --git a/sass/_event.scss b/sass/_event.scss index 61c0b65a..38cc3a0e 100644 --- a/sass/_event.scss +++ b/sass/_event.scss @@ -15,7 +15,7 @@ a.event-card { color: $darkgray; @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } border-bottom: 1px solid $lightgray; @@ -31,7 +31,7 @@ a.event-card { .date { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; diff --git a/sass/_fonts.scss b/sass/_fonts.scss index bff65dc4..87c5b617 100755 --- a/sass/_fonts.scss +++ b/sass/_fonts.scss @@ -12,62 +12,6 @@ font-display: swap; } -@font-face { - font-family: PTSans; - src: url("assets/fonts/PTSans-Regular.eot"); - src: - url("assets/fonts/PTSans-Regular.eot?#iefix") format("embedded-opentype"), - url("assets/fonts/PTSans-Regular.woff2") format("woff2"), - url("assets/fonts/PTSans-Regular.woff") format("woff"), - url("assets/fonts/PTSans-Regular.ttf") format("truetype"), - url("assets/fonts/PTSans-Regular.svg#PTSans-Regular") format("svg"); - font-weight: 400; - font-style: normal; - font-display: swap; -} - -@font-face { - font-family: PTSans; - src: url("assets/fonts/PTSans-Bold.eot"); - src: - url("assets/fonts/PTSans-Bold.eot?#iefix") format("embedded-opentype"), - url("assets/fonts/PTSans-Bold.woff2") format("woff2"), - url("assets/fonts/PTSans-Bold.woff") format("woff"), - url("assets/fonts/PTSans-Bold.ttf") format("truetype"), - url("assets/fonts/PTSans-Bold.svg#PTSans-Bold") format("svg"); - font-weight: 700; - font-style: normal; - font-display: swap; -} - -@font-face { - font-family: PTSans; - src: url("assets/fonts/PTSans-BoldItalic.eot"); - src: - url("assets/fonts/PTSans-BoldItalic.eot?#iefix") format("embedded-opentype"), - url("assets/fonts/PTSans-BoldItalic.woff2") format("woff2"), - url("assets/fonts/PTSans-BoldItalic.woff") format("woff"), - url("assets/fonts/PTSans-BoldItalic.ttf") format("truetype"), - url("assets/fonts/PTSans-BoldItalic.svg#PTSans-BoldItalic") format("svg"); - font-weight: 700; - font-style: italic; - font-display: swap; -} - -@font-face { - font-family: PTSans; - src: url("assets/fonts/PTSans-Italic.eot"); - src: - url("assets/fonts/PTSans-Italic.eot?#iefix") format("embedded-opentype"), - url("assets/fonts/PTSans-Italic.woff2") format("woff2"), - url("assets/fonts/PTSans-Italic.woff") format("woff"), - url("assets/fonts/PTSans-Italic.ttf") format("truetype"), - url("assets/fonts/PTSans-Italic.svg#PTSans-Italic") format("svg"); - font-weight: 400; - font-style: italic; - font-display: swap; -} - @font-face { font-family: ForkAwesome; font-style: normal; diff --git a/sass/_header.scss b/sass/_header.scss index 0eb78644..5d257a65 100755 --- a/sass/_header.scss +++ b/sass/_header.scss @@ -190,7 +190,7 @@ body { &-name { @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } font-weight: 500; diff --git a/sass/_layout.scss b/sass/_layout.scss index ed52ce09..2967b4ff 100644 --- a/sass/_layout.scss +++ b/sass/_layout.scss @@ -8,7 +8,7 @@ body { body { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } } @@ -160,7 +160,7 @@ button.filter, a.eventlist { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; diff --git a/sass/_themes.scss b/sass/_themes.scss index dcd08df8..de7a5ea8 100644 --- a/sass/_themes.scss +++ b/sass/_themes.scss @@ -1,6 +1,6 @@ $themes: ( - default: ("headingFont": "GrueneType", "headingFontBold": "GrueneType", "standardFont": "PTSans", "secondaryFont": sans-serif), - contrast: ("headingFont": "GrueneType", "headingFontBold": "GrueneType", "standardFont": "PTSans", "secondaryFont": sans-serif) + default: ("headingFont": "GrueneType", "headingFontBold": "GrueneType", "standardFont": "PTSans, \"PT Sans\", sans-serif"), + contrast: ("headingFont": "GrueneType", "headingFontBold": "GrueneType", "standardFont": "PTSans \"PT Sans\", sans-serif") ); @mixin themed() { @@ -22,7 +22,7 @@ $themes: ( @function t($key) { - @return map-get($theme-map, $key); + @return unquote(map-get($theme-map, $key)); } .theme--contrast { diff --git a/sass/_typography.scss b/sass/_typography.scss index 7d127adc..4edf8134 100644 --- a/sass/_typography.scss +++ b/sass/_typography.scss @@ -22,13 +22,13 @@ h6, .roofline { @include themed() { - font-family: t("headingFont"); + font-family: t(headingFont); } &-single { @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } } @@ -45,7 +45,7 @@ h1, .has-huge-font-size { @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } font-size: 36px; @@ -57,7 +57,7 @@ h2, .has-large-font-size { @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } font-size: 27px; @@ -69,7 +69,7 @@ h3, .has-medium-font-size { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; @@ -89,7 +89,7 @@ h4, .h4 { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; @@ -100,7 +100,7 @@ h5, .h5 { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; @@ -111,7 +111,7 @@ h6, .h6 { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; @@ -173,7 +173,7 @@ h6, text-transform: uppercase; @include themed() { - font-family: t("headingFont"); + font-family: t(headingFont); } &::before { @@ -213,7 +213,7 @@ h6, font-size: 30pt; @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } padding: 8pt; diff --git a/sass/_widgets.scss b/sass/_widgets.scss index e7fdc88b..782d526d 100755 --- a/sass/_widgets.scss +++ b/sass/_widgets.scss @@ -25,7 +25,7 @@ &-title { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; @@ -69,7 +69,7 @@ &.wp-block-search__label { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; diff --git a/sass/wp-blocks/button.scss b/sass/wp-blocks/button.scss index 0022a8df..23e7f4ba 100644 --- a/sass/wp-blocks/button.scss +++ b/sass/wp-blocks/button.scss @@ -6,7 +6,7 @@ border-radius: 3px; @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } &:hover { diff --git a/sass/wp-blocks/cover.scss b/sass/wp-blocks/cover.scss index 1ac73214..4dcbbfdc 100644 --- a/sass/wp-blocks/cover.scss +++ b/sass/wp-blocks/cover.scss @@ -1,7 +1,7 @@ .entry-content > .wp-block-cover { @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } margin-left: calc(50% - 50vw); diff --git a/sass/wp-blocks/person.scss b/sass/wp-blocks/person.scss index ccb0ed48..e1e7ceeb 100644 --- a/sass/wp-blocks/person.scss +++ b/sass/wp-blocks/person.scss @@ -10,7 +10,7 @@ font-weight: 700; @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } } } @@ -21,7 +21,7 @@ font-weight: 700; @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } margin-bottom: 1rem; diff --git a/sass/wp-blocks/quote.scss b/sass/wp-blocks/quote.scss index 6db4d446..af862124 100644 --- a/sass/wp-blocks/quote.scss +++ b/sass/wp-blocks/quote.scss @@ -4,7 +4,7 @@ p { @include themed() { - font-family: t("headingFontBold"); + font-family: t(headingFontBold); } font-size: 23px; diff --git a/sass/wp-blocks/rss.scss b/sass/wp-blocks/rss.scss index 13822b7e..f2554c15 100644 --- a/sass/wp-blocks/rss.scss +++ b/sass/wp-blocks/rss.scss @@ -14,7 +14,7 @@ &-title { @include themed() { - font-family: t("standardFont"), t(secondaryFont); + font-family: t(standardFont); } font-weight: 700; diff --git a/theme.json b/theme.json index 1cb4140d..5a18d121 100755 --- a/theme.json +++ b/theme.json @@ -70,7 +70,7 @@ { "fontFace": [ { - "fontFamily": "PT Sans", + "fontFamily": "PTSans", "fontStretch": "normal", "fontStyle": "normal", "fontWeight": "400", @@ -79,7 +79,7 @@ ] }, { - "fontFamily": "PT Sans", + "fontFamily": "PTSans", "fontStretch": "normal", "fontStyle": "italic", "fontWeight": "400", @@ -88,7 +88,7 @@ ] }, { - "fontFamily": "PT Sans", + "fontFamily": "PTSans", "fontStretch": "normal", "fontStyle": "normal", "fontWeight": "700", @@ -97,7 +97,7 @@ ] }, { - "fontFamily": "PT Sans", + "fontFamily": "PTSans", "fontStretch": "normal", "fontStyle": "italic", "fontWeight": "700", @@ -106,8 +106,8 @@ ] } ], - "fontFamily": "\"PT Sans\", sans-serif", - "name": "PT Sans", + "fontFamily": "PTSans, \"PT Sans\", sans-serif", + "name": "PTSans", "slug": "pt-sans" }, {