Convert Figma logo to code with AI

mblode logomarx

The classless CSS reset (perfect for Communists).

1,703
99
1,703
13

Top Related Projects

50,071

Modern CSS framework based on Flexbox

19,419

Skeleton: A Dead Simple, Responsive Boilerplate for Mobile-Friendly Development

10,214

A minimalist CSS framework.

11,316

Spectre.css - A Lightweight, Responsive and Modern CSS Framework

A drop-in collection of CSS styles to make simple websites just a little nicer

5,131

MVP.css — Minimalist classless CSS stylesheet for HTML elements

Quick Overview

Marx is a classless CSS reset and boilerplate that provides a minimalist and opinionated starting point for web development projects. It aims to create a consistent and visually appealing base style without the need for complex class structures, making it easy to build upon for custom designs.

Pros

  • Lightweight and minimal, with a small file size
  • Easy to implement and use, requiring no additional classes
  • Provides a clean and modern default appearance for HTML elements
  • Responsive and mobile-friendly out of the box

Cons

  • Limited customization options without modifying the source CSS
  • May not be suitable for complex layouts or designs that require extensive custom styling
  • Some developers may prefer more opinionated frameworks with pre-built components
  • Lack of JavaScript components or interactive elements

Code Examples

  1. Basic HTML structure with Marx:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Marx Example</title>
    <link rel="stylesheet" href="https://unpkg.com/marx-css/css/marx.min.css">
</head>
<body>
    <main>
        <h1>Welcome to Marx</h1>
        <p>This is a simple example using Marx CSS.</p>
    </main>
</body>
</html>
  1. Form styling with Marx:
<form>
    <label for="name">Name:</label>
    <input type="text" id="name" name="name" required>

    <label for="email">Email:</label>
    <input type="email" id="email" name="email" required>

    <button type="submit">Submit</button>
</form>
  1. Responsive grid layout using Marx:
<div class="row">
    <div class="col">
        <h2>Column 1</h2>
        <p>Content for the first column.</p>
    </div>
    <div class="col">
        <h2>Column 2</h2>
        <p>Content for the second column.</p>
    </div>
</div>

Getting Started

To use Marx in your project, simply include the CSS file in your HTML:

<link rel="stylesheet" href="https://unpkg.com/marx-css/css/marx.min.css">

Alternatively, you can install Marx using npm:

npm install marx-css

Then import it in your JavaScript file:

import 'marx-css/css/marx.min.css';

Once included, Marx will automatically style your HTML elements without the need for additional classes.

Competitor Comparisons

50,071

Modern CSS framework based on Flexbox

Pros of Bulma

  • More comprehensive and feature-rich CSS framework
  • Larger community and ecosystem with extensive documentation
  • Modular architecture allowing for customization and partial imports

Cons of Bulma

  • Larger file size and potentially slower load times
  • Steeper learning curve due to more complex class structure
  • May require additional customization to achieve a unique design

Code Comparison

Marx:

body {
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 50em;
  padding: 1em;
}

Bulma:

.container {
  flex-grow: 1;
  margin: 0 auto;
  position: relative;
  width: auto;
}
@media screen and (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
}

Marx provides a simpler, opinionated default styling for basic HTML elements, while Bulma offers a more structured approach with customizable classes and responsive design features.

19,419

Skeleton: A Dead Simple, Responsive Boilerplate for Mobile-Friendly Development

Pros of Skeleton

  • Lighter weight and more minimalist, focusing on core layout and typography
  • Includes a responsive grid system for easier layout creation
  • Provides a mobile-first approach with breakpoints for different screen sizes

Cons of Skeleton

  • Less comprehensive styling for form elements and buttons
  • Fewer pre-styled components compared to Marx
  • May require more custom CSS for complex designs

Code Comparison

Marx:

body {
  color: #333;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.4;
}

Skeleton:

body {
  font-size: 1.5em;
  line-height: 1.6;
  font-weight: 400;
  font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #222;
}

Both frameworks provide basic styling for the body element, but Marx uses a more extensive system font stack, while Skeleton specifies a primary font (Raleway) with fallbacks. Marx also sets a slightly tighter line height compared to Skeleton.

10,214

A minimalist CSS framework.

Pros of Milligram

  • Lighter weight (2kb gzipped) compared to Marx's larger file size
  • More extensive documentation and examples
  • Active development with more recent updates

Cons of Milligram

  • Less opinionated design, requiring more custom styling
  • Fewer pre-styled elements out of the box
  • Lacks some accessibility features present in Marx

