01. Design

This style guide documents the design system for the Layout Optimizer project. It serves as a central reference for designers and developers to ensure consistency and coherence across the application.

The design adopts a functional, dark-themed aesthetic prioritizing clarity, utility, and information hierarchy. This approach is well-suited for technical tools and applications where task efficiency and data visibility are paramount. While not strictly adhering to a specific design movement (like Material Design or Fluent), it follows modern usability principles with a custom, practical implementation.

Core Principles

  • Consistency: A systematic approach using CSS variables (design tokens) for colors, spacing, and typography ensures uniformity.
  • Clarity & Contrast: A constrained dark color palette with light text provides high contrast for readability. Important information and interactive elements are clearly distinguishable.
  • Hierarchy: Visual hierarchy is established through typography (size, weight), spacing, and component styling, guiding the user's focus.
  • Utility: Components and layout patterns are designed for functional efficiency, supporting user workflows within the application.

02. Color Palette

The color system uses CSS variables for easy management and consistency. The palette is designed for a dark theme, emphasizing contrast and using accent colors purposefully.

foreground-brighter
foreground
foreground-darker
background-brighter
background
background-darker
accent-01-brighter
accent-01
accent-01-darker
accent-02-brighter
accent-02
accent-02-darker
accent-03-brighter
accent-03
accent-03-darker

03. Typography

Typography plays a crucial role in establishing hierarchy and readability. The system uses standard web fonts and a clear scale.

Font Families

  • Primary: var(--font-family-01) (Arial, Helvetica, sans-serif) - Used for headings and body text.
  • Secondary: var(--font-family-02) (monospace) - Used for code examples.

Heading Styles

Below are examples of different heading levels:

Heading Level 1

Heading Level 2

Heading Level 3

Heading Level 4

Body Text & Inline Elements

This is standard paragraph text. It uses var(--font-family-01) and var(--color-foreground). You can use strong text (--color-foreground-brighter) for emphasis or italicized text for subtle highlights. Here's a link example demonstrating the standard link style with an underline.

Blockquote

This is a blockquote. Use it to highlight important quotes or callouts. It features a distinct background (--color-background-darker) and border style.

04. Button Styles

Buttons provide clear calls to action. The system includes primary and secondary styles, as well as size variations.

Button Classes & Usage

  • .button: Base class, should be used alongside a modifier.
  • .button--primary: For the main call to action on a page. Uses --color-foreground for background and --color-background for text.
  • .button--secondary: For secondary actions. Uses a transparent background with a --color-foreground border and text.
  • .button--small: Reduces padding and font size for contexts requiring smaller buttons.
  • .button--large: Increases padding and font size for contexts requiring larger, more prominent buttons.

Examples

Primary & Secondary:

Sizes:

05. UI Components

Common interface elements are styled consistently.

Dropdown

Used for selecting one option from a list.

Form Elements

Standard inputs for user data collection.

Text Input

Radio Buttons

Checkboxes

Alerts / Messages

Used to convey important status information to the user.

Info: This is an informational message. Uses --color-foreground.
Success: Your action was completed successfully. Uses --color-accent-01 (rgba(150, 222, 162, 0.75)).
Warning: Please review your input before proceeding. Uses --color-accent-03 (rgb(198, 170, 86)).
Error: Something went wrong. Please try again. Uses --color-accent-02 (rgb(228, 105, 105)).

06. List Styles

Standard HTML lists are styled for readability.

Unordered List

  • First unordered list item
  • Second unordered list item with a link
  • Third unordered list item
    • Nested list item
    • Another nested item

Ordered List

  1. First ordered list item
  2. Second ordered list item
  3. Third ordered list item
    1. Nested ordered item
    2. Another nested item

Definition List

Definition Term
This is the definition description. It explains the term above.
Another Term
Each term can have one or more descriptions.

07. Code Examples

Code is displayed using monospace font and distinct background colors.

Inline Code

Inline code, such as const variable = true;, uses the code element and --color-background-brighter.

Code Block

Multi-line code blocks use the pre and code elements with --color-background-darker.

function greet(name) {
  // Check if a name was provided
  if (name) {
    console.log(`Hello, ${name}!`);
  } else {
    console.log("Hello there!");
  }
}

greet("Style Guide User");

Keyboard Input

Keyboard commands like Ctrl + S are styled using the kbd tag for clarity.

Job Manager System

Overview

The Job Manager is a web-based application for managing job cards, primarily focused on fabric cutting and layout optimization. It provides a split-panel interface with a job list on the left and detailed job information on the right.

Interface Structure

Left Panel (420px)

  • Search functionality for filtering jobs
  • Scrollable list of job cards showing:
    • Job ID
    • Project name
    • Client name
    • Job description
    • Start and due dates
    • Edit/Create button

Right Panel (Remaining Width)

  • Job card header with export buttons (PDF/CSV)
  • Detailed job information including:
    • Job ID (prominently displayed)
    • Project details
    • Client information
    • Material specifications
    • Cut list tables

Core Components

JobManager Class

Main controller class that:

  • Initializes the application
  • Manages event listeners
  • Handles job selection and editing
  • Controls export functionality

JobService Class

Handles all job data operations:

  • Loading and saving jobs
  • Managing job state
  • Data validation

JobList Class

Manages the job list interface:

  • Rendering job cards
  • Handling search/filter
  • Managing selection state

JobCardPDF Class

Handles the detailed job view:

  • Rendering detailed job information
  • Managing templates
  • Handling PDF generation

Data Management

Storage Structure

{
    job_id: string,
    project_name: string,
    client_name: string,
    job_description: string,
    start_date: string,
    due_date: string,
    base_material: string,
    bm_stripe_grain: string,
    bm_width: string,
    bm_length: string,
    bm_kerf: string,
    notes: string,
    panels: {
        default: Array,
        'Box Cushions': Array
    }
}

Storage Methods

  • Individual jobs: localStorage.setItem('job_${jobId}', JSON.stringify(jobData))
  • CSV data cache: localStorage.setItem('jobListCSV', csvData)
  • Selected job: localStorage.setItem('selectedJobId', jobId)

User Workflows

Job Selection

  1. Browse jobs in left panel
  2. Use search to filter by ID/client/description
  3. Click job card to view details

Job Creation

  1. Use template job (#000)
  2. Click "Create Job"
  3. Fill required information
  4. Save to create new entry

Job Editing

  1. Click Edit button on job card
  2. Modify fields in edit mode
  3. Save changes (updates both memory and localStorage)

Export Options

PDF Export

  • Creates printable version
  • Maintains styling
  • Auto-opens print dialog
  • Auto-closes after printing

CSV Export

  • Downloads job data as CSV
  • Includes all job fields
  • Named with job ID

Best Practices

  • Use search for finding specific jobs
  • Save changes before switching jobs
  • Use template for new jobs
  • Preview PDF before printing
  • Keep job IDs unique
  • Ensure data completeness

Responsive Design

  • Left panel becomes full width on mobile
  • Right panel stacks below
  • UI elements adapt to screen size
  • Print layout optimized for A4

Error Handling

  • Loading states during data fetch
  • Error states with retry options
  • Field validation
  • Graceful data fallbacks