Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 83 additions & 28 deletions .jules/rules/design.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,120 @@
---
description: Vibe coding guidelines and architectural constraints for Vibe Coding within the Documentation domain.
tags: [vibe-coding, documentation, best-practices, architecture]
topic: Vibe Coding
complexity: Architect
last_evolution: 2026-03-29
vibe_coding_ready: true
technology: Vibe Coding
technology: UI/UX Design
domain: Documentation
level: Senior/Architect
version: Latest
tags: [vibe-coding, documentation, best-practices, architecture, design-system, accessibility]
ai_role: Senior Vibe Coding Expert
last_updated: 2026-03-29---# 🎨 UI/UX Design & Styling Rules for Jules
## 1. Context & Scope
last_updated: 2026-03-29
---

# 🎨 UI/UX Design & Styling Rules for Jules

This document outlines the core styling rules and design principles for generating UI components, emphasizing accessibility, responsive design, and component architecture.

## 📖 1. Context & Scope
- **Primary Goal:** Maintain a consistent, **accessible (a11y)**, and visually appealing user interface across all applications through strict **responsive design** practices.
- **Target Tooling:** Jules AI agent (UI Generation & CSS Audits).
- **Tech Stack Version:** Agnostic (CSS, SCSS, Tailwind, Material UI, etc.).

<div align="center">
<img src="https://img.icons8.com/?size=100&id=65664&format=png&color=000000" width="100" alt="Design Overview">
</div>

---
## 2. Design System & Styling Rules
## 🎨 2. Design System & Styling Rules

> [!CAUTION]
> **Hardcoded Values:** Never use hardcoded colors, spacing, or typography values (`#FF0000`, `14px`). Always use established **Design Tokens** (e.g., CSS Variables or Tailwind classes like `text-primary`, `p-4`).

### Responsive & Adaptive Principles
1. **Mobile-First Approach:** Always write base CSS for mobile screens first, then progressively enhance the design for larger screens using `min-width` media queries.
2. **Fluid Layouts:** Prefer relative units (`rem`, `em`, `vh`, `vw`, `%`) over absolute units (`px`) for layout structures and typography to allow proper scaling.
### ❌ Bad Practice
```css
.card {
margin: 20px;
background-color: #ffffff;
color: #333333;
}
```

### ⚠️ Problem
Using hardcoded absolute values (`20px`, hex codes) creates inconsistencies across the application. It prevents dynamic theming (e.g., Dark Mode) and breaks structural rhythm when responsive layouts scale.

### Accessibility (A11y) Standards
1. **Semantic HTML:** Use native, meaningful HTML5 tags (`<button>`, `<nav>`, `<main>`, `<article>`) instead of generic `<div>` wrappers with click handlers.
2. **Keyboard Navigation:** Ensure every interactive element is reachable via the `Tab` key and visually indicates focus (`:focus-visible`).
3. **Contrast & ARIA:** Maintain a WCAG AA-compliant contrast ratio (minimum 4.5:1 for normal text). Use WAI-ARIA attributes (`aria-label`, `aria-hidden`) only when semantic HTML is insufficient.
### ✅ Best Practice
```css
.card {
margin: var(--spacing-lg);
background-color: var(--bg-surface);
color: var(--text-primary);
}
```

### UI Component Architecture
### 🚀 Solution
Strictly utilize **Design Tokens**. They establish a single source of truth for all visual properties, allowing the application to scale efficiently while maintaining a unified, easily adjustable design system.

---
## 📱 3. Responsive & Adaptive Principles

### ❌ Bad Practice
```css
.hero-text {
font-size: 32px;
}
```

### ⚠️ Problem
Absolute units like `px` for layout and typography ignore user preference settings in the browser and do not scale fluidly across different viewport sizes.

### ✅ Best Practice
```css
.hero-text {
font-size: 2rem;
}
```

### 🚀 Solution
Prefer relative units (`rem`, `em`, `vh`, `vw`, `%`). Always employ a **Mobile-First Approach**, defining base CSS for mobile screens and progressively enhancing the layout for larger viewports using `min-width` media queries.

---
## ♿ 4. Accessibility (A11y) Standards

### ❌ Bad Practice
```html
<div role="button" tabindex="0" class="btn" onclick="openModal()">Click Me</div>
```

