[ Axiom 01 ]

Craft beautiful interfaces with less markup — Axiom01 enhances your HTML, not your class count.🔥

Read the Docs Get Axiom

What Makes Axiom01 Different

Axiom01 is a thoughtfully designed UI framework that prioritizes simplicity and flexibility. Currently in early development (v0.1.0), it takes a different approach to web interfaces.

Semantic-First Styling

Unlike frameworks that require countless utility classes, Axiom01 styles semantic HTML elements directly, resulting in cleaner markup that's easier to read and maintain.

Class Composition Strategy

Instead of littering your HTML with utility classes, Axiom01 uses strategic class composition that respects the semantic meaning of your elements while providing all the styling power you need.

Powerful Theming Engine

With 20+ built-in themes ranging from professional light/dark modes to vibrant aesthetic options, switching the entire look of your application requires changing just one attribute.

Lightweight Foundation

Designed for performance with a focus on only including what you'll actually use, Axiom01 aims to keep your applications responsive and fast-loading.

Progressive Enhancement

Built to work with the grain of HTML and CSS, not against it, enhancing the natural capabilities of the web platform rather than fighting them.

Accessibility in Mind

Being developed with keyboard navigation and screen reader compatibility as core principles, not afterthoughts.

Getting Started

Start building with Axiom01 in minutes.

Installation

git clone https://github.com/Sol-Roth-Media/axiom01

Or install via NPM:

npm install axiom01

Basic Usage

<link rel="stylesheet" href="css/axiom.css">
<script src="js/scripts.js"></script>

Theming System

Axiom01 comes with a powerful theming system built-in.

Theme Implementation

<html data-theme="dark">

The Axiom Philosophy

The core philosophy behind Axiom is to keep your HTML clean, semantic, and focused on content, while your CSS handles the layout and styling. This approach offers several benefits:

  • Cleaner HTML: No more endless divs with utility classes. Your markup remains meaningful and easy to understand.
  • Faster Development: Spend less time writing CSS and more time building your website's structure and content.
  • Easier Maintenance: Changes to the layout can be made primarily in the CSS, without touching the HTML.
  • More Consistent Design: Axiom's default styles and grid system ensure a consistent look and feel across your website.

Key Features

  • Classless Grid System: Axiom automatically creates grid layouts based on the hierarchy of <main>, <section>, <article>, and <aside> elements.
  • Semantic HTML: Encourages the use of meaningful HTML5 elements for better structure and accessibility.
  • Responsive Design: Layouts automatically adapt to different screen sizes.
  • Consistent Spacing: Built-in spacing system ensures visual harmony.
  • Customizable: Easily adjust colors, fonts, and spacing using CSS variables.
  • Minimalist: Axiom provides a solid foundation without unnecessary bloat.

How to Use Axiom

Using Axiom is simple. Just follow these steps:

  1. Download the Axiom CSS framework from GitHub.
  2. Include the axiom.css file in the <head> of your HTML.
  3. Structure your content using semantic HTML elements like <main>, <section>, <article>, and <aside>.
  4. Let Axiom's default styles and grid system handle the layout.
  5. (Optional) Customize the design using Axiom's CSS variables or by adding your own CSS rules.

For more detailed instructions and examples, refer to the Axiom documentation below.

Axiom's Grid System

Axiom's grid system is designed to be intuitive and classless for basic layouts. It automatically creates layouts based on the nesting of semantic elements. Use the .row class for explicit multi-column control.


Basic Grid Examples (Classless)

Single Column Layout

Direct children of <main> like <section> or <article> will typically stack vertically by default.

Content in a single column section within main.


<main>
    <section>
        <p>Content in a single column section within main.</p>
    </section>
</main>
            

Unequal Columns (e.g., Main Content + Sidebar)

Use an <article> and an <aside> as direct children of a <section> to potentially create a main content/sidebar layout (behaviour might depend on specific CSS grid rules).

Main Content Area

Lorem ipsum dolor sit amet...


<main>
    <section> <!-- Wrapper for article+aside -->
        <article>
            <h5>Main Content Area</h5>
            <p>Lorem ipsum dolor sit amet...</p>
        </article>
        <aside>
            <h5>Sidebar</h5>
            <p>Sidebar content...</p>
        </aside>
    </section>
</main>
            

Explicit Grid Examples (Using `.row`)

Two-Column Layout

Use a <div class="row"> wrapper around direct child elements (like <article>) to create an explicit 12-column grid row. Children will automatically take up space. Use .col-* classes for specific spans.

Content in column 1 (col-6)

Content in column 2 (col-6)


