Overview
Taskflow uses TailwindCSS for utility-first styling combined with custom CSS for task-specific components. The styling system supports:
🎨 Utility-first approach with Tailwind classes
🌙 Dark mode with class strategy
🎯 Custom task component styles
📱 Responsive design for mobile devices
✨ Smooth animations and transitions
TailwindCSS Integration
Installation
Tailwind is installed as a dev dependency:
{
"devDependencies" : {
"tailwindcss" : "^3.4.19"
},
"scripts" : {
"build" : "tailwindcss -i ./input.css -o ./style.css" ,
"watch" : "tailwindcss -i ./input.css -o ./style.css --watch"
}
}
Build Process
Development : npm run watch - Watches for changes and rebuilds automatically
Production : npm run build - Compiles Tailwind utilities and custom CSS into style.css
Configuration
The Tailwind configuration extends the default theme with custom colors:
/** @type {import('tailwindcss').Config} */
module . exports = {
darkMode: 'class' ,
content: [ './*.html' , './*.js' ],
theme: {
extend: {
colors: {
accent: '#7a9cff' ,
alta: '#ff4757' ,
media: '#ffa502' ,
baja: '#2ed573' ,
},
},
},
plugins: [],
}
Dark Mode Strategy : darkMode: 'class' means dark mode is activated by adding the dark class to the <html> element, rather than using media queries.
Content Sources
Tailwind scans these files for class usage:
*.html - All HTML files in the root directory
*.js - All JavaScript files (for dynamically generated classes)
Color Palette
Accent Color #7a9cff - Primary accent blueUsed for buttons, links, borders, and interactive elements
Priority Colors
Alta : #ff4757 (Red) - High priority
Media : #ffa502 (Orange) - Medium priority
Baja : #2ed573 (Green) - Low priority
The input.css file contains Tailwind directives and custom component styles:
@tailwind base;
@tailwind components;
@tailwind utilities;
/* ── Estilos custom de tareas ── */
.tarea {
background : #ffffff ;
border : 1 px solid #e5e7eb ;
border-radius : 10 px ;
padding : 16 px 20 px ;
margin-bottom : 10 px ;
display : flex ;
align-items : center ;
gap : 16 px ;
transition : background 0.2 s ease , border-color 0.2 s ease ;
animation : entrar 0.3 s ease ;
}
.tarea:hover { background : #f3f4f6 ; border-color : #7a9cff ; border-width : 2 px ; }
.tarea:focus-within { border-color : #7a9cff ; border-width : 2 px ; }
.nombre { flex : 1 ; font-size : 1 rem ; cursor : pointer ; color : #1f2937 ; }
.categoria { font-size : 0.8 rem ; color : #6b7280 ; }
.badge { font-size : 0.75 rem ; font-weight : bold ; padding : 4 px 12 px ; border-radius : 20 px ; }
.alta { background : #ff47571a ; color : #ff4757 ; border : 1 px solid #ff4757 ; }
.media { background : #ffa5021a ; color : #ffa502 ; border : 1 px solid #ffa502 ; }
.baja { background : #2ed5731a ; color : #2ed573 ; border : 1 px solid #2ed573 ; }
.btnEliminar { background : transparent ; border : none ; color : #6b7280 ; cursor : pointer ; font-size : 1 rem ; padding : 4 px 8 px ; border-radius : 4 px ; transition : color 0.2 s ease , background 0.2 s ease , transform 0.15 s ease ; }
.btnEliminar:hover { color : #ff4757 ; background : #ff47571a ; transform : scale ( 1.15 ); }
.btnEliminar:focus { outline : 2 px solid #ff4757 ; outline-offset : 2 px ; }
.tarea.completada { opacity : 0.6 ; }
.tarea.completada .nombre { text-decoration : line-through ; color : #9ca3af ; }
.active { background : #e0e7ff !important ; color : #7a9cff !important ; }
Task Component Breakdown
Base Task Card (.tarea)
White background with subtle gray border
Flexbox layout with 16px gap between elements
Rounded corners (10px radius)
Entrance animation on creation
Hover effect: lighter background + accent border
Task Name (.nombre)
Takes up remaining flex space (flex: 1)
Clickable cursor to indicate interactivity
Toggles completion when clicked
Category Label (.categoria)
Smaller font size (0.8rem)
Muted gray color
Priority Badge (.badge)
Small pill-shaped badge
Color-coded by priority (.alta, .media, .baja)
Semi-transparent background with solid border
Delete Button (.btnEliminar)
Transparent background initially
Red hover state with scale transformation
Focus outline for accessibility
Completed State (.completada)
60% opacity for the entire card
Strikethrough text on task name
Muted text color
Dark Mode Styles
Dark mode variants are defined with the .dark prefix:
.dark .tarea { background : #243656 ; border-color : #2a4a7f ; }
.dark .tarea:hover { background : #1e2a4a ; border-color : #7a9cff ; }
.dark .nombre { color : #ffffff ; }
.dark .categoria { color : #aaaaaa ; }
.dark .btnEliminar { color : #aaaaaa ; }
.dark .active { background : #0f3460 !important ; color : #7a9cff !important ; }
Dark Mode Activation
Dark mode is toggled by adding/removing the dark class on <html>:
function aplicarTema ( oscuro ) {
document . documentElement . classList . toggle ( 'dark' , oscuro );
btnTema . textContent = oscuro ? '🌙' : '☀️' ;
localStorage . setItem ( 'tema' , oscuro ? 'dark' : 'light' );
}
Tailwind automatically applies all dark: utility classes when the dark class is present on the root element.
Animations
Entrance Animation
Tasks slide in from above when created:
@keyframes entrar {
from {
opacity : 0 ;
transform : translateY ( -10 px );
}
to {
opacity : 1 ;
transform : translateY ( 0 );
}
}
Applied to .tarea with animation: entrar 0.3s ease;
Transitions
Smooth transitions on interactive elements:
Task cards : transition: background 0.2s ease, border-color 0.2s ease;
Delete button : transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
Form inputs : transition-all duration-200 (Tailwind utility)
Responsive Design
Mobile-first responsive styles at the 768px breakpoint:
@media ( max-width : 768 px ) {
body > div { flex-direction : column ; padding : 0 16 px ; }
aside { width : auto !important ; margin : 16 px 0 !important ; }
aside nav { flex-direction : row ; flex-wrap : wrap ; gap : 6 px ; }
main { padding : 16 px 0 ; }
}
Mobile Adaptations
Layout : Sidebar moves above main content (column layout)
Sidebar width : Expands to full width
Navigation : Horizontal scrolling filter pills
Spacing : Reduced padding and margins
Tailwind Utilities in HTML
The HTML uses extensive Tailwind utilities for layout and styling:
Header
Form Inputs
Add Button
< header class = "bg-white dark:bg-[#243656] border-b border-gray-200 dark:border-[#2a4a7f] px-8 py-5" >
< div class = "relative flex items-center justify-center max-w-[1200px] mx-auto" >
< h1 class = "text-2xl font-bold" > Mis Tareas </ h1 >
< button id = "btnTema"
class = "absolute right-0 text-xl w-9 h-9 flex items-center justify-center rounded-lg
bg-gray-100 dark:bg-[#1a1a2e] hover:bg-gray-200 dark:hover:bg-[#0f3460] transition-all duration-200" >
🌙
</ button >
</ div >
</ header >
CSS Architecture Summary
Tailwind Base Layer
Normalizes browser defaults and provides base styles
Custom Components
Task cards, badges, and buttons with specific design requirements
Tailwind Utilities
Layout, spacing, colors, and responsive utilities applied in HTML
Compiled Output
All styles bundled into style.css for production use
Best Practice : Custom component CSS is used only where Tailwind utilities would be repetitive or insufficient. Most styling is done inline with Tailwind classes for rapid development.