Added TailwindCSS
This commit is contained in:
1 parent
b6058c32ec
commit
58744133d1
4 files changed
+229
-75
No files matched your search
+14
-6
@@ -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"
|
||||
}
|
||||
}
|
||||
+101
@@ -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;
|
||||
}
|
||||
+44
-1
@@ -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: [],
|
||||
}
|
||||
@@ -1,76 +1,83 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="en" class="bg-bg-light">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="node_modules/bulma/css/bulma.min.css">
|
||||
<link rel="stylesheet" href="dist/styles.css">
|
||||
<!-- Remove Bulma and add Tailwind -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<!-- You would typically import your tailwind config here or via a build step -->
|
||||
<title>User Profile - Behind the Desk</title>
|
||||
<style>
|
||||
.hover-underline:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.table.is-light {
|
||||
background-color: #f5f5f5; /* Light background color */
|
||||
border: none; /* Remove table borders */
|
||||
color: #38315f; /* Set text color */
|
||||
}
|
||||
.table.is-light th, .table.is-light td {
|
||||
border: none; /* Remove cell borders */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item has-text-weight-bold" href="/">
|
||||
<body class="font-sans text-text-default pt-navbar-height">
|
||||
<!-- Fixed Navbar -->
|
||||
<nav class="fixed top-0 left-0 right-0 bg-navbar-bg border-b border-navbar-border z-10" role="navigation" aria-label="main navigation">
|
||||
<div class="max-w-6xl mx-auto px-4">
|
||||
<div class="flex justify-between">
|
||||
<!-- Left side -->
|
||||
<div class="flex">
|
||||
<!-- Brand logo -->
|
||||
<a href="/" class="flex items-center px-2 py-3 text-primary font-bold">
|
||||
Behind the Desk
|
||||
</a>
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
|
||||
<span aria-hidden="true"></span><span aria-hidden="true"></span><span aria-hidden="true"></span>
|
||||
</a>
|
||||
<!-- Primary Nav -->
|
||||
<div class="hidden md:flex items-center">
|
||||
<a href="/" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">top 🔥</a>
|
||||
<a href="#" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">new</a>
|
||||
<a href="#" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">nearby</a>
|
||||
<a href="#" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">past</a>
|
||||
<a href="#" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">ask</a>
|
||||
<a href="#" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">show</a>
|
||||
<a href="#" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">submit</a>
|
||||
</div>
|
||||
<div id="navbarBasicExample" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/">top 🔥</a>
|
||||
<a class="navbar-item" href="#">new</a>
|
||||
<a class="navbar-item" href="#">nearby</a>
|
||||
<a class="navbar-item" href="#">past</a>
|
||||
<a class="navbar-item" href="#">ask</a>
|
||||
<a class="navbar-item" href="#">show</a>
|
||||
<a class="navbar-item" href="#">submit</a>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<a href="/login.html">login</a>
|
||||
<!-- Right side -->
|
||||
<div class="hidden md:flex items-center">
|
||||
<a href="/login.html" class="px-3 py-3 text-primary hover:bg-opacity-5 hover:bg-primary">login</a>
|
||||
</div>
|
||||
<!-- Mobile menu button -->
|
||||
<div class="md:hidden flex items-center">
|
||||
<button id="mobile-menu-button" class="text-primary p-3">
|
||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Mobile menu -->
|
||||
<div id="mobile-menu" class="hidden md:hidden">
|
||||
<a href="/" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">top 🔥</a>
|
||||
<a href="#" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">new</a>
|
||||
<a href="#" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">nearby</a>
|
||||
<a href="#" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">past</a>
|
||||
<a href="#" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">ask</a>
|
||||
<a href="#" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">show</a>
|
||||
<a href="#" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">submit</a>
|
||||
<a href="/login.html" class="block py-2 px-4 text-primary hover:bg-opacity-5 hover:bg-primary">login</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="section main-content">
|
||||
<div class="container login-container">
|
||||
<div class="form-section">
|
||||
<h2>User Profile</h2>
|
||||
<div class="user-profile">
|
||||
<table class="table is-light">
|
||||
<main class="py-4 pb-16">
|
||||
<div class="max-w-md mx-auto px-4 mt-8">
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg text-primary mb-4">User Profile</h2>
|
||||
<div class="bg-white rounded shadow">
|
||||
<table class="w-full bg-gray-50 text-primary">
|
||||
<tr>
|
||||
<th>Username:</th>
|
||||
<td>@username</td>
|
||||
<th class="text-left py-2 px-4 font-normal">Username:</th>
|
||||
<td class="py-2 px-4">@username</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Created:</th>
|
||||
<td>January 1, 2023</td>
|
||||
<th class="text-left py-2 px-4 font-normal">Created:</th>
|
||||
<td class="py-2 px-4">January 1, 2023</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>About:</th>
|
||||
<td>
|
||||
<th class="text-left py-2 px-4 font-normal align-top">About:</th>
|
||||
<td class="py-2 px-4">
|
||||
<ul>
|
||||
<li class="hover-underline">Submissions: 10</li>
|
||||
<li class="hover-underline">Comments: 50</li>
|
||||
<li class="hover-underline">Favorites: 20</li>
|
||||
<li class="hover:underline cursor-pointer">Submissions: 10</li>
|
||||
<li class="hover:underline cursor-pointer">Comments: 50</li>
|
||||
<li class="hover:underline cursor-pointer">Favorites: 20</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -80,31 +87,26 @@
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="footer-menu">
|
||||
<a href="#">Privacy</a>
|
||||
<a href="#">Terms</a>
|
||||
<a href="#">Contact</a>
|
||||
<footer class="bg-bg-footer py-8">
|
||||
<div class="max-w-6xl mx-auto px-4">
|
||||
<div class="mt-4 text-center">
|
||||
<a href="#" class="text-text-muted mx-2 hover:underline">Privacy</a>
|
||||
<a href="#" class="text-text-muted mx-2 hover:underline">Terms</a>
|
||||
<a href="#" class="text-text-muted mx-2 hover:underline">Contact</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Simple script to toggle mobile menu -->
|
||||
<!-- Mobile menu toggle script -->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
|
||||
if ($navbarBurgers.length > 0) {
|
||||
$navbarBurgers.forEach(el => {
|
||||
el.addEventListener('click', () => {
|
||||
const target = el.dataset.target;
|
||||
const $target = document.getElementById(target);
|
||||
el.classList.toggle('is-active');
|
||||
$target.classList.toggle('is-active');
|
||||
const mobileMenuButton = document.getElementById('mobile-menu-button');
|
||||
const mobileMenu = document.getElementById('mobile-menu');
|
||||
|
||||
mobileMenuButton.addEventListener('click', () => {
|
||||
mobileMenu.classList.toggle('hidden');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user