<div class="row">
    <article class="col-6">
        <p>Content in column 1 (col-6)</p>
    </article>
    <article class="col-6">
        <p>Content in column 2 (col-6)</p>
    </article>
</div>
            

Three-Column Layout

Content in column 1 (col-4)

Content in column 2 (col-4)

Content in column 3 (col-4)


<div class="row">
    <article class="col-4">
        <p>Content in column 1 (col-4)</p>
    </article>
    <article class="col-4">
        <p>Content in column 2 (col-4)</p>
    </article>
    <article class="col-4">
        <p>Content in column 3 (col-4)</p>
    </article>
</div>
            

Four-Column Layout

Content in column 1 (col-3)

Content in column 2 (col-3)

Content in column 3 (col-3)

Content in column 4 (col-3)


<div class="row">
    <article class="col-3">
        <p>Content in column 1 (col-3)</p>
    </article>
    <article class="col-3">
        <p>Content in column 2 (col-3)</p>
    </article>
    <article class="col-3">
        <p>Content in column 3 (col-3)</p>
    </article>
    <article class="col-3">
        <p>Content in column 4 (col-3)</p>
    </article>
</div>
            

Typography and Text

Axiom provides a typographic scale and default styles for common text elements.

Headings

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
            

Paragraph

This is a paragraph of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.


<p>This is a paragraph of text...</p>
            

Blockquote

This is a blockquote. It represents content quoted from another source.

- Source Author or Title

<blockquote>
  <p>This is a blockquote...</p>
  <footer>- <cite>Source Author or Title</cite></footer>
</blockquote>
            

Figure and Figcaption

A descriptive placeholder image
This is a figcaption providing context for the figure above.

<figure>
  <img src="placeholder.jpg" alt="Description of image">
  <figcaption>This is a figcaption...</figcaption>
</figure>
            

Code

Use the <code> element for inline snippets, like font-family: var(--a-font-family-sans);.

Use <pre><code class="language-css">...</code></pre> for code blocks:


/* Example CSS code block */
body {
    font-family: var(--a-font-family-sans);
    color: var(--a-color-on-surface);
    background-color: var(--a-color-surface);
}
            

<p>Inline <code>code</code> example.</p>
<pre><code class="language-css">
/* Code block example */
.some-class {
    color: red;
}
</code></pre>
            

Standout Text

You can use utility classes like .standout if defined in your site-specific CSS.

This paragraph uses the "standout" class for emphasis.


<p class="standout">This paragraph uses the "standout" class...</p>
            

Definition List

Term 1
Definition for the first term.
Term 2
Description or definition for the second term.

<dl>
    <dt>Term 1</dt>
    <dd>Definition for the first term.</dd>
    <dt>Term 2</dt>
    <dd>Description or definition for the second term.</dd>
</dl>
            

Text Columns

This paragraph demonstrates text flowing into multiple columns using the .text-columns utility class (if defined). Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.


<div class="text-columns">
    <p>This paragraph demonstrates text flowing into multiple columns...</p>
</div>
            

/* Ensure this or similar exists in site.css or axiom.css */
.text-columns {
    column-count: 2; /* Or more */
    column-gap: var(--a-space-large); /* Adjust gap */
}
            

Components

Reusable interface elements built with Axiom styles and semantic HTML.

Throbber / Loading Indicator

Indicates ongoing processes. Requires CSS for animation.

Basic:

Multi-Ring:

JS Controlled:

<!-- Basic Throbber -->
<div class="throbber" role="status" aria-label="Loading">
    <div class="throbber-circle"></div>
</div>

<!-- Multi-Ring Throbber -->
<div class="throbber" role="status" aria-label="Loading">
    <div class="throbber-circle"></div>
    <div class="throbber-circle inner"></div>
</div>

<!-- JS Controlled (HTML part) -->
<div class="throbber-container">
    <button id="toggle-loading" type="button">Start Loading</button>
    <div id="loading-throbber" class="throbber" role="status" aria-hidden="true">
        <div class="throbber-circle"></div>
    </div>
</div>
                

// Basic JS for the toggle example (Ensure this is in scripts.js)
document.addEventListener('DOMContentLoaded', () => {
    const toggleButton = document.getElementById('toggle-loading');
    const throbber = document.getElementById('loading-throbber');

    if (toggleButton && throbber) { // Check if elements exist
        toggleButton.addEventListener('click', () => {
            const isLoading = throbber.classList.toggle('active');
            throbber.setAttribute('aria-hidden', !isLoading);
            toggleButton.textContent = isLoading ? 'Stop Loading' : 'Start Loading';
        });
    }
});
                

