MelangeCSS

Current Version: 1.0.0-RC4

Get Started

MelangeCSS can be installed in a few ways, depending on your needs. To get started now, choose which method:

MelangeCSS has classes that target breakpoints, for example f-3-ns would set the font size to the third step of the scale, but only on the not-small breakpoint. bg-purple-200-dm would set the background color to the second-darkest purple, only if the user has set dark mode in their OS settings.

You may not need these features, so you start with one of three base stylesheets. You can optionally include add-ons to allow augmenting your base stylesheet classes targeting other media queries. Consult the media queries reference for precise definitions.

Base Stylesheet Included Media Queries
melange.css
  • Default
  • Medium Breakpoint
  • Large Breakpoint
  • Not Small Breakpoint

Dark Mode and High Contrast can each be added-on optionally

melange-plus.css
  • Default
  • Medium Breakpoint
  • Large Breakpoint
  • Not Small Breakpoint
  • Dark Mode
  • High Contrast

This is everything, so no need to use any add-ons.

melange-thin.css
  • Default

Default, Medium, Large, Not-Small, Dark Mode, and High Contrast can each be added-on optionally

melange.css

Default, simplest install. Handles most situations. Can enhance with add-on stylesheets.

CDN

You can bring MelangeCSS into any webpage using the unpkg.com CDN provided for all NPM packages. Place this somewhere in your <head> section:

<link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange.min.css"/>

Download

To avoid a runtime dependency on unpkg.com, you can download melange.css with a command-line tool like curl:

curl https://unpkg.com/melange-css@1.0.0-RC4/melange.min.css > your/project/css/melange.css

NPM

MelangeCSS is available as a Node Module, which you can install thusly:

npm install --save melange-css

The CSS will be in node_modules/melange-css/melange.css. How you get that into your app highly depends on how your app is built. If you have a build system that supports @import, you can bring MelangeCSS in by adding this to a .css file your build system processes:

@import "melange-css/melange.css";

If you are using Ruby on Rails here are the instructions for using the asset pipeline with the NPM module.

Adding Media Queries

Since this base stylesheet is missing some media queries, you can add the ones you need peacemeal. See the media queries guide for how to use these styles.

Stylesheet Media Query
melange-dark-mode.css melange-dark-mode.min.css Dark Mode
melange-high-contrast.css melange-high-contrast.min.css High Contrast

For example:

<!-- Pure HTML --> <link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange.min.css"/> <link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange-dark-mode.min.css"/> /* Using a CSS pre-processor */ @import "melange-css/melange.css"; @import "melange-css/melange-dark-mode.css";

melange-plus.css

Largest install, has everything. No need for add-ons.

CDN

You can bring MelangeCSS into any webpage using the unpkg.com CDN provided for all NPM packages. Place this somewhere in your <head> section:

<link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange-plus.min.css"/>

Download

To avoid a runtime dependency on unpkg.com, you can download melange-plus.css with a command-line tool like curl:

curl https://unpkg.com/melange-css@1.0.0-RC4/melange-plus.min.css > your/project/css/melange-plus.css

NPM

MelangeCSS is available as a Node Module, which you can install thusly:

npm install --save melange-css

The CSS will be in node_modules/melange-css/melange-plus.css. How you get that into your app highly depends on how your app is built. If you have a build system that supports @import, you can bring MelangeCSS in by adding this to a .css file your build system processes:

@import "melange-css/melange-plus.css";

If you are using Ruby on Rails here are the instructions for using the asset pipeline with the NPM module.

This includes all media queries.

melange-thin.css

Smallest install. Best for internal apps that don't need breakpoints. Can enhance with add-on stylesheets.

CDN

You can bring MelangeCSS into any webpage using the unpkg.com CDN provided for all NPM packages. Place this somewhere in your <head> section:

<link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange-thin.min.css"/>

Download

To avoid a runtime dependency on unpkg.com, you can download melange-thin.css with a command-line tool like curl:

curl https://unpkg.com/melange-css@1.0.0-RC4/melange-thin.min.css > your/project/css/melange-thin.css

NPM

MelangeCSS is available as a Node Module, which you can install thusly:

npm install --save melange-css

The CSS will be in node_modules/melange-css/melange-thin.css. How you get that into your app highly depends on how your app is built. If you have a build system that supports @import, you can bring MelangeCSS in by adding this to a .css file your build system processes:

@import "melange-css/melange-thin.css";

If you are using Ruby on Rails here are the instructions for using the asset pipeline with the NPM module.

Adding Media Queries

Since this base stylesheet is missing some media queries, you can add the ones you need peacemeal. See the media queries guide for how to use these styles.

Stylesheet Media Query
melange-dark-mode.css melange-dark-mode.min.css Dark Mode
melange-high-contrast.css melange-high-contrast.min.css High Contrast
melange-large-breakpoint.css melange-large-breakpoint.min.css Large Breakpoint
melange-medium-breakpoint.css melange-medium-breakpoint.min.css Medium Breakpoint
melange-not-small-breakpoint.css melange-not-small-breakpoint.min.css Not-small Breakpoint (targets both Large and Medium)

For example:

<!-- Pure HTML --> <link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange-thin.min.css"/> <link rel="stylesheet" href="https://unpkg.com/melange-css@1.0.0-RC4/melange-dark-mode.min.css"/> /* Using a CSS pre-processor */ @import "melange-css/melange-thin.css"; @import "melange-css/melange-dark-mode.css";
Check out the Guide