v1.0 @mastors/core
@mastors/core MIT License Dart Sass 1.70+ Zero Side-Effects

Mastors Core

The enterprise-grade SCSS foundational architecture powering the entire Mastors CDN ecosystem. Design tokens, CSS variables, responsive engine, theming, and utility generators — all in one zero-side-effect package.

Design Token System

50+ brand + neutral + semantic colors, shadows, radius, z-index, opacity, motion tokens.

CSS Variable Engine

Every token auto-synced to --mastors-* custom properties for runtime theming.

Theme Engine

Light, dark & custom themes with data-theme switching. OS preference aware.

Responsive Engine

7 breakpoints. up(), down(), between(), only() mixins. Mobile-first by default.

Utility Generators

Scoped utility classes for colors, shadows, spacing, sizing, display, borders & more.

Accessibility System

Focus visible, sr-only, skip links, reduced motion support. WCAG-aligned defaults.

Helper Mixins

Glassmorphism, neumorphism, skeleton loading, truncate, hover-lift, smooth transitions.

Modern Sass Only

Dart Sass @use / @forward exclusively. No deprecated @import. Fully tree-shakeable.

Installation

1

Install via npm or yarn

Add Mastors Core as a dependency to your project.

bash
npm install @mastors/core
# or
yarn add @mastors/core
2

Use the prebuilt CSS (CDN / direct)

Drop the compiled CSS into your HTML for zero-config usage.

html
<link rel="stylesheet" href="dist/mastors-core.css" />
3

Import the SCSS API (functions + mixins only)

Use in your SCSS files for a zero-CSS-output API entry point.

scss
// Zero CSS output — only functions, mixins, tokens
@use '@mastorscdn/core' as mc;

Quick Start

scss
@use '@mastorscdn/core' as mc;

.my-card {
  background-color: mc.color('surface');
  border-radius: mc.radius('lg');
  box-shadow: mc.shadow('md');
  color: mc.semantic('text-primary');
  padding: mc.rem(24);

  @include mc.up('md') {
    padding: mc.rem(32);
  }
}

// Glassmorphism card
.glass-card {
  @include mc.glassmorphism(20px, rgba(255,255,255,0.12), rgba(255,255,255,0.2));
}

// Hover lift
.interactive-card {
  @include mc.hover-lift;
}
Always use @use with a namespace alias like as mc to avoid name collisions in large projects.

With feature flags:

scss
@use '@mastorscdn/core' with (
  $enable-dark-theme:    true,
  $enable-utilities:     true,
  $enable-accessibility: true,
  $mastors-prefix:       'mc'
);

Architecture

Mastors Core follows a strict module hierarchy with clear separation of concerns. _index.scss is the zero-CSS API entry; mastors-core.scss is the compile entry that outputs the full CSS bundle.

text — module graph
mastors-core.scss  ← Compile entry (full CSS output)
│
├── config/           Feature flags, prefix, debug ($enable-*)
├── tokens/           Token maps (colors, shadows, radius, z, opacity, bp, motion, borders)
│
├── functions/        Token accessor functions + math helpers
│   ├── color($key)   shadow($key)   radius($key)   z($key)
│   ├── duration($k)  easing($k)     breakpoint($k) container($k)
│   └── rem($px)      em($px)        fluid($min,$max)
│
├── mixins/           Responsive engine + helper mixins + CSS var generator
│   ├── up() down() between() only()
│   └── glassmorphism() neumorphism() hover-lift() skeleton-loading()…
│
├── themes/           Light + dark + custom theme CSS var output
├── base/             CSS reset + motion defaults
├── accessibility/    sr-only, skip-links, focus-visible
├── helpers/          .mastors-container, state classes
├── generators/       Utility class output (colors, shadows, radius, display…)
└── utilities/        Spacing, sizing, border utilities
Design Principle: _index.scss emits zero CSS. It is the pure SCSS API (functions, mixins, tokens). Only mastors-core.scss compiles actual CSS output.

Design Tokens

