Design Language Document: Tracing Insights F1 Web
This document provides a comprehensive overview of the design patterns, tokens, and code conventions used in the Tracing Insights F1 Web codebase. It is optimized for use by AI/LLMs during code generation.1. Design Tokens
🎨 Color Palette
The system uses DaisyUI v4 semantic tokens within Tailwind CSS v3. The primary theme ismytheme, but team-specific themes are also defined.
Standard Semantic Tokens:
--p(primary):#00ff00(Tracing Insights Green)--s(secondary):#ff00ff--a(accent):#F471B5--n(neutral):#1E293B--b1(base-100):#002451(Deep Navy)--in(info):#0CA5E9--su(success):green--wa(warning):orange--er(error): red
mercedes: primary#00d2beferrari: primary#e6194bmclaren: primary#f58231redbull: primary#ffe119
Typography
The system uses a mix of display and body fonts.- Display/Metal Heading:
Bebas Neue(font-metalfont,font-sans). High-impact, uppercase style for titles and callouts. - Body Text:
Roboto(font-roboto). Used for general readability and paragraphs. - Logo/Script:
Great Vibes(font-logofont). Used sparingly for branding.
Spacing & Borders
- Spacing Scale: Standard Tailwind scale (e.g.,
p-4,m-8,gap-6). - Border Radius:
rounded-lg(default for cards),rounded-full(for pills/buttons),rounded-box(standard DaisyUI containers). - Shadows:
shadow-xl(standard),shadow-primary/20(glow effect for primary elements).
2. Layout System
Containers
- Primary Container:
container mx-auto max-w-1200 - Article/Detail:
mx-auto max-w-2xl(for reading focus)
Grid System
- Listings: Standard responsive grid pattern:
Breakpoints
The system adheres to standard Tailwind breakpoints:sm: 640px- md: 768px
lg: 1024pxxl: 1280px
3. Component Patterns
Cards (Tracing Insights Style)
Used for listing blog posts and analysis items.- Structure:
card h-full bg-[#011627]/90 shadow-xl border border-primary/40 overflow-hidden - Interaction:
hover:border-primary transition-all duration-300 transform hover:-translate-y-2 hover:shadow-primary/20 hover:shadow-2xl - Internal Elements:
figurefor images (withgroup-hover:scale-110),card-bodyfor content.
Buttons
- Standard:
btn(DaisyUI). - Primary:
btn btn-primary text-base-100. - Transitions:
transform transition hover:scale-105 hover:shadow-md.
Selects & Controls
- TomSelect Implementation: Standard selection UI used for year/event/driver filtering.
Banners / Notifications
- Animations:
- States: Uses
.hiddenoropacity-0with JavaScript for toggling.
4. Motion & Interaction
Standard Motion
- Transitions:
transition-all duration-300 ease-in-out(applied to cards, links, and buttons). - Banner Entrance:
opacity-0 -translate-y-2.5transitioning toopacity-100 translate-y-0.
Micro-interactions
- Hover Scale:
group-hover:scale-110for images in cards. - Vertical Hover:
hover:-translate-y-2for interactive cards. - Pulse:
animate-ping(standard DaisyUI) for live indicators.
5. Code Conventions
Django Template Structure
- Base Extension:
{% extends "base.html" %}. - Block Organization:
head: For page-specific meta tags and stylesheets.content: Primary page body.site_header: (Optional) Overrides for navigation.
Component Co-location
- Small reusable HTML snippets are located in
hf/templates/components/. - JavaScript state often resides in
<script>tags at the bottom of templates or inhf/static/js/.
6. Usage Rules (LLM Instructions)
- Prefer Semi-Custom Cards: When creating cards, always wrap a DaisyUI
.cardin agroupand applyhover:-translate-y-2 border-primary/40 hover:border-primary. - Standard Containers: For main page content, wrap in
<div class="container mx-auto max-w-1200">. For long-form text, usemax-w-2xl. - Typography Roles: Use
font-metalfont(Bebas Neue) for H1-H3 headers andfont-robotofor body content. - Semantic Colors Only: Never hardcode colors like
#00ff00. Usetext-primary,bg-primary, orborder-secondary. - DaisyUI Hierarchy: Use
.tabs-boxedfor tabbed navigation and.navbarfor headers. - Animated Entrance: For banners or new sections, use
opacity-0 -translate-y-2.5with aDOMContentLoadedscript to triggeropacity-100 translate-y-0.
⚠️ Inconsistencies
- Container Max-Widths: Inconsistent usage of
max-w-1200vsmax-w-7xlacross listing pages. Rule: Prefermax-w-1200for the main dashboard andmax-w-2xlfor articles. - Card Styling: Some cards use
bg-[#011627]/90while others usebg-base-100/20. Rule: Usebg-[#011627]/90for primary content cards. - Inconsistent Buttons: Some buttons use manual
bg-secondaryinstead of the DaisyUI.btn-secondarycomponent class. Rule: Always use.btn.