Lesli CSS

Shared Sass utilities and color tokens for Lesli applications.


Lesli CSS test status npm version Codecov Sonar quality gate


Introduction

Lesli CSS is the shared styling foundation for Lesli products. It provides reusable Sass functions, mixins, layout helpers, and a centralized color system for applications built with Sass, plain CSS, or Tailwind CSS.

The Sass color maps are the source of truth. During the package build they are also exported as CSS custom properties, allowing Sass and CSS-based tools to use exactly the same palette without copying color values between projects.


Features

  • A shared primary and semantic color system
  • Reusable categorical palettes and decoupled engine identity aliases
  • Portable CSS custom properties generated from the Sass maps
  • Tailwind CSS v4-compatible design tokens
  • Responsive breakpoint helpers
  • Typography, flexbox, shadow, container, and scrollbar mixins
  • Sass modules using the modern @use API


Installation

Requirements

  • Node.js and npm
  • Sass when compiling Sass source; the compatible version is installed with this package

Install the package with npm:

npm install lesli-css


Quick Start

Import the library as a Sass module:

@use "lesli-css" as lesli;

.button {
    background-color: lesli.lesli-color(primary, 500);
    color: lesli.lesli-color(neutral, 50);
}

.notification {
    background-color: lesli.lesli-color(success, 100);
    color: lesli.lesli-color(success, 800);
}

The default variant is 500, so these declarations are equivalent:

color: lesli.lesli-color(success);
color: lesli.lesli-color(success, 500);


Color System

The Lesli color system separates brand, semantic state, foundation, reusable categories, and product identity:

Lesli Color System
├── Brand
│   └── Primary
│       └── Lesli Blue (`primary-500`, `#276AD6`)
├── Semantic
│   ├── Info
│   ├── Success
│   ├── Warning
│   └── Danger
├── Foundation
│   └── Neutral
├── Categorical
│   ├── Rose, Orange, Gold, Lime, Teal
│   └── Cyan, Sky, Indigo, Violet, Magenta
└── Engines
    └── Stable product identities mapped to categorical families
Layer Palette Variants Purpose
Brand primary 50–900 Lesli Blue, brand identity, and primary actions
Foundation neutral 50–900 Text, borders, surfaces, and disabled states
Semantic info 50–900 Informational messages and states
Semantic success 50–900 Successful actions and positive states
Semantic warning 50–900 Warnings and actions that need attention
Semantic danger 50–900 Errors and destructive actions
Foundation black 50–900 Neutral dark tones

Brand color: Lesli Blue

Lesli Blue is the official name of the Lesli brand color. Its canonical token is primary-500 and its value is #276AD6.

Use the name Lesli Blue when referring to the brand color in design and documentation. Use the primary token family in code so applications continue to consume the stable public API:

.lesli-brand-surface {
    background-color: lesli.lesli-color(primary, 500); // Lesli Blue
}
.lesli-brand-surface {
    background-color: var(--lesli-color-primary-500); /* Lesli Blue */
}

Semantic interface colors

The semantic scales bring Lesli closer to Tailwind's sky, emerald, amber and rose tones, with adjusted solid shades for readable button labels. Token names and shade keys remain unchanged. Use 50–100 for soft backgrounds, 200–300 for decorative borders, 500 for solid actions, 600 for hover, and 700–900 for text and stronger states.

The scales use perceptually spaced OKLab transitions around the fixed 500 identity colors. Shades 50–100 retain their soft surface colors; 600 is the hover tone. Warning also retains its 600 to preserve contrast with dark labels. Shades 200–300 are decorative borders, not sufficient on their own to identify interactive controls or focus states.

Solid surface Color Foreground Contrast
info-500 #087EAE White 4.56:1
success-500 #09855E White 4.64:1
warning-500 #F0A51B warning-900 (#452B08) 6.31:1
danger-500 #D73554 White 4.64:1

These ratios apply to the listed opaque pairs. Check contrast again when adding opacity or using different foregrounds. In particular, warning requires dark text; its 600 hover surface also keeps at least 4.5:1 against warning-900. The default semantic alias resolves to 500, the main solid action tone. Use 500 for info, success and danger buttons with white text and 600 for hover.

Palette 50 100 200 300 400 500 600 700 800 900
Info #F0F9FF #DEF2FC #B0D5E9 #82B7D5 #529BC2 #087EAE #0F6F99 #136085 #145271 #14445E
Success #EDFCF5 #D5F7E7 #A9DAC3 #7DBDA0 #4FA17E #09855E #0E7554 #11664A #125740 #124936
Warning #FFFBED #FFF1C6 #FCDEA4 #F9CC80 #F5B858 #F0A51B #D18B10 #97620E #71490C #452B08
Danger #FFF1F4 #FFE1E8 #FABAC1 #F1929C #E56877 #D73554 #BF324D #A72E45 #902A3E #792637