### ⚠️ Problem
Using generic `<div>` wrappers and artificially attaching ARIA roles or keyboard handlers increases code complexity and often misses nuanced accessibility behaviors that native elements provide out-of-the-box.

### ✅ Best Practice
```html
<button class="btn" onclick="openModal()">Click Me</button>
```

### 🚀 Solution
Enforce **Semantic HTML**. Use native HTML5 tags (`<button>`, `<nav>`, `<main>`). Ensure interactive elements are keyboard reachable and visually indicate focus via `:focus-visible`. Maintain a minimum contrast ratio of 4.5:1 for standard text.

---
## 🏗️ 5. UI Component Architecture

```mermaid
graph TD
Tokens[Design Tokens: Colors, Spacing] --> Elements[Atomic Elements: Buttons, Inputs]
Elements --> Components[Complex Components: Cards, Modals]
Components --> Layouts[Page Layouts: Grids, Sections]

class Tokens auto_style_Tokens
class Elements auto_style_Elements
class Components auto_style_Components
%% Added Design Token Styles for Mermaid Diagrams
classDef default fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px,color:#000;
classDef component fill:#e8f5e9,stroke:#4caf50,stroke-width:2px,color:#000;
classDef layout fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px,color:#000;

class Tokens layout;
class Elements default;
class Components component;
class Layouts component;


%% Auto-generated Design Tokens
classDef auto_style_Tokens fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px,color:#000
classDef auto_style_Elements fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px,color:#000
classDef auto_style_Components fill:#e8f5e9,stroke:#4caf50,stroke-width:2px,color:#000
```

---
## 3. Checklist for Jules Agent
## ✅ 6. Checklist for Jules Agent

When generating UI components or modifying styles:
- [ ] Verify that the component works properly on mobile (`320px`), tablet, and desktop viewports.
Expand Down
113 changes: 89 additions & 24 deletions .jules/rules/ui-ux-design.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,116 @@
---
description: "UI/UX Design and Styling Rules for Jules AI agent, covering responsive design, accessibility (a11y), design systems, and UI component architecture."
tags:
technology: Vibe Coding
technology: UI/UX Design
domain: Documentation
level: Senior/Architect
version: Latest
tags: [vibe-coding, documentation, best-practices, architecture, design-system, accessibility]
ai_role: Senior Vibe Coding Expert
last_updated: 2026-03-29
topic: Vibe Coding
complexity: Architect
last_evolution: 2026-03-29
vibe_coding_ready: true---
---

# 🎨 UI/UX Design Production-Ready Best Practices

This document outlines the production-ready best practices for UI/UX Design and styling, specifically tailored for the Jules AI agent. It ensures consistent, accessible, and responsive user interfaces.
## 1. Context & Scope

## 📖 1. Context & Scope
- **Primary Goal:** Maintain a consistent, **accessible (a11y)**, and visually appealing user interface across all applications through strict **responsive design** practices.
- **Target Tooling:** Jules AI agent (UI Generation & CSS Audits).
- **Tech Stack Version:** Agnostic (CSS, SCSS, Tailwind, Material UI, etc.).

<div align="center">
<img src="https://img.icons8.com/?size=100&id=65664&format=png&color=000000" width="100" alt="Design Overview">
</div>

---
## 2. Design System & Styling Rules
## 🎨 2. Design System & Styling Rules

> [!CAUTION]
> **Hardcoded Values:** Never use hardcoded colors, spacing, or typography values (`#FF0000`, `14px`). Always use established **Design Tokens** (e.g., CSS Variables or Tailwind classes like `text-primary`, `p-4`).

### Hardcoded vs Design Tokens Comparison
### ❌ Bad Practice
```css
.button {
background-color: #FF0000;
padding: 14px 20px;
font-size: 16px;
border-radius: 4px;
}
```

| Aspect | Hardcoded Value (Avoid) | Design Token (Prefer) | Benefits |
| :--- | :--- | :--- | :--- |
| **Colors** | `#FF0000`, `rgb(255, 0, 0)` | `var(--color-primary)`, `text-primary` | Theming, consistency, single source of truth |
| **Spacing** | `14px`, `20px` | `var(--spacing-md)`, `p-4` | Rhythm, responsiveness |
| **Typography** | `16px`, `bold` | `var(--font-size-base)`, `text-base font-bold` | Scalability, accessibility |
### ⚠️ Problem
Hardcoded values create inconsistencies, complicate theming (like dark mode), and make broad design updates a nightmare. They lack semantic meaning, leading to bloated stylesheets and a fragile codebase.

