Skip to content
Open
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ graph TD
* ⚡ [performance.md](./frontend/angular/performance.md)
* 📄 [readme.md](./frontend/angular/readme.md)
* 📦 [state-management.md](./frontend/angular/state-management.md)
* 🎨 **[design-ui/](./frontend/design-ui/)**
* ♿ [accessibility.md](./frontend/design-ui/accessibility.md)
* 🏗️ [component-architecture.md](./frontend/design-ui/component-architecture.md)
* 📄 [readme.md](./frontend/design-ui/readme.md)
* 📱 [responsive-design.md](./frontend/design-ui/responsive-design.md)
* 🎨 [styling.md](./frontend/design-ui/styling.md)
* 🟨 **[javascript/](./frontend/javascript/)**
* 📄 [readme.md](./frontend/javascript/readme.md)
* 🟦 **[typescript/](./frontend/typescript/)**
Expand Down Expand Up @@ -436,6 +442,12 @@ graph TD
* ⚡ [performance.md](./frontend/angular/performance.md)
* 📄 [readme.md](./frontend/angular/readme.md)
* 📦 [state-management.md](./frontend/angular/state-management.md)
* 🎨 **[design-ui/](./frontend/design-ui/)**
* ♿ [accessibility.md](./frontend/design-ui/accessibility.md)
* 🏗️ [component-architecture.md](./frontend/design-ui/component-architecture.md)
* 📄 [readme.md](./frontend/design-ui/readme.md)
* 📱 [responsive-design.md](./frontend/design-ui/responsive-design.md)
* 🎨 [styling.md](./frontend/design-ui/styling.md)
* 🟨 **[javascript/](./frontend/javascript/)**
* 📄 [readme.md](./frontend/javascript/readme.md)
* 🟦 **[typescript/](./frontend/typescript/)**
Expand Down
4 changes: 4 additions & 0 deletions _sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@
* [Testing](frontend/angular/testing.md)
* **Design ui**
* [Overview](frontend/design-ui/readme.md)
* [Accessibility](frontend/design-ui/accessibility.md)
* [Component architecture](frontend/design-ui/component-architecture.md)
* [Responsive design](frontend/design-ui/responsive-design.md)
* [Styling](frontend/design-ui/styling.md)

* **Javascript**
* [Overview](frontend/javascript/readme.md)
* [Async logic](frontend/javascript/async-logic.md)
Expand Down
29 changes: 28 additions & 1 deletion frontend/design-ui/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ This document enforces strict adherence to semantic HTML and accessibility guide

---

## ⚙️ Logic Routing

```mermaid
flowchart TD
User([User Interaction: Space/Enter]) --> Element{Element Type}
Element -- Semantic HTML --> Browser[Native Browser Handling]
Element -- Generic Wrapper --> JS[Manual JS Event Listeners]
Browser --> Tree[Accessibility Tree]
JS --> Custom[Custom ARIA Logic]
Custom --> Tree

classDef default fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px,color:#000;
classDef component fill:#e8f5e9,stroke:#4caf50,stroke-width:2px,color:#000;
class User default;
class Element component;
class Browser component;
class JS component;
class Tree default;
class Custom component;
```

## ⚖️ Structural Comparison: Accessibility Paradigms

| Paradigm | Interaction Handling | Semantic Clarity | AI Agent Preference | Risk |
Expand Down Expand Up @@ -53,4 +74,10 @@ Using generic `<div>` wrappers and artificially attaching ARIA roles or keyboard


### 🚀 Solution
Enforcing **Semantic HTML** is MANDATORY to guarantee deterministic accessibility tree generation. Native elements inherently support keyboard navigation and screen reader parsing without custom JavaScript logic. This STRICTLY eliminates the performance overhead of manual event listener management and mitigates security risks associated with complex, logic-heavy DOM manipulation handlers.
Enforcing **Semantic HTML** is MANDATORY to guarantee deterministic accessibility tree generation. Native elements inherently support keyboard navigation and screen reader parsing without custom JavaScript logic. This STRICTLY eliminates the performance overhead of manual event listener management and mitigates security risks associated with complex, logic-heavy DOM manipulation handlers.

