# aziontech/azion-theme architecture

> Architecture diagram of the GitHub repository aziontech/azion-theme, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aziontech/azion-theme
- Repository: https://github.com/aziontech/azion-theme

## Overview

##### Project type and purpose
- azion-theme is an open-source style kit/theme library for styling Azion’s front-end applications.
- It publishes SCSS/CSS and JavaScript “theme” artifacts via npm, to be imported by consumer projects (e.g., Azion Console Kit, landing pages, etc.).

##### File structure
- Top-level files & folders
- package.json, default.js, widget.js – entry points and package configuration
- src/azion – all SCSS source modules grouped by concerns
- doc – documentation and cover image
- .github/workflows/release.yml – CI/CD pipeline for versioning and npm publishing
- src/azion breakdown
- theme-base – low-level mixins, component styles organized by category
- extended-components – custom overrides on top of PrimeVue components
- custom – project-specific style modifiers (scroll behavior, focus, code blocks)
- fonts, widgets, variables-widget – entry for widget-specific styling
- theme.scss, theme-widget.scss – top-level SCSS that pulls everything together
- Build & release
- default.js & widget.js import the SCSS bundles and export CSS for npm consumers
- GitHub Actions workflow automates release to npm registry

##### Insights from README
- Primary use: install via npm/yarn, then import ‘azion-theme/light’ or ‘azion-theme/dark’
- Local development uses npm link + hot-reload when paired with a front-end project
- Built on PrimeVue Sass Theme

- Source Layer (SCSS modules)
– Variables (tokens)
– Theme-base (mixins + base components)
– Extended-components (component overrides)
– Custom styles (UI tweaks)
– Widgets (widget specific styles)
- Build Layer
– SCSS Compiler (node-sass or dart-sass)
– JavaScript Bundler (default.js, widget.js)
- Distribution Layer
– CI/CD (GitHub Actions)
– npm Registry (azion-theme package)
- Consumer Layer
– Front-end projects (import theme, apply light/dark)
– Local dev with npm link & hot reload
- Documentation
– doc folder, README, CHANGELOG

- theme.scss & theme-widget.scss → Build Layer → CSS/JS artifacts
- Build Layer → CI/CD → npm Registry
- npm Registry → Consumer projects
- For local dev: Consumer projects ← npm link ← azion-theme source

c. Architectural patterns & design principles
- Layered modular architecture for SCSS (design tokens at core, then base, then overrides)
- Single-responsibility: each folder focuses on one type of style definition
- CI/CD-driven release management
- Extensibility via npm linking and custom override layers

