Vanilla Design System

An open-source, vanilla implementation of Saudi Arabia's National Design System. Production-ready HTML, CSS, and JavaScript built from scratch with zero dependencies.

About The Project

Why it was built, and what it covers.

Credit to the Digital Government Authority (DGA) for its outstanding work in unifying Saudi Arabia's government websites and services under a single, coherent design language. The specifications published on Figma are clear and comprehensive; however, translating them into working code remains a challenge for most teams.

The DGA's official implementation is a React and Storybook component library that covers the core UI components. This project provides the same design system in plain HTML, CSS, and JavaScript, and includes all components, a layout system, page templates, documentation, and a complete development environment. No framework is required.

Compliance Ready

Official DGA page templates, converted into live, working code and ready for deployment.

Every component adheres to the official design tokens, typography, spacing, and interaction patterns. The templates below cover the most common government service screens, ready to copy, populate with your content, and publish.

Real-World Examples

5 composed pages showing NDS components working together in real government service contexts.

Components (74)

Each with markup, styling, and JavaScript behavior. All built from scratch.

Architecture & Performance

Built with a performance-first and compatibility approach.

Zero Dependencies

No Bootstrap, Tailwind, jQuery, or framework runtime. The output is plain HTML, CSS, and JavaScript that works in any environment. No conflicts with existing scripts or stylesheets. Drop it into any project regardless of tech stack.

Smart Component Loader

A single DOM sweep on page load detects which components are present and initializes them in priority order. The rest remain idle with zero runtime cost. Resources are only allocated for what the page actually uses.

RTL/LTR Native

Built with CSS Logical Properties from the start. Margins, paddings, borders, and positions adapt automatically. No separate RTL stylesheet. No overrides. Switch direction with a single HTML attribute.

3-Tier Design Tokens

Color tokens, semantic tokens, and component tokens, all defined as CSS custom properties. Each component exposes public properties for customization while keeping internal styles private, no overrides needed.

~6 KB Critical CSS (gzipped)

Critical styles load immediately for instant render. The rest is deferred and loads asynchronously without blocking the page. Styles are split between critical and non-critical at the build level.

~84 KB Total JS (gzipped)

The full component library in a single bundle for better compression, simpler deployment, and minimum requests. Components initialize as needed.

Web Vitals Compliant

100% Google PageSpeed score. LCP, CLS, and INP all pass. Measured and optimized for real-world conditions. Tested across desktop and mobile on both fast and limited connections.

Sleek Animations

GPU-accelerated animations with optimized scheduling deliver smooth transitions even on lower-end devices, with a native application feel. Off-screen elements are not rendered until needed.

Development Environment

Everything needed to build, modify, and extend the system.

The project is built on Jekyll, a static site generator natively supported by GitHub Pages. It compiles templates, stylesheets, and data files into static HTML with no external toolchain.

Sass Architecture

Sass with a modular file structure. Each component has its own stylesheet. Variables, mixins, and design tokens are shared across all files. Jekyll compiles and minifies everything into a single CSS output.

Modular JavaScript

Vanilla JavaScript with one file per component, controlled by a smart loader. Only active components initialize on each page. A Ruby processor bundles and minifies using Terser.

Liquid Templates

Jekyll's built-in template engine. Supports layouts, includes, partials, loops, conditions, and data binding. Pages are composed from reusable blocks with no duplicated markup.

YAML-Driven Data

YAML files act as a flat-file database for the project. Menus, navigation, hero content, and site configuration are stored as structured data and fed into templates at build time.

Custom Plugins

Custom Ruby scripts that extend Jekyll's build process. Handle JS bundling, HTML compression, baseurl resolution, and more. Each plugin is project-specific and fully editable.

AI Integration

Configured for Claude Code AI assistant with custom skills for documentation, content creation, code review, and component auditing. The codebase is structured for effective AI-assisted development.

Open Source

MIT licensed. Full source code included.

Download

Compiled HTML, CSS, and JavaScript ready to use. Source files included as reference.

Fork

Full source code with build system, templates, and tooling.

Contribute

Report issues, suggest improvements, or submit pull requests on GitHub.