Alerts

Display contextual feedback messages using `alert` and modifier classes.


<div class="alert alert-success" role="alert">
    Success! Your operation was completed.
</div>

<div class="alert alert-error" role="alert">
    Error! Something went wrong.
</div>

<div class="alert alert-info" role="alert">
    Info: This is an informational message.
</div>
                

Show the user's location within the site hierarchy using nested lists.


<nav class="breadcrumbs" aria-label="Breadcrumb">
    <ol>
        <li><a href="#">Home</a></li>
        <li><a href="#">Category</a></li>
        <li aria-current="page">Current Page</li>
    </ol>
</nav>
                

Tooltips

Provide brief information on hover using the `tooltip` class and `data-tooltip` attribute.

Focusable Span

<button type="button" class="tooltip" data-tooltip="Tooltip for the button!">Hover Button</button>

<span class="tooltip" data-tooltip="Tooltip for the span." tabindex="0">Focusable Span</span>
                 

Toast Notifications

Show temporary, non-intrusive messages. Usually triggered by JavaScript.

(Toasts are typically shown dynamically with JavaScript)


<!-- Example Toast Structure (often added/removed by JS) -->
<div class="toast toast-success" role="alert" aria-live="assertive">
    Success! Your changes have been saved.
</div>

<div class="toast toast-error" role="alert" aria-live="assertive">
    Error! Could not perform the action.
</div>
                 

Accordion

Collapsible content panels. Requires JavaScript for interaction.


<section class="accordion">
    <!-- Accordion Item 1 -->
    <div>
        <h4 id="acc1-header"> <!-- Heading level can vary -->
            <button type="button" aria-expanded="false" aria-controls="acc1-content">
                Accordion Title 1
            </button>
        </h4>
        <div id="acc1-content" role="region" aria-labelledby="acc1-header" hidden>
            <p>Panel content 1...</p>
        </div>
    </div>

    <!-- Accordion Item 2 -->
    <div>
        <h4 id="acc2-header">
            <button type="button" aria-expanded="false" aria-controls="acc2-content">
                Accordion Title 2
            </button>
        </h4>
        <div id="acc2-content" role="region" aria-labelledby="acc2-header" hidden>
            <p>Panel content 2...</p>
        </div>
    </div>
</section>
                

// Basic JS for Accordion (Ensure this is in scripts.js and handles multiple accordions)
document.addEventListener('DOMContentLoaded', () => {
    const accordionButtons = document.querySelectorAll('.accordion h4 button[aria-controls]');

    accordionButtons.forEach(button => {
        button.addEventListener('click', () => {
            const panel = document.getElementById(button.getAttribute('aria-controls'));
            const isExpanded = button.getAttribute('aria-expanded') === 'true';

            button.setAttribute('aria-expanded', !isExpanded);
            panel.toggleAttribute('hidden');
        });
        // Add keyboard support (Enter/Space) if not already present
    });
});
                

Tabs

Switch between different content panels. Requires JavaScript for interaction.

This is the content for the 'Info' tab.


<section class="tabs">
    <ul role="tablist" aria-label="Descriptive Label">
        <li role="tab" id="tab1" aria-selected="true" aria-controls="panel1" tabindex="0">Tab 1</li>
        <li role="tab" id="tab2" aria-selected="false" aria-controls="panel2" tabindex="-1">Tab 2</li>
    </ul>
    <div id="panel1" role="tabpanel" aria-labelledby="tab1" tabindex="0">
        <p>Content for Tab 1.</p>
    </div>
    <div id="panel2" role="tabpanel" aria-labelledby="tab2" hidden tabindex="0">
        <p>Content for Tab 2.</p>
    </div>
</section>
                

// Basic JS for Tabs (Ensure this is in scripts.js and handles multiple tab groups)
document.addEventListener('DOMContentLoaded', () => {
    const tabLists = document.querySelectorAll('.tabs [role="tablist"]');
    tabLists.forEach(tabList => {
        const tabs = tabList.querySelectorAll('[role="tab"]');
        tabs.forEach(tab => {
            tab.addEventListener('click', () => {
                // Deactivate all tabs in the group
                tabs.forEach(t => {
                    t.setAttribute('aria-selected', 'false');
                    t.setAttribute('tabindex', '-1');
                    const panel = document.getElementById(t.getAttribute('aria-controls'));
                    if (panel) panel.hidden = true;
                });
                // Activate the clicked tab
                tab.setAttribute('aria-selected', 'true');
                tab.setAttribute('tabindex', '0');
                const activePanel = document.getElementById(tab.getAttribute('aria-controls'));
                if (activePanel) activePanel.hidden = false;
            });
            // Add keyboard navigation (Arrows) if not already present
        });
    });
});
                