All design decisions are encoded as SCSS maps and automatically synced to CSS custom properties via the CSS variable engine. Never use magic numbers — always reference a token.

Token GroupSCSS VariableCSS Custom PropsCount
Colors (brand + neutral)$mastors-colors--mastors-color-*40+
Semantic Colors$mastors-semantic--mastors-text-* --mastors-bg-*16
Shadows$mastors-shadows--mastors-shadow-*15
Border Radius$mastors-radius--mastors-radius-*9
Z-Index$mastors-z-index--mastors-z-*10+
Opacity$mastors-opacity--mastors-opacity-*16
Breakpoints$mastors-breakpoints—7
Durations$mastors-durations--mastors-duration-*7
Easings$mastors-easings--mastors-easing-*9
Transitions$mastors-transitions--mastors-transition-*7

Colors

Accessed via mc.color($key) in SCSS or var(--mastors-color-*) in CSS.

Brand Colors

primary#2563eb
primary-light#60a5fa
primary-dark#1d4ed8
secondary#7c3aed
secondary-light#a78bfa
accent#0ea5e9

Status Colors

success#16a34a
warning#d97706
danger#dc2626
info#0891b2
success-light#4ade80
danger-light#f87171

Neutral Scale

neutral-50#f9fafb
neutral-100#f3f4f6
neutral-200#e5e7eb
neutral-400#9ca3af
neutral-500#6b7280
neutral-700#374151
neutral-800#1f2937
neutral-900#111827
scss
@use '@mastorscdn/core' as mc;

.element {
  color:            mc.color('primary');        // #2563eb
  background:       mc.color('neutral-100');    // #f3f4f6
  border-color:     mc.color('danger');         // #dc2626
  // Semantic
  color:            mc.semantic('text-muted');  // #6b7280
  background:       mc.semantic('bg-body');     // #ffffff
}

Color Utility Classes

.text-primary.text-secondary.text-danger.text-success.text-warning.text-info .text-neutral-500.text-neutral-900 .bg-primary.bg-neutral-100.bg-danger.bg-success .border-color-primary.border-color-danger

Shadows

Live Shadow Preview
.shadow-xs
.shadow-sm
.shadow-md
.shadow-lg
.shadow-xl
.shadow-2xl
.shadow-primary
.shadow-danger
.shadow-success
.shadow-inner
.shadow-dark-md
.shadow-dark-lg
scss
// SCSS token function
.card { box-shadow: mc.shadow('md'); }
.btn  { box-shadow: mc.shadow('primary'); }

// CSS custom property
.card { box-shadow: var(--mastors-shadow-lg); }

// Utility class
<div class="shadow-xl">
.shadow-none.shadow-xs.shadow-sm.shadow-md.shadow-lg.shadow-xl.shadow-2xl.shadow-inner.shadow-primary.shadow-success.shadow-danger.shadow-warning.shadow-dark-sm.shadow-dark-md.shadow-dark-lg

Border Radius

Radius Scale
none
0
xs
2px
sm
4px
md
8px
lg
12px
xl
16px
2xl
24px
3xl
32px
full
9999px
scss
border-radius: mc.radius('lg');   // 12px
border-radius: mc.radius('full'); // 9999px (pill)
border-radius: mc.radius('xl');   // 16px

Directional classes also available:

.rounded-none.rounded-sm.rounded-md.rounded-lg.rounded-xl.rounded-2xl.rounded-full .rounded-t-lg.rounded-b-xl.rounded-l-md.rounded-r-full

Motion Tokens