### Responsive & Adaptive Principles
1. **Mobile-First Approach:** Always write base CSS for mobile screens first, then progressively enhance the design for larger screens using `min-width` media queries.
2. **Fluid Layouts:** Prefer relative units (`rem`, `em`, `vh`, `vw`, `%`) over absolute units (`px`) for layout structures and typography to allow proper scaling.
### ✅ Best Practice
```css
.button {
background-color: var(--color-primary);
padding: var(--spacing-md) var(--spacing-lg);
font-size: var(--font-size-base);
border-radius: var(--radius-sm);
}
```

### 🚀 Solution
Design Tokens centralize stylistic values. By referencing variables (e.g., CSS Custom Properties or Utility Classes), you ensure systemic consistency, simplify maintenance, and enable rapid theming and scalability across applications.

### Accessibility (A11y) Standards
1. **Semantic HTML:** Use native, meaningful HTML5 tags (`<button>`, `<nav>`, `<main>`, `<article>`) instead of generic `<div>` wrappers with click handlers.
2. **Keyboard Navigation:** Ensure every interactive element is reachable via the `Tab` key and visually indicates focus (`:focus-visible`).
3. **Contrast & ARIA:** Maintain a WCAG AA-compliant contrast ratio (minimum 4.5:1 for normal text). Use WAI-ARIA attributes (`aria-label`, `aria-hidden`) only when semantic HTML is insufficient.
---
## 📱 3. Responsive & Adaptive Principles

### UI Component Architecture
### ❌ Bad Practice
```css
.container {
width: 960px;
}

@media (max-width: 768px) {
.container {
width: 100%;
}
}
```

### ⚠️ Problem
A desktop-first approach with absolute units (`px`) often leads to horizontal scrolling on mobile devices and rigid layouts that break unpredictably on intermediate screen sizes.

### ✅ Best Practice
```css
.container {
width: 100%;
padding: 1rem;
}

@media (min-width: 768px) {
.container {
max-width: 48rem;
padding: 2rem;
}
}
```

### 🚀 Solution
Implement a **Mobile-First Approach** using relative units (`rem`, `%`). Establish base styles for mobile, then progressively enhance for larger viewports via `min-width` media queries. This ensures fluid, universally adaptable layouts.

---
## ♿ 4. Accessibility (A11y) Standards

### ❌ Bad Practice
```html
<div class="submit-button" onclick="submitForm()">Submit</div>
```

### ⚠️ Problem
Generic wrappers like `<div>` lack semantic meaning. Screen readers will not announce them as interactive, and they cannot be naturally focused via keyboard navigation (`Tab`), excluding users relying on assistive technologies.

### ✅ Best Practice
```html
<button class="submit-button" type="submit" aria-label="Submit Form">Submit</button>
```

### 🚀 Solution
Enforce Semantic HTML. Native elements provide built-in accessibility. Ensure interactive components possess visual focus states (`:focus-visible`), maintain WCAG AA contrast (4.5:1), and appropriately utilize ARIA attributes only when native semantics are insufficient.

---
## 🏗️ 5. UI Component Architecture

```mermaid
graph TD
Expand All @@ -64,8 +128,9 @@ graph TD
class Components component;
class Layouts component;
```

---
## 3. Checklist for Jules Agent
## ✅ 6. Checklist for Jules Agent

When generating UI components or modifying styles:
- [ ] Verify that the component works properly on mobile (`320px`), tablet, and desktop viewports.
Expand Down
5 changes: 5 additions & 0 deletions frontend/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ This folder acts as a container for documentation around the following technolog
- [React](./react/readme.md)
- [SolidJS](./solidjs/readme.md)
- [Qwik](./qwik/readme.md)

## 🎨 UI/UX Design & Styling

- [UI/UX Design Production-Ready Best Practices](../.jules/rules/ui-ux-design.md)
- [UI/UX Design & Styling Rules for Jules](../.jules/rules/design.md)
Loading