npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cortado-holding/colors

v2.0.5

Published

Cortado Holding color system

Downloads

603

Readme

Colors

npm publish npm (scoped)

Usage

Run npm i @cortado-holding/colors in your project directory.

Use and optionally configure the Sass module:

@use '@cortado-holding/colors' with (
  $namespace: 'acme',
  $selector: 'body',
  $useDarkMode: false,
  $useDisplayP3: false
);

Use the predefined core colors module:

@use '@cortado-holding/colors/accents';
@use '@cortado-holding/colors/brands';
@use '@cortado-holding/colors/core';
@use '@cortado-holding/colors/gradients';

Use the built-in mixins

Declare your own color palette, optionally with a group name:

$myPalette: (
  'light': (
    'brand': rgb(242 59 34),
  ),
  'dark': (
    'brand': rgb(222 35 19),
  ),
);

:root {
  @include colors.palette($myPalette, 'my-group');
}

Declare multiple colors manually:

@use 'accents' with (
  $useDeclaration: false
);

.light {
  @include colors.colors(map.get(accents.$palette, 'light'), 'accent');
}

.light {
  @include colors.colors(map.get(accents.$palette, 'dark'), 'accent');
}

Declare a single color manually:

:root {
  // RGB color
  @include colors.color('custom-color', rgb(242 59 34));

  // Display P3 color
  @include colors.color('custom-color', rgb(242 59 34), true);
}

Angular Material 2

To tailor a color palette for Angular Material themes, we provide two functions: define-theme (for Angular Material 17 or earlier) and define-theme-v18 (for Angular Material 18 or later). These functions streamline the theme creation process for Angular Material in Cortado projects.

Usage Overview

Both functions require the following parameters:

  • Primary color and primary hue
  • Accent color and accent hue
  • Mode (either light or dark)

The colors should align with Cortado's palette, allowing the following values: pink, red, orange, bright-orange, yellow, green, teal, cyan, blue, dark-blue, violet, deep-violet.

The hue parameter accepts values: 50, 100, 200, up to 900.

Example of use

After ensuring Angular Material is installed, import the required modules:

@use "@angular/material" as mat;
@use "@cortado-holding/colors/angular-material" as angular-material;

Angular Material 17 or Earlier

For Angular Material 17 or earlier, use the define-theme function:

$my-light-theme: angular-material.define-theme(green, 800, blue, 500, light);
$my-dark-theme: angular-material.define-theme(green, 800, blue, 500, dark);

Angular Material 18 or Later

For Angular Material 18 or later, use the define-theme-v18 function:

$my-light-theme: angular-material.define-theme-v18(green, 800, blue, 500, light);
$my-dark-theme: angular-material.define-theme-v18(green, 800, blue, 500, dark);

Applying the Theme

To apply the generated themes:

// Apply the light theme.
@media (prefers-color-scheme: light) {
  @include mat.all-component-themes($my-light-theme);
}

// Apply the dark theme.
@media (prefers-color-scheme: dark) {
  @include mat.all-component-themes($my-dark-theme);
}

This approach provides a consistent experience across Angular Material versions, ensuring compatibility with the chosen library version.