KeyDurationSCSS Access
instant0msmc.duration('instant')
fast100msmc.duration('fast')
normal200msmc.duration('normal')
moderate300msmc.duration('moderate')
slow500msmc.duration('slow')
slower700msmc.duration('slower')
slowest1000msmc.duration('slowest')
Easing KeyCurve
ease-in-outcubic-bezier(0.4, 0, 0.2, 1) — default smooth
springcubic-bezier(0.34, 1.56, 0.64, 1) — overshoot spring
bouncecubic-bezier(0.68, -0.55, 0.265, 1.55) — bouncy
smoothcubic-bezier(0.23, 1, 0.32, 1) — expo out
sharpcubic-bezier(0.4, 0, 0.6, 1) — material sharp
scss
transition: mc.transition('colors');    // color + bg + border transitions
transition: mc.transition('all');       // all 200ms ease-in-out
transition-duration: mc.duration('moderate'); // 300ms
transition-timing-function: mc.easing('spring');
Duration Scale — Hover each box to compare speeds
fast
100ms
normal
200ms
moderate
300ms
slow
500ms
slower
700ms
slowest
1000ms
Easing Curves — Same 600ms duration, different feel
ease-in-out
spring
bounce
smooth
sharp
Transition Utility Classes — Hover each box
.transition‑all
.transition‑colors
.transition‑opacity
.transition‑shadow
.transition‑transform
.transition-none.transition-all.transition-fast.transition-colors.transition-opacity.transition-shadow.transition-transform

Z-Index & Opacity

Z-Index Scale

KeyValue
dropdown100
sticky200
fixed300
modal-backdrop400
modal500
popover600
tooltip700
toast800

Opacity Scale

ClassValue
.opacity-00
.opacity-50.05
.opacity-100.1
.opacity-250.25
.opacity-500.5
.opacity-750.75
.opacity-900.9
.opacity-1001
Z-Index Stacking — Higher value sits on top
dropdown · z:100
modal-backdrop · z:400
modal · z:500
tooltip · z:700
Opacity Scale — Same blue, different transparency
5
.opacity-5
10
.opacity-10
25
.opacity-25
50
.opacity-50
75
.opacity-75
90
.opacity-90
100
.opacity-100
scss
z-index: mc.z('modal');      // 500
z-index: mc.z('tooltip');   // 700
z-index: mc.layer('dialog'); // layer map accessor

Token Functions

All functions are available via @use '@mastorscdn/core' as mc;. Every function accepts a string key and an optional fallback.
scss — complete function reference
@use '@mastorscdn/core' as mc;

// ── Colors ───────────────────────────────────────────────────
color:            mc.color('primary');             // #2563eb
color:            mc.color('neutral-700');          // #374151
color:            mc.semantic('text-muted');        // #6b7280

// ── Shadows ──────────────────────────────────────────────────
box-shadow:       mc.shadow('lg');                 // multi-layer shadow
box-shadow:       mc.shadow('primary');            // brand colored shadow

// ── Radius ───────────────────────────────────────────────────
border-radius:    mc.radius('xl');                 // 16px
border-radius:    mc.radius('full');               // 9999px

// ── Z-Index ──────────────────────────────────────────────────
z-index:          mc.z('modal');                   // 500
z-index:          mc.layer('dialog');              // layer map

// ── Opacity ──────────────────────────────────────────────────
opacity:          mc.opacity('50');                // 0.5

// ── Motion ───────────────────────────────────────────────────
transition-duration:        mc.duration('normal');     // 200ms
transition-timing-function: mc.easing('spring');
transition:                 mc.transition('colors');

// ── Breakpoints ──────────────────────────────────────────────
$bp:              mc.breakpoint('md');             // 768px
max-width:        mc.container('xl');              // 1140px

// ── Math Helpers ─────────────────────────────────────────────
font-size:        mc.rem(18);                      // 1.125rem
font-size:        mc.em(14);                       // 0.875em
font-size:        mc.fluid(16px, 24px);            // clamp() fluid scale
$raw:             mc.strip-unit(16px);             // 16
$pct:             mc.percent(3, 12);               // 25%
Function Output Preview
mc.color('primary')
#2563eb
mc.color('danger')
#dc2626
mc.radius('xl')
16px
mc.shadow('lg')
shadow applied
mc.rem(18)
Aa
→ 1.125rem
mc.z('modal')
500
mc.duration('slow')
500ms
mc.fluid(16px, 24px)
clamp(1rem, 2vw, 1.5rem)

Helper Mixins

