update type-scale calculation for font-size

This commit is contained in:
Somrat 2024-03-20 11:59:25 +06:00
parent ef2cc9c04a
commit d4941db07c
4 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
html { html {
@apply text-base; @apply text-base-sm md:text-base;
} }
body { body {
@ -32,17 +32,17 @@ h3,
h4, h4,
.h4 { .h4 {
@apply text-h4 font-medium; @apply text-h4;
} }
h5, h5,
.h5 { .h5 {
@apply text-h5 font-medium; @apply text-h5;
} }
h6, h6,
.h6 { .h6 {
@apply text-h6 font-medium; @apply text-h6;
} }
b, b,

View File

@ -6,7 +6,7 @@ const theme = JSON.parse(themeRead);
let font_base = Number(theme.fonts.font_size.base.replace("px", "")); let font_base = Number(theme.fonts.font_size.base.replace("px", ""));
let font_scale = Number(theme.fonts.font_size.scale); 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 h5 = h6 * font_scale;
let h4 = h5 * font_scale; let h4 = h5 * font_scale;
let h3 = h4 * font_scale; let h3 = h4 * font_scale;
@ -68,12 +68,13 @@ module.exports = {
}, },
fontSize: { fontSize: {
base: font_base + "px", base: font_base + "px",
"base-sm": font_base * 0.8 + "px",
h1: h1 + "rem", h1: h1 + "rem",
"h1-sm": h1 * 0.8 + "rem", "h1-sm": h1 * 0.9 + "rem",
h2: h2 + "rem", h2: h2 + "rem",
"h2-sm": h2 * 0.8 + "rem", "h2-sm": h2 * 0.9 + "rem",
h3: h3 + "rem", h3: h3 + "rem",
"h3-sm": h3 * 0.8 + "rem", "h3-sm": h3 * 0.9 + "rem",
h4: h4 + "rem", h4: h4 + "rem",
h5: h5 + "rem", h5: h5 + "rem",
h6: h6 + "rem", h6: h6 + "rem",

View File

@ -8,7 +8,7 @@
<span> <span>
<!-- sun --> <!-- sun -->
<svg <svg
class="absolute left-[4px] top-[4px] z-10 opacity-100 dark:opacity-0" class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-10 opacity-100 dark:opacity-0"
viewBox="0 0 56 56" viewBox="0 0 56 56"
fill="#fff" fill="#fff"
height="16" height="16"
@ -18,7 +18,7 @@
</svg> </svg>
<!-- moon --> <!-- moon -->
<svg <svg
class="absolute left-[4px] top-[4px] z-10 opacity-0 dark:opacity-100" class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-10 opacity-0 dark:opacity-100"
viewBox="0 0 24 24" viewBox="0 0 24 24"
fill="none" fill="none"
height="16" height="16"

View File

@ -1,7 +1,7 @@
{ {
"name": "hugoplate", "name": "hugoplate",
"description": "hugo tailwindcss boilerplate", "description": "hugo tailwindcss boilerplate",
"version": "1.12.4", "version": "1.13.0",
"license": "MIT", "license": "MIT",
"author": "zeon.studio", "author": "zeon.studio",
"scripts": { "scripts": {