diff --git a/package.json b/package.json index 8235765..0590593 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,20 @@ "description": "", "main": "index.js", "scripts": { - "build": "postcss src/styles.css -o dist/styles.css" + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "css:dev": "npx postcss src/styles.css -o dist/styles.css --watch", + "css:build": "npx postcss src/styles.css -o dist/styles.css" + }, + "devDependencies": { + "autoprefixer": "^10.4.14", + "postcss": "^8.4.27", + "postcss-cli": "^10.1.0", + "tailwindcss": "^3.3.3", + "vite": "^6.3.3" }, "dependencies": { - "autoprefixer": "^10.4.7", - "postcss": "^8.4.14", - "tailwindcss": "^3.0.24" - }, - "devDependencies": {} + "bulma": "^1.0.4" + } } diff --git a/src/styles.css b/src/styles.css index b5c61c9..0c7b285 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,3 +1,104 @@ @tailwind base; @tailwind components; @tailwind utilities; + +/* Any custom styles that can't be easily represented with Tailwind utilities */ +@layer base { + html { + @apply bg-bg-light; + } + + body { + @apply font-sans text-text-default pt-navbar-height; + } +} + +@layer components { + .upvote-arrow { + @apply text-text-muted no-underline text-md leading-none inline-block pt-0.5; + } + + .upvote-arrow:hover { + @apply text-link-hover; + } + + .post-title { + @apply text-text-title font-normal text-base; + } + + .post-title:hover { + @apply underline text-text-title; + } + + .handle { + @apply text-text-muted ml-2 text-sm; + } + + .time { + @apply text-text-muted ml-2 text-sm; + } + + .rules-tips { + @apply text-md bg-rules-bg text-primary border-l-4 border-primary py-3 px-4; + } + + .post-item { + @apply py-3 px-2 border-b border-border-light bg-transparent; + } + + .post-item:last-child { + @apply border-b-0; + } + + .nested-comment { + @apply ml-6 mt-4 border-l-2 border-gray-200 pl-4 text-md; + } + + .reply-box { + @apply ml-8 mt-4; + } + + .comment-header small.reply { + @apply underline text-xs cursor-pointer ml-2 inline-block; + } +} + +/* Any absolutely custom styles that don't fit in Tailwind's utility pattern */ +.carbon-demo { + background-color: #fff; + border-radius: 0.2em; + display: grid; + grid-template-columns: 130px 1fr; + justify-content: center; + margin: 60px auto; + max-width: 360px; + overflow: hidden; + position: relative; + padding: 0; + box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08); +} + +.carbon-demo > * { + box-sizing: border-box; +} + +.carbon-demo .carbon-img { + height: auto; + width: 130px; +} + +.carbon-demo .carbon-desc { + font-size: 0.875rem; + line-height: 1.35; + padding: 0.75rem; +} + +.carbon-demo .carbon-via { + bottom: 1em; + font-size: 0.625em; + font-weight: 600; + left: calc(130px + 0.75rem); + letter-spacing: 0.1ch; + position: absolute; + text-transform: uppercase; +} \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js index b36e524..073e7ec 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -5,7 +5,50 @@ module.exports = { "./public/**/*.{html,js}" ], theme: { - extend: {}, + extend: { + colors: { + // Main brand colors from the CSS + primary: '#38315f', // Purple color used for text and accents + 'primary-dark': '#2d274a', // Darker version for hover states + 'navbar-bg': '#e5fa70', // Navbar background + 'navbar-border': '#cddb60', // Navbar border + 'bg-light': '#f8f9fa', // Light background + 'bg-footer': '#e9ecef', // Footer background + 'text-default': '#343a40', // Default text color + 'text-muted': '#6c757d', // Muted/secondary text + 'text-title': '#212529', // Post title color + 'link-hover': '#ff6600', // Orange hover color for upvote arrows + 'rules-bg': '#eef6f6', // Rules box background + 'border-light': '#dee2e6', // Light borders + }, + fontFamily: { + sans: [ + '-apple-system', + 'BlinkMacSystemFont', + '"Segoe UI"', + 'Roboto', + 'Helvetica', + 'Arial', + 'sans-serif', + '"Apple Color Emoji"', + '"Segoe UI Emoji"', + '"Segoe UI Symbol"' + ], + }, + fontSize: { + 'xs': '0.75rem', // Very small text (like "reply") + 'sm': '0.8rem', // Small text (like meta info) + 'md': '0.9rem', // Medium-small text (like rules box) + 'base': '1rem', // Base text size (like post titles) + 'lg': '1.2rem', // Section headers + }, + spacing: { + 'navbar-height': '3.25rem', // Height of the navbar + }, + boxShadow: { + 'card': '0 15px 30px rgba(0, 0, 0, 0.08)', + } + }, }, plugins: [], } diff --git a/user.html b/user.html index 0d5d50b..13dd756 100644 --- a/user.html +++ b/user.html @@ -1,76 +1,83 @@ - +
- - + + +