diff --git a/postcss.config.js b/postcss.config.js index 8334259..2fee435 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,10 +1,10 @@ /** @type {import('postcss-load-config').Config} */ module.exports = { plugins: { - tailwindcss: {}, - autoprefixer: {}, 'postcss-import': {}, 'tailwindcss/nesting': {}, + tailwindcss: {}, + autoprefixer: {}, ...(process.env.NODE_ENV !== 'production' ? { cssnano: {} } : {}) } } diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx index 1fc6876..c7c9826 100644 --- a/src/app/global-error.tsx +++ b/src/app/global-error.tsx @@ -3,7 +3,7 @@ import Image from 'next/image' import { useRouter } from 'next/navigation' -import quicksand from 'theme/fontFamily' +import quicksand from 'theme/variables/fontFamily' import 'theme/globals.css' import S from './styles.module.scss' diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7fbe8b1..b3ac229 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,7 +1,7 @@ import type { Metadata, Viewport } from 'next' import type { ReactNode } from 'react' -import quicksand from 'theme/fontFamily' +import quicksand from 'theme/variables/fontFamily' import { CookieWarning, PopupInstallPwa, Toast } from 'components/molecules' import { BottomBar, Footer, TopBar } from 'components/organisms' diff --git a/src/theme/globals.css b/src/theme/globals.css index aaa9125..d8a40bd 100644 --- a/src/theme/globals.css +++ b/src/theme/globals.css @@ -1,154 +1,5 @@ -@tailwind base; - -@layer base { - * { - box-sizing: border-box; - outline: none; - margin: 0; - padding: 0; - list-style: none; - font-family: - var(--font-quicksand), - system-ui, - -apple-system, - 'BlinkMacSystemFont', - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', - 'Open Sans', - 'Helvetica Neue', - sans-serif; - line-height: calc(1em + 0.5rem); - text-decoration: none; - -webkit-font-smoothing: antialiased !important; - -moz-osx-font-smoothing: grayscale !important; - } - - @media (prefers-reduced-motion: reduce) { - body *, - body *::before, - body *::after { - transition-delay: -1ms !important; - transition-duration: 1ms !important; - animation-duration: 1ms !important; - animation-delay: -1ms !important; - animation-iteration-count: 1 !important; - background-attachment: initial !important; - scroll-behavior: auto !important; - } - } - - html { - font-size: 62.5%; - } - - #__next { - display: flex; - flex-direction: column; - justify-content: flex-start; - min-height: 100vh; - } - - body { - display: flex; - flex-direction: column; - min-height: 100vh; - justify-content: flex-start; - background-color: rgba(245, 245, 255, 1); - color: rgba(14, 12, 27, 1); - isolation: isolate; - - @media (max-width: 640px) { - padding-bottom: 50px; - } - } - - p, - h1, - h2, - h3, - h4, - h5, - h6 { - word-break: break-word; - } - - b, - strong { - font-weight: bolder; - } - - optgroup, - body, - input, - select, - textarea, - button { - margin: 0; - font-family: var(--font-quicksand); - font-size: 1.6rem; - font-weight: 500; - } - - button { - border: 0; - cursor: pointer; - } - - a, - a:active { - color: inherit; - text-decoration: none; - } - - :focus, - :focus-visible { - outline: 4px solid rgba(0, 125, 250, 0.6); - outline-offset: 1px; - } - - :focus:not(:focus-visible) { - outline: 0; - box-shadow: none; - } - - mark { - &::before, - &::after { - position: absolute; - width: 1px; - height: 1px; - overflow: hidden; - white-space: nowrap; - clip: rect(1px, 1px, 1px, 1px); - clip-path: inset(100%); - content: ' [start of highlighted text] '; - } - - &::after { - content: ' [end of highlighted text] '; - } - } - - ::-webkit-scrollbar, - scrollbar-width { - width: 12px !important; - background-color: rgba(245, 245, 255, 1); - } - - ::-webkit-scrollbar-thumb { - border: 1px solid rgba(245, 245, 255, 1); - border-radius: 20px; - background-color: rgba(160, 166, 198, 1); - } - - :root { - scrollbar-color: rgba(160, 166, 198, 1) rgba(245, 245, 255, 1) !important; - scrollbar-width: 12px !important; - } -} +@import 'reset.css'; +@tailwind base; @tailwind components; @tailwind utilities; diff --git a/src/theme/reset.css b/src/theme/reset.css new file mode 100644 index 0000000..f333448 --- /dev/null +++ b/src/theme/reset.css @@ -0,0 +1,149 @@ +@layer base { + * { + box-sizing: border-box; + outline: none; + margin: 0; + padding: 0; + list-style: none; + font-family: + var(--font-quicksand), + system-ui, + -apple-system, + 'BlinkMacSystemFont', + 'Segoe UI', + 'Roboto', + 'Oxygen', + 'Ubuntu', + 'Cantarell', + 'Open Sans', + 'Helvetica Neue', + sans-serif; + line-height: calc(1em + 0.5rem); + text-decoration: none; + -webkit-font-smoothing: antialiased !important; + -moz-osx-font-smoothing: grayscale !important; + } + + @media (prefers-reduced-motion: reduce) { + body *, + body *::before, + body *::after { + transition-delay: -1ms !important; + transition-duration: 1ms !important; + animation-duration: 1ms !important; + animation-delay: -1ms !important; + animation-iteration-count: 1 !important; + background-attachment: initial !important; + scroll-behavior: auto !important; + } + } + + html { + font-size: 62.5%; + } + + #__next { + display: flex; + flex-direction: column; + justify-content: flex-start; + min-height: 100vh; + } + + body { + display: flex; + flex-direction: column; + min-height: 100vh; + justify-content: flex-start; + background-color: rgba(245, 245, 255, 1); + color: rgba(14, 12, 27, 1); + isolation: isolate; + + @media (max-width: 640px) { + padding-bottom: 50px; + } + } + + p, + h1, + h2, + h3, + h4, + h5, + h6 { + word-break: break-word; + } + + b, + strong { + font-weight: bolder; + } + + optgroup, + body, + input, + select, + textarea, + button { + margin: 0; + font-family: var(--font-quicksand); + font-size: 1.6rem; + font-weight: 500; + } + + button { + border: 0; + cursor: pointer; + } + + a, + a:active { + color: inherit; + text-decoration: none; + } + + :focus, + :focus-visible { + outline: 4px solid rgba(0, 125, 250, 0.6); + outline-offset: 1px; + } + + :focus:not(:focus-visible) { + outline: 0; + box-shadow: none; + } + + mark { + &::before, + &::after { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + white-space: nowrap; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(100%); + content: ' [start of highlighted text] '; + } + + &::after { + content: ' [end of highlighted text] '; + } + } + + ::-webkit-scrollbar, + scrollbar-width { + width: 12px !important; + background-color: rgba(245, 245, 255, 1); + } + + ::-webkit-scrollbar-thumb { + border: 1px solid rgba(245, 245, 255, 1); + border-radius: 20px; + background-color: rgba(160, 166, 198, 1); + } + + :root { + scrollbar-color: rgba(160, 166, 198, 1) rgba(245, 245, 255, 1) !important; + scrollbar-width: 12px !important; + } +} diff --git a/src/theme/borderRadius.ts b/src/theme/variables/borderRadius.ts similarity index 100% rename from src/theme/borderRadius.ts rename to src/theme/variables/borderRadius.ts diff --git a/src/theme/boxShadow.ts b/src/theme/variables/boxShadow.ts similarity index 100% rename from src/theme/boxShadow.ts rename to src/theme/variables/boxShadow.ts diff --git a/src/theme/colors.ts b/src/theme/variables/colors.ts similarity index 100% rename from src/theme/colors.ts rename to src/theme/variables/colors.ts diff --git a/src/theme/fontFamily.ts b/src/theme/variables/fontFamily.ts similarity index 100% rename from src/theme/fontFamily.ts rename to src/theme/variables/fontFamily.ts diff --git a/src/theme/fontSize.ts b/src/theme/variables/fontSize.ts similarity index 100% rename from src/theme/fontSize.ts rename to src/theme/variables/fontSize.ts diff --git a/src/theme/fontWeight.ts b/src/theme/variables/fontWeight.ts similarity index 100% rename from src/theme/fontWeight.ts rename to src/theme/variables/fontWeight.ts diff --git a/src/theme/index.ts b/src/theme/variables/index.ts similarity index 100% rename from src/theme/index.ts rename to src/theme/variables/index.ts diff --git a/src/theme/screens.ts b/src/theme/variables/screens.ts similarity index 100% rename from src/theme/screens.ts rename to src/theme/variables/screens.ts diff --git a/src/theme/spacing.ts b/src/theme/variables/spacing.ts similarity index 100% rename from src/theme/spacing.ts rename to src/theme/variables/spacing.ts diff --git a/src/theme/zIndex.ts b/src/theme/variables/zIndex.ts similarity index 100% rename from src/theme/zIndex.ts rename to src/theme/variables/zIndex.ts diff --git a/tailwind.config.ts b/tailwind.config.ts index ee0b293..6f1b361 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -12,7 +12,7 @@ import { boxShadow, borderRadius, screens -} from './src/theme' +} from './src/theme/variables' import { utilities } from './src/theme/utilities' import { components } from './src/theme/components'