## ⚙️ Under the Hood

### 🔍 Edge Cases & Mechanics
- **Shadow DOM Isolation:** When building Web Components, the Shadow DOM encapsulates the accessibility tree. Developers MUST use `delegatesFocus: true` and carefully map `aria-labelledby` across the Shadow boundary to ensure screen readers correctly interpret the isolated component's state.
- **Dynamic Content Injection:** SPA architectures frequently mutate the DOM post-load. Live regions (`aria-live="polite"` or `aria-live="assertive"`) MUST be implemented for dynamically injected content (e.g., toast notifications) to trigger deterministic screen reader announcements without stealing programmatic focus.
8 changes: 7 additions & 1 deletion frontend/design-ui/component-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,10 @@ function UserDashboard() {


### 🚀 Solution
Strictly enforcing **Component Hierarchy** is MANDATORY to establish deterministic boundaries. Decoupled components map to independent rendering lifecycles, enabling focused isolation testing and STRICTLY reducing framework reconciliation overhead compared to monolithic structures. This predictable architecture minimizes the blast radius for performance regressions and mitigates Cross-Site Scripting (XSS) risks by isolating state and rendering contexts.
Strictly enforcing **Component Hierarchy** is MANDATORY to establish deterministic boundaries. Decoupled components map to independent rendering lifecycles, enabling focused isolation testing and STRICTLY reducing framework reconciliation overhead compared to monolithic structures. This predictable architecture minimizes the blast radius for performance regressions and mitigates Cross-Site Scripting (XSS) risks by isolating state and rendering contexts.

## ⚙️ Under the Hood

### 🔍 Edge Cases & Mechanics
- **Prop Drilling vs Context Overhead:** While Atomic design encourages passing props down (Tokens -> Elements -> Components), deeply nested layouts suffer from "prop drilling". However, prematurely replacing props with Context API/Signals at the "Element" level triggers global re-renders. State injection MUST be restricted to the "Components" or "Layouts" level to preserve atomic isolation.
- **Hydration Mismatches:** In isomorphic applications, "God Components" that conditionally render based on window objects (e.g., `typeof window !== 'undefined'`) cause severe HTML hydration errors. By splitting layouts into strictly deterministic atomic elements, UI components can render statically, while browser-specific logic is deferred to higher-order wrappers.
2 changes: 2 additions & 0 deletions frontend/design-ui/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ graph LR
B --- C([♿ Accessibility])
C --- D([🏗️ Component Architecture])

%% 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;
class A default;
class B default;
class C default;
Expand Down
29 changes: 28 additions & 1 deletion frontend/design-ui/responsive-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@ This document enforces the strict standards for building fluid, universally adap
---

---
## ⚙️ Logic Routing

```mermaid
flowchart TD
Device{Device Viewport} -->|320px - 767px| Mobile[Base CSS / Mobile]
Device -->|768px - 1023px| Tablet[min-width: 768px]
Device -->|1024px+| Desktop[min-width: 1024px]

Mobile --> Casc[Cascade Evaluation]
Tablet --> Casc
Desktop --> Casc

classDef default fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px,color:#000;
classDef component fill:#e8f5e9,stroke:#4caf50,stroke-width:2px,color:#000;
class Device default;
class Mobile component;
class Tablet component;
class Desktop component;
class Casc default;
```

## ⚖️ Structural Comparison: Responsive Paradigms

| Paradigm | Default Viewport | Scaling Mechanism | AI Agent Preference | Risk |
Expand Down Expand Up @@ -70,4 +91,10 @@ A desktop-first approach with absolute units (`px`) often leads to horizontal sc


### 🚀 Solution
Implementing a **Mobile-First Approach** using relative units is MANDATORY. Enforcing base constraints on mobile and dynamically scaling upward STRICTLY limits layout shift (CLS) and reduces the CSS parser's evaluation overhead. This unified cascading structure inherently standardizes deterministic scaling properties, ensuring robust layout performance and mitigating the risk of unpredictable rendering states.
Implementing a **Mobile-First Approach** using relative units is MANDATORY. Enforcing base constraints on mobile and dynamically scaling upward STRICTLY limits layout shift (CLS) and reduces the CSS parser's evaluation overhead. This unified cascading structure inherently standardizes deterministic scaling properties, ensuring robust layout performance and mitigating the risk of unpredictable rendering states.

## ⚙️ Under the Hood

### 🔍 Edge Cases & Mechanics
- **Sub-Pixel Rendering Issues:** When using percentage-based widths or fractional `rem` values, browsers calculate sub-pixels. This can cause grid alignment errors or wrapping on certain devices. Using CSS Grid with `fr` units or `calc()` functions with explicit roundings mitigates layout breaking in flex containers.
- **Viewport Height Variations:** On mobile browsers, the URL bar dynamically hides/shows, changing the viewport height. Relying on `100vh` leads to hidden content. Developers MUST use `dvh` (dynamic viewport height) or implement JS workarounds for `vh` variables to ensure bottom-anchored UI components remain visible during scrolling.
37 changes: 36 additions & 1 deletion frontend/design-ui/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,35 @@ This document enforces the strict styling rules and constraints regarding design
---

---
## ⚙️ Logic Routing

```mermaid
classDiagram
class DesignTokens {
--color-primary
--spacing-md
--radius-sm
}
class ComponentStyle {
background-color: var(--color-primary)
padding: var(--spacing-md)
}
class ThemeProvider {
Dark Theme Overrides
Light Theme Base
}

ThemeProvider *-- DesignTokens : Controls
DesignTokens *-- ComponentStyle : Injects

%% 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;
class DesignTokens:::component
class ComponentStyle:::default
class ThemeProvider:::component
```

## ⚖️ Structural Comparison: Styling Paradigms

| Paradigm | Value Definition | Reusability | AI Agent Preference | Risk |
Expand Down Expand Up @@ -60,4 +89,10 @@ Using hardcoded absolute values (`20px`, hex codes) creates inconsistencies acro


### 🚀 Solution
Strictly utilizing **Design Tokens** is MANDATORY to establish deterministic visual contracts. Constraining styles strictly to these centrally-managed tokens ensures a single source of truth, reducing CSS payload size and standardizing rendering performance. This pattern STRICTLY prevents arbitrary style manipulation, mitigating style-based injection vulnerabilities and enforcing uncompromised environmental immutability for safe AI Agent parsing.
Strictly utilizing **Design Tokens** is MANDATORY to establish deterministic visual contracts. Constraining styles strictly to these centrally-managed tokens ensures a single source of truth, reducing CSS payload size and standardizing rendering performance. This pattern STRICTLY prevents arbitrary style manipulation, mitigating style-based injection vulnerabilities and enforcing uncompromised environmental immutability for safe AI Agent parsing.

## ⚙️ Under the Hood

### 🔍 Edge Cases & Mechanics
- **CSS Variable Specificity:** CSS variables inherit down the DOM tree. If a component defines a local token (e.g., `--btn-bg`) but fails to scope it properly, child components might inadvertently inherit and override their own default backgrounds. Strict block-level scoping via BEM or CSS Modules is required.
- **Flash of Unstyled Content (FOUC) in SSR:** When implementing Dark Mode using design tokens via JS-injected classes (e.g., `document.documentElement.classList.add('dark')`), Server-Side Rendered apps (Next.js, Angular Universal) will flash the default light theme before hydration. A blocking inline script MUST be placed in the `<head>` to read local storage and inject the correct class before the body parses.
7 changes: 3 additions & 4 deletions frontend/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ This folder acts as a container for documentation around the following technolog
- [Qwik](./qwik/readme.md)

## 🎨 UI/UX Design & Styling
- [Styling Rules](./design-ui/styling.md)
- [Responsive Design](./design-ui/responsive-design.md)
- [UI/UX Design Index](./design-ui/readme.md)
- [Accessibility](./design-ui/accessibility.md)
- [Component Architecture](./design-ui/component-architecture.md)

- [UI/UX Design Index](./design-ui/readme.md)
- [Responsive Design](./design-ui/responsive-design.md)
- [Styling Rules](./design-ui/styling.md)

Loading