Code Comparison

Marx:

body {
  color: #212121;
  font-family: 'Arial', sans-serif;
  line-height: 1.5;
  margin: 0;
  max-width: 100%;
}

Milligram:

body {
  color: #606c76;
  font-family: 'Roboto', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.6em;
  font-weight: 300;
  letter-spacing: .01em;
  line-height: 1.6;
}

Both frameworks provide minimal CSS styling, but Marx offers more opinionated defaults, while Milligram focuses on providing a lightweight foundation for custom designs. Marx includes more accessibility features and pre-styled elements, making it easier to create a functional website quickly. Milligram, on the other hand, offers a smaller file size and more flexibility for customization, but requires more effort to achieve a polished look. The choice between the two depends on project requirements and personal preferences for styling and development approach.

11,316

Spectre.css - A Lightweight, Responsive and Modern CSS Framework

Pros of Spectre

  • More comprehensive framework with a wider range of UI components
  • Better documentation and examples
  • Actively maintained with regular updates

Cons of Spectre

  • Larger file size, potentially impacting page load times
  • Steeper learning curve due to more complex structure
  • Less focused on minimalism compared to Marx

Code Comparison

Marx (CSS):

body {
  color: #333;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.6em;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

Spectre (CSS):

.container {
  margin-left: auto;
  margin-right: auto;
  padding-left: .4rem;
  padding-right: .4rem;
  width: 100%;
}

Marx focuses on basic styling for HTML elements, while Spectre provides more structured classes for layout and components. Marx aims for a classless approach, whereas Spectre relies on utility classes for customization.

Both frameworks offer responsive design, but Spectre provides more granular control through its grid system and utility classes. Marx is ideal for quick prototypes or simple projects, while Spectre is better suited for larger, more complex applications requiring a wider range of UI components and customization options.

A drop-in collection of CSS styles to make simple websites just a little nicer

Pros of Water.css

  • Lighter weight (2.2KB vs 3.5KB for Marx)
  • More customizable with multiple themes and dark mode support
  • Actively maintained with recent updates

Cons of Water.css

  • Less opinionated design, may require more custom styling
  • Fewer pre-styled elements compared to Marx
  • No built-in grid system

Code Comparison

Water.css:

body {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 10px;
  font-family: sans-serif;
  line-height: 1.5;
}

Marx:

body {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

Both CSS frameworks aim to provide simple, classless styling for HTML elements. Water.css focuses on lightweight, customizable designs with multiple themes, while Marx offers a more opinionated, feature-rich approach with a built-in grid system. Water.css is actively maintained and smaller in size, making it suitable for quick prototypes or minimalist designs. Marx, though slightly larger, provides more pre-styled elements and a consistent look out of the box, which may be preferable for certain projects.

5,131

MVP.css — Minimalist classless CSS stylesheet for HTML elements

Pros of MVP

  • More comprehensive set of components and utilities
  • Includes JavaScript functionality for interactive elements
  • Offers a wider range of color options and themes

Cons of MVP

  • Larger file size due to more features
  • Steeper learning curve for beginners
  • Less focused on minimalism compared to Marx

Code Comparison

Marx (CSS):

body {
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  max-width: 50em;
  margin: 0 auto;
  padding: 1em;
}

MVP (CSS):

:root {
  --border-radius: 5px;
  --box-shadow: 2px 2px 10px;
  --color: #118bee;
  --color-accent: #118bee15;
  --color-bg: #fff;
  --color-bg-secondary: #e9e9e9;
  --color-secondary: #920de9;
  --color-secondary-accent: #920de90b;
  --color-shadow: #f4f4f4;
  --color-text: #000;
  --color-text-secondary: #999;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --hover-brightness: 1.2;
  --justify-important: center;
  --justify-normal: left;
  --line-height: 1.5;
  --width-card: 285px;
  --width-card-medium: 460px;
  --width-card-wide: 800px;
  --width-content: 1080px;
}

Both projects aim to provide minimal CSS frameworks, but MVP offers more features and customization options, while Marx focuses on simplicity and ease of use.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Marx

npm version

The classless CSS framework (perfect for Communists).

No JavaScript. No classes. Just raw HTML that looks good.

Add one stylesheet to plain, semantic HTML and the page styles itself. No class names, no build step, no config. Marx 5 is a full rewrite: automatic light and dark mode, a small --marx-* theming API, and zero specificity, so any CSS you write wins.

Is Marx for you?

Marx is for small projects where you'd rather write content than wire up a component library: prose sites, docs, prototypes, quick landing pages. Use it straight from the box, or retheme it with a few custom properties.

Key features

  • Zero classes: it works with the HTML you already have.
  • Automatic dark mode with color-scheme and light-dark(). No toggle, no JS.
  • Zero specificity: every rule is wrapped in :where() inside cascade layers, so your CSS overrides Marx without a fight or a single !important.
  • Modern base: a small, modern reset so browsers render consistently.
  • Themeable: one set of --marx-* custom properties is the whole API.
  • Modern CSS: logical properties (RTL-ready), a rem type scale, :focus-visible outlines, and motion behind prefers-reduced-motion.
  • It just works.

Demo

Quick start

npm

npm install marx-css

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marx-css@5/css/marx.min.css">

Bundler

With any bundler that reads the exports field (Vite, webpack, esbuild, …):

import "marx-css";

That loads the minified stylesheet.

Dark mode

Dark mode is automatic. Marx sets color-scheme: light dark and defines its colors with light-dark(), so the page follows the visitor's OS or browser preference with no toggle and no JavaScript.

Force a single scheme by overriding color-scheme on the root in your own CSS:

:root { color-scheme: light; } /* always light */
:root { color-scheme: dark;  } /* always dark  */

Theming

The whole theming API is the --marx-* custom properties below. Override any of them in your own (unlayered) CSS. Because Marx lives in cascade layers, your values win. Colors use light-dark(), so set both schemes at once or just change the value you care about.

TokenPurpose
--marx-leadingBase line-height (1.5)
--marx-flowVertical rhythm between block elements (1.25rem)
--marx-measureMax content width of main (48rem)
--marx-radiusCorner radius for controls and surfaces
--marx-space-2xs … -xlSpacing scale (0.25rem to 2.5rem)
--marx-text-sm / -baseBody type sizes
--marx-text-h1 … -h6Heading sizes (2.5rem to 1rem)
--marx-font-sans / -serif / -monoFont stacks
--marx-font-bodyFont applied to body (defaults to sans)
--marx-bgPage background
--marx-textBody text color
--marx-mutedSecondary/subtle text
--marx-disabledDisabled control text
--marx-borderBorders and dividers
--marx-surfaceRaised surfaces (code, tables, wells)
--marx-primary / --marx-primary-strongButton/brand blue + hover
--marx-on-primaryText on primary surfaces
--marx-link / --marx-link-hoverLink colors
--marx-ring:focus-visible outline color
--marx-dangerError/invalid feedback
--marx-mark<mark> highlight

Example, a warmer accent and rounder corners:

:root {
  --marx-primary: hotpink;
  --marx-radius: 0.75rem;
}

Basic template

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Marx Template</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marx-css@5/css/marx.min.css">
</head>
<body>
  <!-- main is the centered container -->
  <main>
    <nav>
      <ul>
        <li><a href="#"><b>First</b></a></li>
        <li><a href="#">Second</a></li>
        <li><a href="#">Third</a></li>
      </ul>
    </nav>

    <article>
      <h1>Article</h1>
      <p>Plain HTML, styled automatically.</p>
    </article>

    <footer>
      <p>&copy; Matthew Blode</p>
    </footer>
  </main>
</body>
</html>

What's included

Installing marx-css gives you the compiled stylesheets plus the source:

.
├── LICENSE.md
├── README.md
├── css
│   ├── marx.css        # readable build
│   ├── marx.min.css    # minified build (the one you ship)
│   └── marx.min.css.map
└── src                 # authored partials, bundled by Lightning CSS
    ├── marx.css        # entry: declares the @layer order
    ├── _tokens.css     # the --marx-* theming API
    ├── _preflight.css  # cross-browser reset
    ├── _base.css
    ├── _typography.css
    ├── _tables.css
    ├── _buttons.css
    └── _form.css

Browser support

Marx targets Baseline 2024 browsers: Chrome/Edge 123+, Firefox 120+, and Safari 17.5+. Older browsers still get a readable page: color-scheme keeps text legible in light and dark, and buttons keep their color. They just lose the finer theming like token-driven borders and surface tints.

Building from source

git clone https://github.com/mblode/marx.git
cd marx
npm install
npm run build     # bundles src/ -> css/

See AGENTS.md for the architecture and contribution conventions.

Contributing to Marx

Pull requests are the way to go.

License

MIT


Crafted by Matthew Blode

NPM DownloadsLast 30 Days