feat: add design system tokens to Tailwind
This commit is contained in:
+45
-18
@@ -2,26 +2,53 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #171717;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--background: #0a0a0a;
|
||||
--foreground: #ededed;
|
||||
@layer base {
|
||||
body {
|
||||
@apply bg-bg text-text-primary antialiased;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--foreground);
|
||||
background: var(--background);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
.text-balance {
|
||||
text-wrap: balance;
|
||||
@layer components {
|
||||
.article-body {
|
||||
@apply text-base leading-relaxed text-text-secondary;
|
||||
}
|
||||
.article-body p {
|
||||
@apply mb-5;
|
||||
}
|
||||
.article-body h2 {
|
||||
@apply text-2xl font-bold text-text-primary mt-9 mb-4;
|
||||
}
|
||||
.article-body h3 {
|
||||
@apply text-xl font-semibold text-text-primary mt-7 mb-3;
|
||||
}
|
||||
.article-body strong {
|
||||
@apply text-text-primary font-semibold;
|
||||
}
|
||||
.article-body a {
|
||||
@apply text-accent underline hover:text-accent-hover;
|
||||
}
|
||||
.article-body ul {
|
||||
@apply list-disc pl-6 mb-5 space-y-1;
|
||||
}
|
||||
.article-body ol {
|
||||
@apply list-decimal pl-6 mb-5 space-y-1;
|
||||
}
|
||||
.article-body blockquote {
|
||||
@apply border-l-4 border-accent bg-bg-card rounded-r-md pl-5 pr-4 py-3 my-6;
|
||||
}
|
||||
.article-body blockquote p {
|
||||
@apply mb-0 italic;
|
||||
}
|
||||
.article-body img {
|
||||
@apply rounded-md w-full my-6;
|
||||
}
|
||||
.article-body code:not(pre code) {
|
||||
@apply bg-bg-card text-accent font-mono text-sm px-1.5 py-0.5 rounded;
|
||||
}
|
||||
.article-body pre {
|
||||
@apply bg-bg-card rounded-md p-4 overflow-x-auto my-6 text-sm font-mono;
|
||||
}
|
||||
.article-body hr {
|
||||
@apply border-border my-8;
|
||||
}
|
||||
}
|
||||
|
||||
+40
-8
@@ -1,19 +1,51 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
import type { Config } from 'tailwindcss'
|
||||
import { fontFamily } from 'tailwindcss/defaultTheme'
|
||||
|
||||
const config: Config = {
|
||||
content: [
|
||||
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
'./app/**/*.{ts,tsx}',
|
||||
'./components/**/*.{ts,tsx}',
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
background: "var(--background)",
|
||||
foreground: "var(--foreground)",
|
||||
bg: {
|
||||
DEFAULT: '#0D0D14',
|
||||
elevated: '#171A21',
|
||||
card: '#1D212B',
|
||||
},
|
||||
border: {
|
||||
DEFAULT: '#2A3140',
|
||||
},
|
||||
accent: {
|
||||
DEFAULT: '#00B4D8',
|
||||
hover: '#00D4FF',
|
||||
},
|
||||
violet: '#7C3AED',
|
||||
coral: '#D64545',
|
||||
amber: '#FFB300',
|
||||
green: '#00D166',
|
||||
text: {
|
||||
primary: '#F3F5F7',
|
||||
secondary: '#B8C0CC',
|
||||
muted: '#7D8795',
|
||||
disabled: '#5C6470',
|
||||
},
|
||||
},
|
||||
borderRadius: {
|
||||
sm: '8px',
|
||||
md: '12px',
|
||||
lg: '16px',
|
||||
xl: '20px',
|
||||
'2xl': '28px',
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['var(--font-inter)', ...fontFamily.sans],
|
||||
jp: ['var(--font-noto-sans-jp)', ...fontFamily.sans],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
export default config;
|
||||
}
|
||||
|
||||
export default config
|
||||
|
||||
Reference in New Issue
Block a user