Cards

Card Title

This is a card component with minimal classes.

Reveal a list of options on interaction. Requires JavaScript.


<div class="dropdown">
    <button type="button" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false" aria-controls="dd-menu-id">
        Menu
    </button>
    <ul class="dropdown-menu" id="dd-menu-id" role="menu" aria-hidden="true">
        <li role="none"><a href="#" role="menuitem">Option 1</a></li>
        <li role="none"><a href="#" role="menuitem">Option 2</a></li>
        <li role="separator"></li> <!-- Optional -->
        <li role="none"><a href="#" role="menuitem">Option 3</a></li>
    </ul>
</div>
                

// Basic JS for Dropdown (Ensure this is in scripts.js)
document.addEventListener('DOMContentLoaded', () => {
    document.querySelectorAll('.dropdown-toggle').forEach(toggle => {
        toggle.addEventListener('click', () => {
            const menu = toggle.nextElementSibling; // Assumes menu is the next sibling
            const isOpen = menu.classList.toggle('show');
            menu.setAttribute('aria-hidden', !isOpen);
            toggle.setAttribute('aria-expanded', isOpen);
        });
    });
    // Add click outside to close functionality if needed
});
                

Progress Bar

Indicate the completion status of a task. Can be updated with JavaScript.


<label for="prog-bar">Task Progress:</label>
<div class="progress-bar" id="prog-bar" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100">
    <div class="progress" style="width: 50%;"></div>
</div>
                 

// Basic JS for Progress Bar button (Ensure this is in scripts.js)
document.addEventListener('DOMContentLoaded', () => {
    const progressButton = document.querySelector('#progress-bar-demo .progress-btn');
    const progressBar = document.querySelector('#progress-bar-demo .progress-bar');
    const progressInner = progressBar ? progressBar.querySelector('.progress') : null;
    let progressValue = 0; // Start at 0 or current value

    if (progressButton && progressBar && progressInner) {
         // Get initial value if set
         const initialValue = parseInt(progressBar.getAttribute('aria-valuenow'), 10);
         if (!isNaN(initialValue)) {
             progressValue = initialValue;
         }

        progressButton.addEventListener('click', () => {
            progressValue = Math.min(progressValue + 10, 100); // Increment by 10%, max 100%
            if (progressInner) {
                 progressInner.style.width = `${progressValue}%`;
            }
            progressBar.setAttribute('aria-valuenow', progressValue);

            // Optional: Disable button when progress is complete
            if (progressValue === 100) {
                progressButton.textContent = 'Completed!';
                progressButton.disabled = true;
            }
        });
    }
});
                 

The navbar provides consistent page navigation. It includes a logo, main navigation links, a mobile hamburger menu toggle, and a theme switcher. It's designed to be sticky at the top.

Example Structure:

The following HTML is used for the main navigation bar at the top of this page:


<header class="full-bleed">
    <nav class="navbar">
        <!-- Logo with Version -->
        <a href="#" class="logo" aria-label="Axiom Framework Home v0.1">
            <div class="logo-text">
                <span>[</span>
                <span>A</span>
                <span>X</span>
                <span>1</span>
                <span>0</span>
                <span>M</span>
                <span>]</span>
            </div>
            <small class="version">v0.1</small>
        </a>

        <!-- Hamburger Menu Button (for mobile) -->
        <button class="menu-toggle" aria-label="Toggle Navigation" aria-expanded="false" aria-controls="nav-links-main">
            <span class="bar"></span>
            <span class="bar"></span>
            <span class="bar"></span>
        </button>

        <!-- Main Navigation Links -->
        <ul class="nav-links" id="nav-links-main">
            <li><a href="#about">About</a></li>
            <li><a href="#usage">Get started</a></li>
            <!-- ... other list items ... -->
            <li><a href="https://github.com/Sol-Roth-Media/axiom01" target="_blank" rel="noopener noreferrer">GitHub</a></li>
        </ul>

        <!-- Standalone Theme Toggle Button -->
        <button class="theme-toggle" title="Toggle Dark/Light Mode" aria-label="Toggle Dark Light Mode">
             &#9728; <!-- Default to sun icon, JS updates it -->
        </button>
    </nav>
</header>
                