@include mc.glassmorphism()
Creates a glassmorphism effect with backdrop-filter blur.
$blur:16px · $bg:rgba(255,255,255,.12) · $border · $shadow
@include mc.neumorphism()
Soft UI neumorphism with light and dark shadow pair.
$bg:#e0e5ec · $light · $dark · $intensity:6px
@include mc.hover-lift()
Pointer-device hover: translateY up + shadow. Respects hover: hover.
$y:-4px · $shadow
@include mc.skeleton-loading()
Shimmer skeleton animation using gradient sweep.
$bg-from · $bg-to · $duration:1.5s
@include mc.truncate()
Single-line text truncation with ellipsis.
@include mc.line-clamp($n)
Multi-line CSS clamp truncation. Works cross-browser.
$lines:2
@include mc.focus-ring()
Custom accessible focus ring with color, width, offset.
$color:#2563eb · $width:3px · $offset:2px
@include mc.custom-scrollbar()
Styled scrollbar for Chrome + Firefox with thin width support.
$width:6px · $track · $thumb · $thumb-hover
@include mc.smooth-transition()
Single-line configurable CSS transition shorthand.
$props:all · $dur:200ms · $ease
@include mc.absolute-center()
Absolute position center via transform translate(-50%, -50%).
@include mc.flex-center()
display:flex + align-items:center + justify-content:center.
@include mc.visually-hidden()
WCAG-compliant screen-reader-only text hiding technique.
@include mc.cover()
position:absolute; inset:0; width:100%; height:100%.
@include mc.loading-state()
Pointer-events none + opacity dim + cursor:wait for loading UI.

Glassmorphism Demo

Glassmorphism Card

Generated with @include mc.glassmorphism(20px). Uses backdrop-filter blur with semi-transparent border.

scss
@use '@mastorscdn/core' as mc;

.glass-card {
  @include mc.glassmorphism(
    $blur:   20px,
    $bg:     rgba(255, 255, 255, 0.12),
    $border: rgba(255, 255, 255, 0.20)
  );
  border-radius: mc.radius('xl');
  padding: mc.rem(24);
}

