Get Started

설치

@olundot/ui와 @olundot/tokens를 설치하고 CSS를 연결합니다.

패키지 설치

npm install @olundot/ui @olundot/tokens

PostCSS

postcss.config.mjs
export default { plugins: { "@tailwindcss/postcss": {} } };

app/globals.css

app/globals.css
@layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities);

@source "../node_modules/@olundot/ui/dist";
@import "@olundot/ui/tokens.css";

브레이크포인트는 토큰이 정적 px 값으로 내보내므로 따로 선언하지 않습니다.

FOUC 방지 부트 스크립트

app/layout.tsx
const themeScript = `(()=>{try{
  const s=localStorage.getItem("olun-theme");
  const t=(s==="light"||s==="dark")?s:(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");
  document.documentElement.dataset.theme=t;
}catch{document.documentElement.dataset.theme="light";}})();`;

목차