Warning 700 is tuned for readable text on warning-100. Across all four palettes, use 100 with 700 for badges and 50 with 900 for messages.

Upgrading from 4.1.0

Version 4.2.0 refreshes the semantic colors while retaining the public Sass and CSS token names. The default Sass variant remains 500. Rebuild consuming stylesheets after updating the dependency; generated CSS contains the palette from the installed package version.

Use 500 for the base solid action and 600 for hover. If an application adopted the interim 600 base and 700 hover recommendation, return those solid actions to 500 and 600. Keep white labels for Info, Success and Danger, and warning-900 labels for Warning. Recheck custom opacity and foreground pairs.

See release notes for the complete release summary.

The primary, neutral, categorical and engine identity palettes are unchanged. Rebuild css/colors.css after modifying the Sass maps before distributing the updated package.

Categorical colors

Categorical colors are reusable, non-semantic colors for categories, datasets, charts, calendars, avatars, tabs, modules, and other product areas. They do not communicate success, warning, danger, or information. Each family has five intentional roles: 100 for subtle backgrounds, 300 for soft accents, 500 for identity, 700 for strong accents, and 900 for dark surfaces and foregrounds.

The ten Lesli categorical families, each shown at shades 100, 300, 500, 700, and 900

Family 100 300 500 700 900
Rose #FEE8EC #F5A3B5 #D24572 #90314E #501C2B
Orange #FCEBE0 #E8B08B #C96E20 #834511 #49260A
Gold #F6F2E3 #D9CB95 #B89D2B #715F14 #3C320A
Lime #EEF5E4 #BED499 #83A730 #526A1B #2B380E
Teal #E4F3ED #97CBB8 #239576 #1D6651 #12382C
Cyan #E3F2F4 #94C9CF #22909B #15636B #0F373B
Sky #E4F1FA #97C4E4 #2B88C0 #215E83 #143448
Indigo #E9EEFE #A6BBFA #526EE3 #3D519F #212D58
Violet #F1EBFE #C7AFF4 #9260DA #644394 #372552
Magenta #FCE7F9 #E6A4E0 #BE47B8 #82337D #481D45

Use a categorical token when the color represents a reusable category rather than semantic state or a specific Lesli product:

.chart-series {
    color: lesli.lesli-color(categorical-sky, 500);
}

Engine colors

Engine colors are product identity aliases. Each engine resolves to a categorical palette, so an assignment can change later without changing application markup or components.

Engine Categorical palette
engine-administration categorical-sky
engine-intelligence categorical-violet
engine-productivity categorical-orange
engine-integration categorical-magenta
engine-analytics categorical-cyan
engine-security categorical-indigo
engine-finance categorical-gold
engine-sales categorical-rose
engine-it categorical-teal

categorical-lime is intentionally unassigned and remains available for charts, datasets, calendars, modules, and future Engines.

Engine aliases expose the complete five-step scale. The default Sass variant remains 500:

.administration-module {
    color: lesli.lesli-color(engine-administration);
}

.finance-module {
    background-color: lesli.lesli-color(engine-finance, 100);
    color: lesli.lesli-color(engine-finance, 700);
}

The palette assignment is an implementation and theme decision. Engine consumers should use engine-* tokens instead of depending directly on the assigned categorical family. Assignments can then change centrally without application code changes.

Categorical 500 values are identity colors, not automatic foreground/background pairs. In particular, do not assume white text is accessible on every 500; use the appropriate existing foreground token or a darker categorical shade for solid surfaces.

Legacy collection aliases

The previous family names, their categorical-* forms, and collection Engine aliases remain available with their historical values in a deprecated compatibility layer. They are not current categorical colors. New code should use the families listed above and engine-* identities:

// Deprecated compatibility APIs
color: lesli.lesli-color(cenote, 500);
color: lesli.lesli-color(categorical-cenote, 500);
color: lesli.lesli-color(collection, administration);


CSS Custom Properties

Projects that do not compile Sass can import the generated color tokens:

@import "lesli-css/css/colors.css";

.button {
    background-color: var(--lesli-color-primary-500);
    color: var(--lesli-color-neutral-50);
}

.notification {
    border-color: var(--lesli-color-warning-300);
}

The package generates variables for every palette entry, including:

