Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 23, 2026·3 min de lecture

Milligram — Minimalist CSS Framework in Just 2KB

Milligram provides a minimal set of styles for fast and clean starting points, weighing only 2KB gzipped with a mobile-first flexbox grid and clean typography.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Milligram Overview
Commande CLI universelle
npx tokrepo install 8f661247-5660-11f1-9bc6-00163e2b0d79

Introduction

Milligram is an ultra-lightweight CSS framework that provides just enough styling to look clean without imposing opinions. At only 2KB gzipped, it is ideal for prototypes, documentation sites, and projects where minimal overhead matters.

What Milligram Does

  • Provides a responsive 12-column flexbox grid system
  • Styles typography, buttons, forms, lists, tables, and blockquotes
  • Applies a consistent baseline with sensible defaults for HTML elements
  • Ships with both minified CSS and Sass source for customization
  • Stays out of the way by avoiding utility classes or JavaScript dependencies

Architecture Overview

Milligram is pure CSS with no JavaScript component. The source is written in Sass and compiled to a single stylesheet. The grid uses flexbox with .container, .row, and .column classes. Every component follows a minimal-markup philosophy: standard HTML elements receive default styling, reducing the need for custom class names.

Installation & Configuration

  • Install via npm: npm install milligram or link from a CDN
  • Import the Sass source to override variables like $color-primary and $font-family
  • No build step required for the precompiled CSS version
  • Normalize.css is included as a dependency for cross-browser consistency
  • Works with any templating language or static site generator

Key Features

  • 2KB gzipped footprint keeps page loads fast
  • Mobile-first responsive grid based on flexbox
  • Clean typography using the Roboto font by default
  • Form elements styled consistently across browsers
  • Easy to extend or override thanks to flat specificity

Comparison with Similar Tools

  • Water.css — classless approach that styles bare HTML; Milligram adds a grid and utility elements
  • Pico CSS — similar minimal philosophy with dark mode; Milligram is smaller and more established
  • Bulma — full-featured framework at 200KB+; Milligram trades features for extreme lightness
  • Skeleton — similar lightweight ethos but unmaintained; Milligram uses modern flexbox
  • Bootstrap — comprehensive framework with JS components; Milligram focuses on CSS-only minimalism

FAQ

Q: Does Milligram include JavaScript? A: No. It is CSS-only, so there is no JS dependency and no interactive components like modals or dropdowns.

Q: Can I customize the colors and fonts? A: Yes. Import the Sass source and override variables like $color-primary, $color-secondary, and $font-family before compilation.

Q: Is Milligram suitable for production applications? A: It works well for content-heavy sites, dashboards, and internal tools. Complex UIs with many interactive patterns may need a more feature-rich framework.

Q: How does Milligram compare in size to Tailwind CSS? A: Tailwind's full build is much larger, though purging reduces it. Milligram's 2KB is smaller than even a purged Tailwind build for most projects.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires