Matchbox
Updated Jan 10, 2022

CSS Utility Library

FOUNDATIONS

Start building user interfaces with Matchbox styles when react components aren't an option.

@sparkpost/matchbox-css is a utility library which can be used to include Matchbox styles in any front-end architecture. Matchbox components are built to be used within a React application, but when that isn't possible this library helps to bridge the gap and provide Matchbox styles to any front-end application.

This library is built on top of Matchbox design tokens.

Getting Started

Installation

npm install --save @sparkpost/matchbox-css

Usage

Import the utility file to the top level of your stylesheet.

@import '~@sparkpost/matchbox-css/dist/index.css';

Usage Example

  <div className="border-width-100 border-color-gray-300">
    <h2 className="font-size-400 line-height-400 font-weight-bold px-450 pt-450">
      Panel Title
    </h2>
    <div className="p-450">Panel Content</div>
    <div className="p-450 border-width-0 border-top-width-100 border-color-gray-300">
      <button 
        className="bg-blue-700 color-white px-400 h-650 mr-400 font-size-200 hover:bg-blue-600 motion-duration-medium motion-ease-in-out"
        style={{ border: 'none', outline: 'none' }}
      >
        Panel Action
      </button>
    </div>
  </div>

Interactions

The Matchbox CSS utility library provides different interaction states that can be used for the following: :hover, :focus, :focus-visible, :active, :visited, and :disabled

To create styles for these interactions, prefix your classes with .{interaction}:class-name

e.g. .hover:color-blue-700

Media Queries

The Matchbox CSS utility library provides a helper to apply different styles at the following media queries:

  • xs: 448px
  • sm: 720px
  • md: 960px
  • lg: 1200px
  • xl: 1440px

To create styles for these breakpoints, prefix your classes with .{breakpoint}:class-name
e.g. .xs:mx-300 .md:mx-500

Available Classes

