From 87fc49cc02acc0a710805ed4661159287a775943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Niedzi=C3=B3=C5=82ka?= Date: Fri, 21 Jul 2023 06:31:28 +0200 Subject: [PATCH] fix(css): Change `font-family` only when it's needed (#2457) --- .../fonts/font-optical-sizing.css | 2 - .../css-examples/fonts/font-size.css | 5 - .../fonts/font-variation-settings.css | 2 - live-examples/css-examples/fonts/font.css | 14 +- live-examples/css-examples/fonts/font.html | 2 +- live-examples/css-examples/fonts/meta.json | 259 +++++++++--------- .../fonts/{fonts-base.css => text-align.css} | 3 - live-examples/css-examples/text/meta.json | 4 +- .../css-examples/text/text-indent.css | 3 - .../content-sectioning/css/article.css | 1 - .../content-sectioning/css/aside.css | 4 - .../html-examples/forms/css/datalist.css | 3 +- .../html-examples/forms/css/optgroup.css | 3 +- .../inline-text-semantics/css/u.css | 2 +- .../html-examples/input/css/password.css | 1 - 15 files changed, 150 insertions(+), 158 deletions(-) delete mode 100644 live-examples/css-examples/fonts/font-size.css rename live-examples/css-examples/fonts/{fonts-base.css => text-align.css} (57%) diff --git a/live-examples/css-examples/fonts/font-optical-sizing.css b/live-examples/css-examples/fonts/font-optical-sizing.css index b1357e8ba..289e559ae 100644 --- a/live-examples/css-examples/fonts/font-optical-sizing.css +++ b/live-examples/css-examples/fonts/font-optical-sizing.css @@ -1,5 +1,3 @@ -@import 'fonts.css'; - @font-face { src: url('/media/fonts/AmstelvarAlpha-VF.ttf'); font-family: Amstelvar; diff --git a/live-examples/css-examples/fonts/font-size.css b/live-examples/css-examples/fonts/font-size.css deleted file mode 100644 index 1848990c8..000000000 --- a/live-examples/css-examples/fonts/font-size.css +++ /dev/null @@ -1,5 +0,0 @@ -@import 'fonts.css'; - -#output section { - font-family: 'Fira Sans', sans-serif; -} diff --git a/live-examples/css-examples/fonts/font-variation-settings.css b/live-examples/css-examples/fonts/font-variation-settings.css index be3fd8d47..8912d9905 100644 --- a/live-examples/css-examples/fonts/font-variation-settings.css +++ b/live-examples/css-examples/fonts/font-variation-settings.css @@ -1,5 +1,3 @@ -@import 'fonts.css'; - @font-face { src: url('/media/fonts/AmstelvarAlpha-VF.ttf'); font-family: Amstelvar; diff --git a/live-examples/css-examples/fonts/font.css b/live-examples/css-examples/fonts/font.css index c152d8e24..44d3e7f77 100644 --- a/live-examples/css-examples/fonts/font.css +++ b/live-examples/css-examples/fonts/font.css @@ -1,4 +1,16 @@ -@import 'fonts-base.css'; +@font-face { + font-family: 'Fira Sans'; + src: local('FiraSans-Regular'), url('/media/fonts/FiraSans-Regular.woff2') format('woff2'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Fira Sans'; + src: local('FiraSans-Italic'), url('/media/fonts/FiraSans-Italic.woff2') format('woff2'); + font-weight: normal; + font-style: italic; +} #output section { margin-top: 10px; diff --git a/live-examples/css-examples/fonts/font.html b/live-examples/css-examples/fonts/font.html index bb7856bcd..d39eb3423 100644 --- a/live-examples/css-examples/fonts/font.html +++ b/live-examples/css-examples/fonts/font.html @@ -6,7 +6,7 @@ -
+
font: italic 1.2em "Fira Sans", serif;