diff --git a/package.json b/package.json index fa0d197..7c1639c 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "astroplate", - "version": "3.3.4", + "version": "3.4.0", "description": "Astro and Tailwindcss boilerplate", "author": "zeon.studio", "license": "MIT", diff --git a/src/layouts/components/ThemeSwitcher.astro b/src/layouts/components/ThemeSwitcher.astro index 4850bff..2f10b2c 100755 --- a/src/layouts/components/ThemeSwitcher.astro +++ b/src/layouts/components/ThemeSwitcher.astro @@ -16,7 +16,7 @@ const { className }: { className?: string } = Astro.props; theme switcher import { settings } from "@/config/config.json"; const matchMedia = window.matchMedia("(prefers-color-scheme: dark)"); - - matchMedia.addEventListener('change', () => toggleTheme(document.querySelectorAll("[data-theme-switcher]"))); + + matchMedia.addEventListener("change", () => + toggleTheme(document.querySelectorAll("[data-theme-switcher]")) + ); function toggleTheme(themeSwitch: NodeListOf) { - const defaulTheme = settings.default_theme ==="system" ? matchMedia.matches ? "dark" : "light" : settings.default_theme; + const defaulTheme = + settings.default_theme === "system" + ? matchMedia.matches + ? "dark" + : "light" + : settings.default_theme; const currentTheme = localStorage.getItem("theme") || defaulTheme; const isDarkTheme = currentTheme === "dark"; themeSwitch.forEach((sw: any) => (sw.checked = isDarkTheme)); @@ -63,7 +70,12 @@ const { className }: { className?: string } = Astro.props; toggleTheme(themeSwitch); themeSwitch.forEach((sw) => { sw.addEventListener("click", function () { - const defaulTheme = settings.default_theme ==="system" ? matchMedia.matches ? "dark" : "light" : settings.default_theme; + const defaulTheme = + settings.default_theme === "system" + ? matchMedia.matches + ? "dark" + : "light" + : settings.default_theme; const currentTheme = localStorage.getItem("theme") || defaulTheme; const newTheme = currentTheme === "light" ? "dark" : "light"; localStorage.setItem("theme", newTheme); diff --git a/src/styles/base.scss b/src/styles/base.scss index 3d30f17..b568330 100755 --- a/src/styles/base.scss +++ b/src/styles/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, @@ -53,3 +53,7 @@ strong { code { @apply after:border-none; } + +blockquote > p { + @apply my-0 #{!important}; +} diff --git a/tailwind.config.js b/tailwind.config.js index 042d889..04004f5 100755 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,7 @@ const theme = require("./src/config/theme.json"); 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; @@ -59,12 +59,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",