From d4941db07c01895a5c1e03fbff6c70561c69fe04 Mon Sep 17 00:00:00 2001 From: Somrat <58769763+tfsomrat@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:59:25 +0600 Subject: [PATCH] update type-scale calculation for font-size --- assets/scss/base.scss | 8 ++++---- exampleSite/tailwind.config.js | 9 +++++---- layouts/partials/components/theme-switcher.html | 4 ++-- package.json | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/assets/scss/base.scss b/assets/scss/base.scss index d519df3..b568330 100755 --- a/assets/scss/base.scss +++ b/assets/scss/base.scss @@ -1,5 +1,5 @@ html { - @apply text-base; + @apply text-base-sm md:text-base; } body { @@ -32,17 +32,17 @@ h3, h4, .h4 { - @apply text-h4 font-medium; + @apply text-h4; } h5, .h5 { - @apply text-h5 font-medium; + @apply text-h5; } h6, .h6 { - @apply text-h6 font-medium; + @apply text-h6; } b, diff --git a/exampleSite/tailwind.config.js b/exampleSite/tailwind.config.js index 1990541..bbc2a5e 100755 --- a/exampleSite/tailwind.config.js +++ b/exampleSite/tailwind.config.js @@ -6,7 +6,7 @@ const theme = JSON.parse(themeRead); let font_base = Number(theme.fonts.font_size.base.replace("px", "")); let font_scale = Number(theme.fonts.font_size.scale); -let h6 = font_base / font_base; +let h6 = font_scale; let h5 = h6 * font_scale; let h4 = h5 * font_scale; let h3 = h4 * font_scale; @@ -68,12 +68,13 @@ module.exports = { }, fontSize: { base: font_base + "px", + "base-sm": font_base * 0.8 + "px", h1: h1 + "rem", - "h1-sm": h1 * 0.8 + "rem", + "h1-sm": h1 * 0.9 + "rem", h2: h2 + "rem", - "h2-sm": h2 * 0.8 + "rem", + "h2-sm": h2 * 0.9 + "rem", h3: h3 + "rem", - "h3-sm": h3 * 0.8 + "rem", + "h3-sm": h3 * 0.9 + "rem", h4: h4 + "rem", h5: h5 + "rem", h6: h6 + "rem", diff --git a/layouts/partials/components/theme-switcher.html b/layouts/partials/components/theme-switcher.html index 1b602dc..2f8e873 100644 --- a/layouts/partials/components/theme-switcher.html +++ b/layouts/partials/components/theme-switcher.html @@ -8,7 +8,7 @@