d. Key technologies & frameworks
- SCSS (Sass)
- Node.js build scripts (default.js, widget.js)
- GitHub Actions for CI/CD
- npm for packaging & distribution
- PrimeVue Sass Theme as baseline

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Source Layer
    subgraph "Source Layer"
        direction TB
        Variables["Variables (Design Tokens)"]:::source
        CoreVars["_variables.scss"]:::source
        ThemeBase["Theme-base (Mixins & Base Components)"]:::source
        Mixins["_mixins.scss"]:::source
        Common["_common.scss"]:::source
        Colors["_colors.scss"]:::source
        ComponentsBundle["_components.scss"]:::source
        ComponentsDir["components"]:::source
        Extended["Extended-components (PrimeVue Overrides)"]:::source
        Extensions["_extensions.scss"]:::source
        Custom["Custom Styles (UI Tweaks)"]:::source
        CustomImport["_custom.scss"]:::source
        Fonts["_fonts.scss"]:::source
        WidgetVars["_variables-widget.scss"]:::source
        Widgets["Widgets"]:::source
        ThemeEntry["theme.scss"]:::source
        WidgetEntry["theme-widget.scss"]:::source
    end

    %% Build Layer
    subgraph "Build Layer"
        direction TB
        SCSSCompiler["SCSS Compiler"]:::build
        JSDefault["default.js (JS Bundler)"]:::build
        JSWidget["widget.js (JS Bundler)"]:::build
    end

    %% Distribution Layer
    subgraph "Distribution & CI/CD"
        direction TB
        CI["CI/CD Pipeline"]:::build
        NPM["npm Registry"]:::dist
    end

    %% Consumer Layer
    subgraph "Consumer Layer"
        direction TB
        Consumers["Front-end Projects"]:::dist
        LocalDev["Local Dev (npm link + hot reload)"]:::dist
    end

    %% Documentation
    Docs["Documentation (doc/)"]:::dist

    %% Relationships
    Variables --> CoreVars
    Variables --> ThemeBase
    CoreVars --> ThemeBase
    ThemeBase --> Mixins
    ThemeBase --> Common
    ThemeBase --> Colors
    ThemeBase --> ComponentsBundle
    ThemeBase --> ComponentsDir
    Variables --> Extended
    Extended --> Extensions
    ThemeBase --> Custom
    Extended --> Custom
    Custom --> CustomImport
    Fonts --> Widgets
    WidgetVars --> Widgets
    Custom --> ThemeEntry
    Widgets --> WidgetEntry
    ThemeEntry --> SCSSCompiler
    WidgetEntry --> SCSSCompiler
    SCSSCompiler --> JSDefault
    SCSSCompiler --> JSWidget
    JSDefault --> CI
    JSWidget --> CI
    CI --> NPM
    NPM --> Consumers
    NPM --> LocalDev
    LocalDev --> Consumers
    Docs --> Consumers

    %% Click Events
    click Variables "https://github.com/aziontech/azion-theme/tree/main/src/azion/variables"
    click CoreVars "https://github.com/aziontech/azion-theme/blob/main/src/azion/_variables.scss"
    click WidgetVars "https://github.com/aziontech/azion-theme/blob/main/src/azion/_variables-widget.scss"
    click ThemeBase "https://github.com/aziontech/azion-theme/tree/main/src/azion/theme-base"
    click Mixins "https://github.com/aziontech/azion-theme/blob/main/src/azion/theme-base/_mixins.scss"
    click Common "https://github.com/aziontech/azion-theme/blob/main/src/azion/theme-base/_common.scss"
    click Colors "https://github.com/aziontech/azion-theme/blob/main/src/azion/theme-base/_colors.scss"
    click ComponentsBundle "https://github.com/aziontech/azion-theme/blob/main/src/azion/theme-base/_components.scss"
    click ComponentsDir "https://github.com/aziontech/azion-theme/tree/main/src/azion/theme-base/components"
    click Extended "https://github.com/aziontech/azion-theme/tree/main/src/azion/extended-components"
    click Extensions "https://github.com/aziontech/azion-theme/blob/main/src/azion/_extensions.scss"
    click Custom "https://github.com/aziontech/azion-theme/tree/main/src/azion/custom"
    click CustomImport "https://github.com/aziontech/azion-theme/blob/main/src/azion/_custom.scss"
    click Fonts "https://github.com/aziontech/azion-theme/blob/main/src/azion/_fonts.scss"
    click ThemeEntry "https://github.com/aziontech/azion-theme/blob/main/src/azion/theme.scss"
    click WidgetEntry "https://github.com/aziontech/azion-theme/blob/main/src/azion/theme-widget.scss"
    click JSDefault "https://github.com/aziontech/azion-theme/blob/main/default.js"
    click JSWidget "https://github.com/aziontech/azion-theme/blob/main/widget.js"
    click CI "https://github.com/aziontech/azion-theme/blob/main/.github/workflows/release.yml"
    click Docs "https://github.com/aziontech/azion-theme/tree/main/doc/"

    %% Styles
    classDef source fill:#cce5ff,stroke:#3399ff,color:#003366;
    classDef build fill:#d4edda,stroke:#28a745,color:#155724;
    classDef dist fill:#ffe5cc,stroke:#ff9933,color:#663300;
```