.soft-button {
  @include mc.neumorphism(#e0e5ec);
  border-radius: mc.radius('md');
}

.card {
  @include mc.hover-lift($y: -6px);
}

.excerpt {
  @include mc.line-clamp(3);
}

More Mixin Demos

Neumorphism — @include mc.neumorphism()
Soft UI Card
Pill Button
⬡
hover-lift — @include mc.hover-lift() — Hover the cards
hover-lift($y:−4px)
hover-lift($y:−10px)
skeleton-loading — @include mc.skeleton-loading()
truncate & line-clamp
@include mc.truncate()
This very long sentence gets cut off with an ellipsis at the right edge of its container.
@include mc.line-clamp(2)
Multi-line clamping limits visible lines and adds an ellipsis. This hidden text extends beyond the second line and won't be shown.
focus-ring & custom-scrollbar
@include mc.focus-ring() — Click the input
@include mc.custom-scrollbar(6px) — Scroll inside
Scroll me ↓
Line 2 — custom scrollbar
Line 3
Line 4
Line 5
Line 6
Line 7 — end of content

Responsive Mixins

Breakpoint Scale

xs
xs
0px
sm
sm
576px
md
md
768px
lg
lg
992px
xl
xl
1200px
2xl
2xl
1400px
3xl
3xl
1600px
scss — all responsive mixins
@use '@mastorscdn/core' as mc;

.element {
  font-size: 1rem;                          // mobile base

  // up($bp) — min-width, mobile first
  @include mc.up('md') { font-size: 1.25rem; }   // ≥ 768px
  @include mc.up('xl') { font-size: 1.5rem; }    // ≥ 1200px

  // down($bp) — max-width
  @include mc.down('lg') { display: none; }      // < 992px

  // between($lower, $upper) — range
  @include mc.between('sm', 'xl') { padding: 2rem; } // 576px–1199px

  // only($bp) — single breakpoint slot
  @include mc.only('md') { padding: 1.5rem; }    // 768px–991px

  // Media helpers
  @include mc.hover { color: red; }              // (hover:hover) and (pointer:fine)
  @include mc.prefers-dark { color: white; }     // OS dark mode
  @include mc.prefers-reduced-motion { animation: none; }
  @include mc.print { display: none; }
  @include mc.portrait { padding-top: 2rem; }
  @include mc.landscape { padding-top: 1rem; }
}
Note: down($bp) uses $value - 0.02px to prevent overlap with up($bp) at the same breakpoint.

You can also pass raw pixel values:

scss
@include mc.up(900px)   { ... }
@include mc.down(1100px) { ... }

Utilities

All utility classes are generated from token maps and are guarded by $enable-utilities (default: true). All use !important.

Spacing

Full margin and padding utility system on a rem-based scale (0–96). Pattern: .{m|p}{direction?}-{key}

PrefixPropertyExample
.m-*margin (all).m-4 → margin: 1rem
.mt-*margin-top.mt-8 → margin-top: 2rem
.mr-*margin-right.mr-auto → margin-right: auto
.mb-*margin-bottom.mb-6 → margin-bottom: 1.5rem
.ml-*margin-left
.mx-*margin horizontal.mx-auto → center block
.my-*margin vertical
.p-*padding (all).p-4 → padding: 1rem
.px-*padding horizontal.px-6 → 1.5rem L/R
.py-*padding vertical.py-3 → 0.75rem T/B

Common scale values:

.p-0.p-1.p-2.p-3.p-4.p-5.p-6.p-8.p-10.p-12.p-16 .m-auto.mx-auto.mt-0.mb-4.px-4.py-2
Spacing Scale Visual
0
0px
1
0.25rem
2
0.5rem
3
0.75rem
4
1rem
5
1.25rem
6
1.5rem
8
2rem
10
2.5rem
12
3rem
16
4rem
← p-1 to p-8 padding growth

Sizing

.w-full.w-1-2.w-1-3.w-1-4.w-auto.w-screen.w-fit.w-min.w-max .h-full.h-screen.h-dvh.h-svh.h-auto .max-w-xs.max-w-sm.max-w-md.max-w-lg.max-w-xl.max-w-2xl.max-w-4xl.max-w-7xl.max-w-full .min-h-screen.min-h-full.min-h-dvh
Width Utilities
.w-full
.w-1-2
.w-1-3
.w-1-4
max-width Containers
.max-w-xs
320px
.max-w-md
448px
.max-w-2xl
672px
Aspect Ratio
.aspect-square
.aspect-video
.aspect-portrait

Display & Layout

CategoryClasses
Display.d-none .d-block .d-inline .d-inline-block .d-contents .d-table
Visibility.visible .invisible
Overflow.overflow-hidden .overflow-auto .overflow-scroll .overflow-x-hidden .overflow-y-auto
Position.position-static .position-relative .position-absolute .position-fixed .position-sticky
Inset.top-0 .right-0 .bottom-0 .left-0 .inset-0
Cursor.cursor-pointer .cursor-default .cursor-not-allowed .cursor-grab .cursor-wait
Object Fit.object-cover .object-contain .object-fill .object-scale-down
Aspect Ratio.aspect-square .aspect-video .aspect-cinema .aspect-portrait .aspect-landscape
Pointer Events.pointer-events-none .pointer-events-auto
User Select.select-none .select-text .select-all .select-auto
Display Classes
d-block
d-inline d-inline-block
d-flex
d-none (hidden)
Position Classes
.top-0.left-0
.top-0.right-0
.bottom-0.left-0
.absolute-center
Cursor Classes
.cursor-pointer ☞
.cursor-not-allowed ✕
.cursor-wait ⏳
.cursor-grab ✋

Borders

.border.border-0.border-2.border-4.border-8 .border-t.border-b.border-l.border-r .border-solid.border-dashed.border-dotted.border-none .outline-none.outline.outline-offset-2
Border Widths & Styles
.border
.border-2
.border-4
.border-8
.border-dashed
.border-dotted
Directional Borders
.border-t
.border-r
.border-b
.border-l
Border Radius Scale
.rounded-none
.rounded-sm
.rounded-md
.rounded-xl
.rounded-full

Theme System

Mastors Core ships with a three-tier theme architecture: light (default on :root), dark (via data-theme="dark" or OS preference), and custom themes per brand/product.

Light Theme

data-theme="light" · Applied to :root by default

Background: #ffffff · Text: #111827

Dark Theme

data-theme="dark" · Or OS prefers-color-scheme

Background: #0f172a · Text: #f9fafb
html — switching themes
<!-- Light (default) -->
<html data-theme="light">

<!-- Dark -->
<html data-theme="dark">

<!-- Custom brand theme -->
<html data-theme="enterprise">
javascript — runtime toggle
class MastorsTheme {
  static set(theme) {
    document.documentElement.setAttribute('data-theme', theme);
    localStorage.setItem('mastors-theme', theme);
  }

  static get() {
    return localStorage.getItem('mastors-theme')
      || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
  }

  static init() { this.set(this.get()); }

  static toggle() {
    const current = document.documentElement.getAttribute('data-theme');
    this.set(current === 'dark' ? 'light' : 'dark');
  }
}

MastorsTheme.init();
scss — custom theme
@use '@mastorscdn/core/themes/custom' with (
  $theme-name: 'enterprise',
  $custom-tokens: (
    '--mastors-color-primary':   #0f4c75,
    '--mastors-color-secondary': #1b4332,
    '--mastors-bg-body':         #1b262c,
    '--mastors-bg-subtle':       #16213e,
    '--mastors-text-primary':    #e2e8f0,
    '--mastors-surface':         #16213e,
  )
);
Always use CSS custom properties (var(--mastors-*)) for themeable properties like colors and backgrounds. SCSS functions lock values at compile time and won't respond to runtime theme switching.

CSS Variable Reference

css — all mastors custom properties
/* ── Semantic (theme-aware) ────────────────────────── */
var(--mastors-text-primary)
var(--mastors-text-secondary)
var(--mastors-text-muted)
var(--mastors-text-disabled)
var(--mastors-text-inverse)
var(--mastors-bg-body)
var(--mastors-bg-subtle)
var(--mastors-bg-muted)
var(--mastors-surface)
var(--mastors-border-default)
var(--mastors-border-strong)
var(--mastors-border-focus)

/* ── Brand Colors ──────────────────────────────────── */
var(--mastors-color-primary)
var(--mastors-color-secondary)
var(--mastors-color-accent)
var(--mastors-color-success)
var(--mastors-color-warning)
var(--mastors-color-danger)
var(--mastors-color-info)

/* ── Shadows ───────────────────────────────────────── */
var(--mastors-shadow-sm)
var(--mastors-shadow-md)
var(--mastors-shadow-lg)
var(--mastors-shadow-xl)
var(--mastors-shadow-primary)

/* ── Radius ────────────────────────────────────────── */
var(--mastors-radius-sm)    /* 4px  */
var(--mastors-radius-md)    /* 8px  */
var(--mastors-radius-lg)    /* 12px */
var(--mastors-radius-xl)    /* 16px */
var(--mastors-radius-full)  /* 9999px */

/* ── Motion ────────────────────────────────────────── */
var(--mastors-duration-fast)
var(--mastors-duration-normal)
var(--mastors-easing-ease-in-out)
var(--mastors-easing-spring)

/* ── Z-Index ───────────────────────────────────────── */
var(--mastors-z-dropdown)   /* 100 */
var(--mastors-z-modal)      /* 500 */
var(--mastors-z-tooltip)    /* 700 */
var(--mastors-z-toast)      /* 800 */

Accessibility

html — a11y classes
<!-- Skip to content link -->
<a href="#main" class="mastors-skip-link">Skip to content</a>

<!-- Screen reader only (visually hidden) -->
<span class="mastors-sr-only">Loading...</span>

<!-- Skeleton loading placeholder -->
<div class="mastors-skeleton w-full h-4 rounded-md"></div>
<div class="mastors-skeleton w-1-2 h-4 rounded-md mt-2"></div>
Skeleton Loading Preview
Mastors Core automatically respects prefers-reduced-motion globally via the base reset. All animations are disabled for users who prefer reduced motion.
.mastors-sr-only .mastors-skip-link .mastors-focus-ring .mastors-skeleton @include mc.visually-hidden() @include mc.focus-ring() @include mc.prefers-reduced-motion {}

States & Animations

Live Animation Demo
.mastors-hover-lift
.mastors-spin
.mastors-pulse
.mastors-bounce
ClassEffectUse Case
.mastors-hover-lifttranslateY(-4px) + shadow on hoverCards, tiles
.mastors-hover-scalescale(1.02) on hoverButtons, thumbnails
.mastors-hover-opacityopacity 0.8 on hoverLinks, icons
.mastors-interactiveCursor, opacity, press scale, disabled stateGeneral interactive elements
.mastors-skeletonAnimated shimmer gradientLoading placeholders
.mastors-pulseOpacity 1↔0.5 loopStatus indicators
.mastors-spin360° rotation loop (1s)Loading spinners
.mastors-pingScale + fade out loopNotification badges
.mastors-bounceBounce up/down loopScroll hints, icons

Container

html
<!-- Responsive container (auto max-width by breakpoint) -->
<div class="mastors-container">
  Content auto-clamps at 540 / 720 / 960 / 1140 / 1320 / 1520px
</div>

<!-- Full-width fluid container with consistent padding -->
<div class="mastors-container-fluid">
  Always 100% width with padding-left/right: 1rem
</div>
BreakpointContainer Max-Width
sm (576px+)540px
md (768px+)720px
lg (992px+)960px
xl (1200px+)1140px
2xl (1400px+)1320px
3xl (1600px+)1520px

Build Commands

CommandDescription
npm run sass:buildExpanded CSS with source maps
npm run sass:minMinified CSS, no source maps
npm run sass:watchWatch mode for development
npm run sass:allBoth expanded + minified
npm run buildFull Vite build
npm run build:allSass + Vite build combined
npm run cleanClear dist/ folder
Vite + Dart Sass modern-compiler is configured in vite.config.js. Only Dart Sass 1.70+ is supported. Legacy node-sass is not compatible.

Mastors Ecosystem

Mastors Core is the dependency base for all Mastors CDN libraries. Each library uses @use '@mastorscdn/core' as mc to access tokens, functions, and mixins.

LibraryRoleDepends on Core
@mastors/coreFoundation — tokens, theming, utilities, reset—
@mastors/flexerFlexbox utility system✅ Yes
@mastors/gridderCSS Grid layout system✅ Yes
@mastors/fluiderFluid typography & responsive fonts✅ Yes
scss — consuming core in a library
// In mastors-flexer/_index.scss
@use '@mastorscdn/core' as mc;

.mastors-flex-container {
  @include mc.up('md') { display: flex; }
}

.mastors-flex-gap {
  gap: mc.rem(16);
}

Best Practices

1
Always @use, never @import
Dart Sass modern modules only. @import is deprecated and breaks tree-shaking.
2
Use token functions, not raw values
Write mc.color('primary') not #2563eb. Tokens are refactorable; magic numbers aren't.
3
Use CSS variables for theme-switchable properties
Colors and backgrounds should use var(--mastors-*) so they respond to dark/custom themes at runtime.
4
Mobile first always
Start with mobile base styles, layer up with @include mc.up('md'). Avoid down() as primary breakpoints.
5
Test every component in dark mode
Add data-theme="dark" to HTML and verify. If it looks broken, you have hard-coded color values.
6
Use semantic color variables in components
var(--mastors-color-danger) not var(--mastors-color-red-600) for semantically meaningful choices.
7
Namespace your @use aliases
Use as mc, as flex, as grid to prevent name conflicts in large projects.