Matchbox CSS Classes
Class NameValue
.font-size-50
.font-size-100
.font-size-200
.font-size-300
.font-size-400
.font-size-500
.font-size-600
.font-size-700
.font-size-800
.font-size-root
.font-family-sans
.font-family-monospace
.font-weight-light
.font-weight-normal
.font-weight-medium
.font-weight-semibold
.line-height-100
.line-height-200
.line-height-300
.line-height-400
.line-height-500
.line-height-600
.line-height-700
.line-height-800
.color-brand-orange
.color-brand-gray
.color-brand-blue
.bg-brand-orange
.bg-brand-gray
.bg-brand-blue
.background-brand-orange
.background-brand-gray
.background-brand-blue
.border-color-brand-orange
.border-color-brand-gray
.border-color-brand-blue
.color-yellow-100
.color-yellow-200
.color-yellow-300
.color-yellow-400
.color-yellow-500
.color-yellow-600
.color-yellow-700
.color-yellow-800
.color-yellow-900
.color-yellow-1000
.bg-yellow-100
.bg-yellow-200
.bg-yellow-300
.bg-yellow-400
.bg-yellow-500
.bg-yellow-600
.bg-yellow-700
.bg-yellow-800
.bg-yellow-900
.bg-yellow-1000
.background-yellow-100
.background-yellow-200
.background-yellow-300
.background-yellow-400
.background-yellow-500
.background-yellow-600
.background-yellow-700
.background-yellow-800
.background-yellow-900
.background-yellow-1000
.border-color-yellow-100
.border-color-yellow-200
.border-color-yellow-300
.border-color-yellow-400
.border-color-yellow-500
.border-color-yellow-600
.border-color-yellow-700
.border-color-yellow-800
.border-color-yellow-900
.border-color-yellow-1000
.color-green-100
.color-green-200
.color-green-300
.color-green-400
.color-green-500
.color-green-600
.color-green-700
.color-green-800
.color-green-900
.color-green-1000
.bg-green-100
.bg-green-200
.bg-green-300
.bg-green-400
.bg-green-500
.bg-green-600
.bg-green-700
.bg-green-800
.bg-green-900
.bg-green-1000
.background-green-100
.background-green-200
.background-green-300
.background-green-400
.background-green-500
.background-green-600
.background-green-700
.background-green-800
.background-green-900
.background-green-1000
.border-color-green-100
.border-color-green-200
.border-color-green-300
.border-color-green-400
.border-color-green-500
.border-color-green-600
.border-color-green-700
.border-color-green-800
.border-color-green-900
.border-color-green-1000
.color-teal-100
.color-teal-200
.color-teal-300
.color-teal-400
.color-teal-500
.color-teal-600
.color-teal-700
.color-teal-800
.color-teal-900
.color-teal-1000
.bg-teal-100
.bg-teal-200
.bg-teal-300
.bg-teal-400
.bg-teal-500
.bg-teal-600
.bg-teal-700
.bg-teal-800
.bg-teal-900
.bg-teal-1000
.background-teal-100
.background-teal-200
.background-teal-300
.background-teal-400
.background-teal-500
.background-teal-600
.background-teal-700
.background-teal-800
.background-teal-900
.background-teal-1000
.border-color-teal-100
.border-color-teal-200
.border-color-teal-300
.border-color-teal-400
.border-color-teal-500
.border-color-teal-600
.border-color-teal-700
.border-color-teal-800
.border-color-teal-900
.border-color-teal-1000
.color-blue-100
.color-blue-200
.color-blue-300
.color-blue-400
.color-blue-500
.color-blue-600
.color-blue-700
.color-blue-800
.color-blue-900
.color-blue-1000
.bg-blue-100
.bg-blue-200
.bg-blue-300
.bg-blue-400
.bg-blue-500
.bg-blue-600
.bg-blue-700
.bg-blue-800
.bg-blue-900
.bg-blue-1000
.background-blue-100
.background-blue-200
.background-blue-300
.background-blue-400
.background-blue-500
.background-blue-600
.background-blue-700
.background-blue-800
.background-blue-900
.background-blue-1000
.border-color-blue-100
.border-color-blue-200
.border-color-blue-300
.border-color-blue-400
.border-color-blue-500
.border-color-blue-600
.border-color-blue-700
.border-color-blue-800
.border-color-blue-900
.border-color-blue-1000
.color-purple-100
.color-purple-200
.color-purple-300
.color-purple-400
.color-purple-500
.color-purple-600
.color-purple-700
.color-purple-800
.color-purple-900
.color-purple-1000
.bg-purple-100
.bg-purple-200
.bg-purple-300
.bg-purple-400
.bg-purple-500
.bg-purple-600
.bg-purple-700
.bg-purple-800
.bg-purple-900
.bg-purple-1000
.background-purple-100
.background-purple-200
.background-purple-300
.background-purple-400
.background-purple-500
.background-purple-600
.background-purple-700
.background-purple-800
.background-purple-900
.background-purple-1000
.border-color-purple-100
.border-color-purple-200
.border-color-purple-300
.border-color-purple-400
.border-color-purple-500
.border-color-purple-600
.border-color-purple-700
.border-color-purple-800
.border-color-purple-900
.border-color-purple-1000
.color-magenta-100
.color-magenta-200
.color-magenta-300
.color-magenta-400
.color-magenta-500
.color-magenta-600
.color-magenta-700
.color-magenta-800
.color-magenta-900
.color-magenta-1000
.bg-magenta-100
.bg-magenta-200
.bg-magenta-300
.bg-magenta-400
.bg-magenta-500
.bg-magenta-600
.bg-magenta-700
.bg-magenta-800
.bg-magenta-900
.bg-magenta-1000
.background-magenta-100
.background-magenta-200
.background-magenta-300
.background-magenta-400
.background-magenta-500
.background-magenta-600
.background-magenta-700
.background-magenta-800
.background-magenta-900
.background-magenta-1000
.border-color-magenta-100
.border-color-magenta-200
.border-color-magenta-300
.border-color-magenta-400
.border-color-magenta-500
.border-color-magenta-600
.border-color-magenta-700
.border-color-magenta-800
.border-color-magenta-900
.border-color-magenta-1000
.color-red-100
.color-red-200
.color-red-300
.color-red-400
.color-red-500
.color-red-600
.color-red-700
.color-red-800
.color-red-900
.color-red-1000
.bg-red-100
.bg-red-200
.bg-red-300
.bg-red-400
.bg-red-500
.bg-red-600
.bg-red-700
.bg-red-800
.bg-red-900
.bg-red-1000
.background-red-100
.background-red-200
.background-red-300
.background-red-400
.background-red-500
.background-red-600
.background-red-700
.background-red-800
.background-red-900
.background-red-1000
.border-color-red-100
.border-color-red-200
.border-color-red-300
.border-color-red-400
.border-color-red-500
.border-color-red-600
.border-color-red-700
.border-color-red-800
.border-color-red-900
.border-color-red-1000
.color-gray-100
.color-gray-200
.color-gray-300
.color-gray-400
.color-gray-500
.color-gray-600
.color-gray-700
.color-gray-800
.color-gray-900
.color-gray-1000
.bg-gray-100
.bg-gray-200
.bg-gray-300
.bg-gray-400
.bg-gray-500
.bg-gray-600
.bg-gray-700
.bg-gray-800
.bg-gray-900
.bg-gray-1000
.background-gray-100
.background-gray-200
.background-gray-300
.background-gray-400
.background-gray-500
.background-gray-600
.background-gray-700
.background-gray-800
.background-gray-900
.background-gray-1000
.border-color-gray-100
.border-color-gray-200
.border-color-gray-300
.border-color-gray-400
.border-color-gray-500
.border-color-gray-600
.border-color-gray-700
.border-color-gray-800
.border-color-gray-900
.border-color-gray-1000
.color-white
.bg-white
.background-white
.border-color-white
.h-0
.h-100
.h-200
.h-300
.h-400
.h-450
.h-500
.h-550
.h-600
.h-650
.h-700
.h-750
.h-800
.h-850
.h-900
.h-1000
.h-1100
.h-1150
.h-1200
.h-1300
.h-1350
.h-1400
.h-1500
.height-0
.height-100
.height-200
.height-300
.height-400
.height-450
.height-500
.height-550
.height-600
.height-650
.height-700
.height-750
.height-800
.height-850
.height-900
.height-1000
.height-1100
.height-1150
.height-1200
.height-1300
.height-1350
.height-1400
.height-1500
.w-0
.w-100
.w-200
.w-300
.w-400
.w-450
.w-500
.w-550
.w-600
.w-650
.w-700
.w-750
.w-800
.w-850
.w-900
.w-1000
.w-1100
.w-1150
.w-1200
.w-1300
.w-1350
.w-1400
.w-1500
.width-0
.width-100
.width-200
.width-300
.width-400
.width-450
.width-500
.width-550
.width-600
.width-650
.width-700
.width-750
.width-800
.width-850
.width-900
.width-1000
.width-1100
.width-1150
.width-1200
.width-1300
.width-1350
.width-1400
.width-1500
.max-h-0
.max-h-100
.max-h-200
.max-h-300
.max-h-400
.max-h-450
.max-h-500
.max-h-550
.max-h-600
.max-h-650
.max-h-700
.max-h-750
.max-h-800
.max-h-850
.max-h-900
.max-h-1000
.max-h-1100
.max-h-1150
.max-h-1200
.max-h-1300
.max-h-1350
.max-h-1400
.max-h-1500
.max-height-0
.max-height-100
.max-height-200
.max-height-300
.max-height-400
.max-height-450
.max-height-500
.max-height-550
.max-height-600
.max-height-650
.max-height-700
.max-height-750
.max-height-800
.max-height-850
.max-height-900
.max-height-1000
.max-height-1100
.max-height-1150
.max-height-1200
.max-height-1300
.max-height-1350
.max-height-1400
.max-height-1500
.max-w-0
.max-w-100
.max-w-200
.max-w-300
.max-w-400
.max-w-450
.max-w-500
.max-w-550
.max-w-600
.max-w-650
.max-w-700
.max-w-750
.max-w-800
.max-w-850
.max-w-900
.max-w-1000
.max-w-1100
.max-w-1150
.max-w-1200
.max-w-1300
.max-w-1350
.max-w-1400
.max-w-1500
.max-width-0
.max-width-100
.max-width-200
.max-width-300
.max-width-400
.max-width-450
.max-width-500
.max-width-550
.max-width-600
.max-width-650
.max-width-700
.max-width-750
.max-width-800
.max-width-850
.max-width-900
.max-width-1000
.max-width-1100
.max-width-1150
.max-width-1200
.max-width-1300
.max-width-1350
.max-width-1400
.max-width-1500
.p-0
.p-100
.p-200
.p-300
.p-400
.p-450
.p-500
.p-550
.p-600
.p-650
.p-700
.p-750
.p-800
.p-850
.p-900
.padding-0
.padding-100
.padding-200
.padding-300
.padding-400
.padding-450
.padding-500
.padding-550
.padding-600
.padding-650
.padding-700
.padding-750
.padding-800
.padding-850
.padding-900
.pt-0
.pt-100
.pt-200
.pt-300
.pt-400
.pt-450
.pt-500
.pt-550
.pt-600
.pt-650
.pt-700
.pt-750
.pt-800
.pt-850
.pt-900
.padding-top-0
.padding-top-100
.padding-top-200
.padding-top-300
.padding-top-400
.padding-top-450
.padding-top-500
.padding-top-550
.padding-top-600
.padding-top-650
.padding-top-700
.padding-top-750
.padding-top-800
.padding-top-850
.padding-top-900
.pr-0
.pr-100
.pr-200
.pr-300
.pr-400
.pr-450
.pr-500
.pr-550
.pr-600
.pr-650
.pr-700
.pr-750
.pr-800
.pr-850
.pr-900
.padding-right-0
.padding-right-100
.padding-right-200
.padding-right-300
.padding-right-400
.padding-right-450
.padding-right-500
.padding-right-550
.padding-right-600
.padding-right-650
.padding-right-700
.padding-right-750
.padding-right-800
.padding-right-850
.padding-right-900
.pb-0
.pb-100
.pb-200
.pb-300
.pb-400
.pb-450
.pb-500
.pb-550
.pb-600
.pb-650
.pb-700
.pb-750
.pb-800
.pb-850
.pb-900
.padding-bottom-0
.padding-bottom-100
.padding-bottom-200
.padding-bottom-300
.padding-bottom-400
.padding-bottom-450
.padding-bottom-500
.padding-bottom-550
.padding-bottom-600
.padding-bottom-650
.padding-bottom-700
.padding-bottom-750
.padding-bottom-800
.padding-bottom-850
.padding-bottom-900
.pl-0
.pl-100
.pl-200
.pl-300
.pl-400
.pl-450
.pl-500
.pl-550
.pl-600
.pl-650
.pl-700
.pl-750
.pl-800
.pl-850
.pl-900
.padding-left-0
.padding-left-100
.padding-left-200
.padding-left-300
.padding-left-400
.padding-left-450
.padding-left-500
.padding-left-550
.padding-left-600
.padding-left-650
.padding-left-700
.padding-left-750
.padding-left-800
.padding-left-850
.padding-left-900
.px-0
.px-100
.px-200
.px-300
.px-400
.px-450
.px-500
.px-550
.px-600
.px-650
.px-700
.px-750
.px-800
.px-850
.px-900
.paddingX-0
.paddingX-100
.paddingX-200
.paddingX-300
.paddingX-400
.paddingX-450
.paddingX-500
.paddingX-550
.paddingX-600
.paddingX-650
.paddingX-700
.paddingX-750
.paddingX-800
.paddingX-850
.paddingX-900
.py-0
.py-100
.py-200
.py-300
.py-400
.py-450
.py-500
.py-550
.py-600
.py-650
.py-700
.py-750
.py-800
.py-850
.py-900
.paddingY-0
.paddingY-100
.paddingY-200
.paddingY-300
.paddingY-400
.paddingY-450
.paddingY-500
.paddingY-550
.paddingY-600
.paddingY-650
.paddingY-700
.paddingY-750
.paddingY-800
.paddingY-850
.paddingY-900
.m-0
.m-100
.m-200
.m-300
.m-400
.m-450
.m-500
.m-550
.m-600
.m-650
.m-700
.m-750
.m-800
.m-850
.m-900
.margin-0
.margin-100
.margin-200
.margin-300
.margin-400
.margin-450
.margin-500
.margin-550
.margin-600
.margin-650
.margin-700
.margin-750
.margin-800
.margin-850
.margin-900
.mt-0
.mt-100
.mt-200
.mt-300
.mt-400
.mt-450
.mt-500
.mt-550
.mt-600
.mt-650
.mt-700
.mt-750
.mt-800
.mt-850
.mt-900
.margin-top-0
.margin-top-100
.margin-top-200
.margin-top-300
.margin-top-400
.margin-top-450
.margin-top-500
.margin-top-550
.margin-top-600
.margin-top-650
.margin-top-700
.margin-top-750
.margin-top-800
.margin-top-850
.margin-top-900
.mr-0
.mr-100
.mr-200
.mr-300
.mr-400
.mr-450
.mr-500
.mr-550
.mr-600
.mr-650
.mr-700
.mr-750
.mr-800
.mr-850
.mr-900
.margin-right-0
.margin-right-100
.margin-right-200
.margin-right-300
.margin-right-400
.margin-right-450
.margin-right-500
.margin-right-550
.margin-right-600
.margin-right-650
.margin-right-700
.margin-right-750
.margin-right-800
.margin-right-850
.margin-right-900
.mb-0
.mb-100
.mb-200
.mb-300
.mb-400
.mb-450
.mb-500
.mb-550
.mb-600
.mb-650
.mb-700
.mb-750
.mb-800
.mb-850
.mb-900
.margin-bottom-0
.margin-bottom-100
.margin-bottom-200
.margin-bottom-300
.margin-bottom-400
.margin-bottom-450
.margin-bottom-500
.margin-bottom-550
.margin-bottom-600
.margin-bottom-650
.margin-bottom-700
.margin-bottom-750
.margin-bottom-800
.margin-bottom-850
.margin-bottom-900
.ml-0
.ml-100
.ml-200
.ml-300
.ml-400
.ml-450
.ml-500
.ml-550
.ml-600
.ml-650
.ml-700
.ml-750
.ml-800
.ml-850
.ml-900
.margin-left-0
.margin-left-100
.margin-left-200
.margin-left-300
.margin-left-400
.margin-left-450
.margin-left-500
.margin-left-550
.margin-left-600
.margin-left-650
.margin-left-700
.margin-left-750
.margin-left-800
.margin-left-850
.margin-left-900
.mx-0
.mx-100
.mx-200
.mx-300
.mx-400
.mx-450
.mx-500
.mx-550
.mx-600
.mx-650
.mx-700
.mx-750
.mx-800
.mx-850
.mx-900
.marginX-0
.marginX-100
.marginX-200
.marginX-300
.marginX-400
.marginX-450
.marginX-500
.marginX-550
.marginX-600
.marginX-650
.marginX-700
.marginX-750
.marginX-800
.marginX-850
.marginX-900
.my-0
.my-100
.my-200
.my-300
.my-400
.my-450
.my-500
.my-550
.my-600
.my-650
.my-700
.my-750
.my-800
.my-850
.my-900
.marginY-0
.marginY-100
.marginY-200
.marginY-300
.marginY-400
.marginY-450
.marginY-500
.marginY-550
.marginY-600
.marginY-650
.marginY-700
.marginY-750
.marginY-800
.marginY-850
.marginY-900
.top-0
.top-100
.top-200
.top-300
.top-400
.top-450
.top-500
.top-550
.top-600
.top-650
.top-700
.top-750
.top-800
.top-850
.top-900
.right-0
.right-100
.right-200
.right-300
.right-400
.right-450
.right-500
.right-550
.right-600
.right-650
.right-700
.right-750
.right-800
.right-850
.right-900
.bottom-0
.bottom-100
.bottom-200
.bottom-300
.bottom-400
.bottom-450
.bottom-500
.bottom-550
.bottom-600
.bottom-650
.bottom-700
.bottom-750
.bottom-800
.bottom-850
.bottom-900
.left-0
.left-100
.left-200
.left-300
.left-400
.left-450
.left-500
.left-550
.left-600
.left-650
.left-700
.left-750
.left-800
.left-850
.left-900
.box-shadow-0
.box-shadow-100
.box-shadow-200
.box-shadow-300
.box-shadow-400
.z-index-auto
.z-index-below
.z-index-default
.z-index-overlay
.motion-duration-fast
.motion-duration-medium
.motion-duration-slow
.motion-ease-in
.motion-ease-out
.motion-ease-in-out
.border-radius-0
.border-radius-100
.border-radius-200
.border-radius-pill
.border-radius-circle
.border-width-0
.border-x-width-0
.border-y-width-0
.border-top-width-0
.border-right-width-0
.border-bottom-width-0
.border-left-width-0
.border-width-100
.border-x-width-100
.border-y-width-100
.border-top-width-100
.border-right-width-100
.border-bottom-width-100
.border-left-width-100
.border-width-200
.border-x-width-200
.border-y-width-200
.border-top-width-200
.border-right-width-200
.border-bottom-width-200
.border-left-width-200