--lesli-color-primary-500: #276AD6;
--lesli-color-success-500: #09855E;
--lesli-color-categorical-sky-300: #97C4E4;
--lesli-color-engine-finance-500: var(--lesli-color-categorical-gold-500);

Deprecated family variables retain their historical values, while aliases such as --lesli-color-collection-finance resolve to the current Engine identity.

[!NOTE] Package imports in CSS must be processed by a bundler or CSS compiler that resolves dependencies from node_modules.

Generate variables from Sass

The variable generator is also available as a mixin. This is useful when the variables must be emitted inside another selector or use a custom prefix:

@use "lesli-css" as lesli;

:root {
    @include lesli.lesli-color-variables();
}

.embedded-application {
    @include lesli.lesli-color-variables("--embedded-color");
}


Tailwind CSS v4

Import the generated variables and map them to Tailwind theme tokens:

@import "tailwindcss";
@import "lesli-css/css/colors.css";

@theme inline {
    --color-primary-50: var(--lesli-color-primary-50);
    --color-primary-500: var(--lesli-color-primary-500);
    --color-primary-600: var(--lesli-color-primary-600);
    --color-primary-900: var(--lesli-color-primary-900);
    --color-neutral-900: var(--lesli-color-neutral-900);

    --color-success-500: var(--lesli-color-success-500);
    --color-warning-500: var(--lesli-color-warning-500);
    --color-danger-500: var(--lesli-color-danger-500);

    --color-categorical-sky-300: var(--lesli-color-categorical-sky-300);
    --color-engine-finance: var(--lesli-color-engine-finance-500);
}

The mapped colors become standard Tailwind utilities:

<button class="bg-primary-500 hover:bg-primary-600 text-white">
    Save changes
</button>

<p class="text-success-700">Changes saved successfully.</p>

<div class="border border-categorical-sky-300 bg-engine-finance text-neutral-900">
    Finance
</div>

Use a separate semantic variable when an application's brand color can change at runtime:

:root {
    --application-color-brand: var(--lesli-color-primary-500);
}

@theme inline {
    --color-brand: var(--application-color-brand);
}

This keeps the Lesli palette stable while allowing an account or application to override --application-color-brand.


Sass Utilities

Responsive breakpoints

@use "lesli-css" as lesli;

.navigation {
    display: none;

    @include lesli.lesli-breakpoint(tablet) {
        display: flex;
    }
}

.mobile-only {
    @include lesli.lesli-breakpoint-only-mobile() {
        display: block;
    }
}

.custom-range {
    @include lesli.lesli-breakpoint(600px, 900px) {
        padding: 2rem;
    }
}

Typography and layout

@use "lesli-css" as lesli;

@include lesli.lesli-fonts-standard("Domine", "OpenSans");

.toolbar {
    @include lesli.lesli-flex(row, center, space-between);
    @include lesli.lesli-shadow();
}

.page-container {
    @include lesli.lesli-container();
}

.scrollable-panel {
    @include lesli.lesli-scrollbar(
        normal,
        lesli.lesli-color(neutral, 400),
        transparent
    );
}


Package Structure

lesli-css/
├── css/
│   └── colors.css             Generated portable color tokens
├── scss/
│   ├── colors/
│   │   ├── categorical.scss   Canonical reusable categorical palettes
│   │   ├── engines.scss       Canonical engine identity assignments
│   │   ├── collections.scss   Legacy compatibility aliases
│   │   └── ...                Color functions and generators
│   ├── components/            Reusable components
│   ├── elements/              Element styles
│   ├── helpers/               Breakpoints, fonts, flexbox, and shadows
│   ├── layout/                Containers, normalization, and scrollbars
│   └── vendor/                Vendor styles and Normalize integration
├── _index.scss                Package Sass entry point
└── lesli.scss                 Public Sass module


Development

Clone the repository and install its dependencies:

git clone https://github.com/LesliTech/lesli-css.git
cd lesli-css
npm install

Generate the distributable color tokens:

npm run build

Build the complete development CSS and color-token outputs:

make build.css

Run the Sass test suite:

npm test

The prepack script regenerates css/colors.css automatically before the package is packed or published.

Before publishing, run npm test, npm run build, git diff --check, and npm pack --dry-run. Confirm that package.json and the root lockfile metadata declare the same version. Review solid, light and outlined states in a consuming application before releasing the package.


Documentation


Community


License

Copyright (c) 2026, Lesli Technologies, S. A.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or at your option any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

The complete license text is available in the license file.




Lesli icon

Shared styling foundations for the Lesli ecosystem.

 Edit this page

Last Update: 2026/11/18