Search
Styling and Themes

MindFusion.Dashboards features a modern, CSS-variable-driven styling architecture. Appearance, colors, card elevations, and series palettes are decoupled from imperative code and controlled entirely through clean CSS custom properties.

Predefined Themes

The library ships with three enterprise-grade themes:

1. standard (Executive Midnight & Periwinkle):
The default theme. Combines pure white card surfaces (#ffffff), crisp borders (#e2e8f0), deep Midnight Navy (#1E1B4B) metrics and titles, and vibrant Signature Periwinkle (#8A8EE8 / #5B5FC7) accents.

2. light (Modern Daylight):
A soft, airy palette featuring daylight blues (#0284c7 / #2563eb), warm ambers, fresh greens, and subtle slate borders.

3. dark (Nordic Dark Slate):
A high-contrast dark mode tailored for command centers and financial monitoring. Uses deep slate-navy backgrounds (#0f172a / #1e293b), radiant sky-blue metrics (#38bdf8), and luminous pastel chart accents.

Applying Themes with ThemeManager

Themes are applied globally across all active dashboard widgets, charts, gauges, grids, and calendars using the centralized ThemeManager class:

JavaScript  Copy Code

// Switch the entire dashboard suite to dark mode
MindFusion.Controls.ThemeManager.currentTheme = "dark";

// Switch back to the standard theme
MindFusion.Controls.ThemeManager.currentTheme = "standard";

When ThemeManager.currentTheme is set:

  • All theme stylesheets (<link> tags in document.head) switch dynamically.
  • All registered controls (DashboardView, ChartWidget, GaugeWidget, GridWidget, CalendarWidget) automatically update their internal CSS cache and repaint without requiring manual intervention.

Theme Stylesheet Organization

Theme files are organized modularly across component subdirectories:

  • Root:
    - standard.css: Core charting and diagramming definitions for the standard theme.
    - light.css: Standalone stylesheet for the light theme.
    - dark.css: Standalone stylesheet for the dark theme.
  • Component Directories:
    - themes-db/: Dashboard card containers, KPI values, and trend badges.
     - themes-dv/: DataViews grid headers, alternate rows, and row selections.
     - themes-sch/: Scheduling calendar views, appointment blocks, and header dates.
     - themes-ui/: Window titlebars, toolbars, accordions, and dialogs.

CSS Custom Properties Architecture

Each component category exposes standardized CSS variables:

1. Dashboard Containers & Cards (.mfb-dashboard):
   - Background canvas: background-color (#f1f5f9 in standard, #0f172a in dark).
   - Widget cards: .mfb-widget-container-full (background-color, border, border-radius, box-shadow).
   - KPI values: .mfb-kpi-value (color, font-size, font-weight).
   - Growth indicators: .mfb-kpi-widget-trend-up and .mfb-kpi-widget-trend-down.

2. Charting Properties (--mfc-*):
   - --mfc-background: Chart canvas background.
   - --mfc-plot-background: Inner plot area surface.
   - --mfc-title-brush: Main chart title color.
   - --mfc-axis-stroke: Axis line color.
   - --mfc-grid-line-color: Background gridline dividers.
   - --mfc-data-labels-brush: Inner/outer data labels color.
   - --mfc-common-series-fill-0 to 4: Categorical series fill colors.
   - --mfc-common-series-stroke-0 to 4: Series outline strokes.

3. Gauge Properties (--mfg-*):
   - --mfg-gauge-background: Outer dial backdrop.
   - --mfg-gauge-scale-background: Inner circular or semicircular scale face.
   - --mfg-gauge-scale-stroke: Outer scale rim border.
   - --mfg-gauge-pointer-background: Dial needle color.
   - --mfg-gauge-tick-background: Numerical tick and dial label color.

Customizing Widget Appearance via CSS

Developers can customize specific widget cards by targeting their CSS classes:

CSS  Copy Code

/* Custom rounded card styling for KPI cards */
.mfb-dashboard.standard .mfb-kpi-widget {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.06);
}

/* Custom needle color for all dashboard gauges */
.mfb-dashboard.standard .mfg-oval-gauge {
    --mfg-gauge-pointer-background: #4f46e5;
}