Key CSS Classes & JavaScript:

  • .navbar: Main container for the navigation bar. Styled with flexbox.
  • .logo, .logo-text, .version: For styling the logo and version number.
  • .menu-toggle, .bar: For the mobile hamburger menu. Its visibility and open/close state are controlled by CSS media queries and JavaScript (in js/scripts.js).
  • .nav-links: The `ul` containing the navigation items. JavaScript toggles an .open class for mobile display.
  • .theme-toggle: The button for switching themes. JavaScript handles the theme change and icon update.
  • .full-bleed on <header>: Allows the navbar background to span the full viewport width.

Refer to axiom.css for detailed styling and js/scripts.js for interactive behaviors.

Colors

Axiom provides predefined color variables for consistency.

Color Swatches

Examples of generated color variables:

Primary

Primaryvar(--a-color-primary)
Primary Containervar(--a-color-primary-container)
On Primaryvar(--a-color-on-primary)
On Primary Containervar(--a-color-on-primary-container)

Secondary

Secondaryvar(--a-color-secondary)
Secondary Containervar(--a-color-secondary-container)
On Secondaryvar(--a-color-on-secondary)
On Secondary Containervar(--a-color-on-secondary-container)

Tertiary

Tertiaryvar(--a-color-tertiary)
Tertiary Containervar(--a-color-tertiary-container)
On Tertiaryvar(--a-color-on-tertiary)
On Tertiary Containervar(--a-color-on-tertiary-container)

Grayscale

Neutral shades for backgrounds, text, and UI elements.

Grayscale

Gray 1var(--a-color-gray-1)
Gray 2var(--a-color-gray-2)
Gray 3var(--a-color-gray-3)
Gray 4var(--a-color-gray-4)
Gray 5var(--a-color-gray-5)
Gray 6var(--a-color-gray-6)
Gray 7var(--a-color-gray-7)
Gray 8var(--a-color-gray-8)
Gray 9var(--a-color-gray-9)
Gray 10var(--a-color-gray-10)
Gray 11var(--a-color-gray-11)
Gray 12var(--a-color-gray-12)
Gray 13var(--a-color-gray-13)
Gray 14var(--a-color-gray-14)
Gray 15var(--a-color-gray-15)
Gray 16var(--a-color-gray-16)
Gray 17var(--a-color-gray-17)
Gray 18var(--a-color-gray-18)
Gray 19var(--a-color-gray-19)
Gray 20var(--a-color-gray-20)
Gray 21var(--a-color-gray-21)
Gray 22var(--a-color-gray-22)
Gray 23var(--a-color-gray-23)
Gray 24var(--a-color-gray-24)
Gray 25var(--a-color-gray-25)
Gray 26var(--a-color-gray-26)
Gray 27var(--a-color-gray-27)
Gray 28var(--a-color-gray-28)
Gray 29var(--a-color-gray-29)
Gray 30var(--a-color-gray-30)
Gray 31var(--a-color-gray-31)
Gray 32var(--a-color-gray-32)
Gray 33var(--a-color-gray-33)
Gray 34var(--a-color-gray-34)
Gray 35var(--a-color-gray-35)
Gray 36var(--a-color-gray-36)

Buttons

Various button styles for actions and interactions.

Standard

Outline

Sizes

With Icons

Forms

Examples of form layouts and elements.

Standard Form
of 10

Inline Labels Form

Build System

Axiom01 now includes a build system to help you prepare your project for production.

Using the Build Script

The build script helps validate, concatenate, and minify your CSS and JavaScript files.


# Make the script executable
chmod +x build.sh

# Run the build script
./build.sh

# Or use NPM if you prefer
npm run build
    

The build script will create a dist directory with optimized files ready for production:


<!-- In production, use the optimized files -->
<link rel="stylesheet" href="dist/css/axiom.min.css">
<script src="dist/js/axiom.min.js"></script>
    

Project Configuration

Axiom01 now includes a central configuration file (axiom_config.css) that defines framework-wide settings:

  • Breakpoints: Standardized responsive breakpoints
  • Theme names: Consistent theme naming
  • Build information: Version tracking
  • Framework configuration: Feature flags
  • Animation settings: Timing and easing

Using Standardized Breakpoints

Use the new breakpoint variables in your media queries for consistency:


/* Mobile first approach */
.element {
  /* Base styles for mobile */
}

@media (min-width: var(--a-breakpoint-md)) {
  .element {
    /* Styles for tablets and up */
  }
}

@media (min-width: var(--a-breakpoint-lg)) {
  .element {
    /* Styles for desktops and up */
  }
}
    

Package Management

Axiom01 can now be installed via NPM:


npm install axiom01
    

This allows you to integrate Axiom01 into your existing build processes or frameworks.