From c7affcaa33ee78fa1b66dc1db95fc66a73d5cd60 Mon Sep 17 00:00:00 2001 From: Rafly Maulana Date: Fri, 21 Jul 2023 16:44:57 +0700 Subject: [PATCH] Move base style to tailwind config --- src/styles/globals.css | 11 ----------- tailwind.config.js | 12 +++++++++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/styles/globals.css b/src/styles/globals.css index a7433f0..b5c61c9 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1,14 +1,3 @@ @tailwind base; @tailwind components; @tailwind utilities; - -@layer base { - html, - body { - @apply scroll-smooth scroll-pt-12; - } - - * { - @apply !box-border; - } -} diff --git a/tailwind.config.js b/tailwind.config.js index ad042f2..7483a17 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const { fontFamily } = require("tailwindcss/defaultTheme"); +const plugin = require("tailwindcss/plugin"); module.exports = /** @satisfies {import('tailwindcss').Config} */ ({ mode: "jit", @@ -27,5 +28,14 @@ module.exports = /** @satisfies {import('tailwindcss').Config} */ ({ }, extend: {}, }, - plugins: [require("@tailwindcss/typography")], + plugins: [ + require("@tailwindcss/typography"), + plugin(({ addBase }) => { + addBase({ + "html, body": { + "@apply scroll-smooth scroll-pt-12": {}, + }, + }); + }), + ], });