@cgoern/lib-colors
v1.0.0
Published
Color tooling and core colors library.
Downloads
5
Readme
Color tooling and core colors library.
Usage
Run npm i @cgoern/lib-colors in your project directory.
Use and (optionally) configure the Sass module:
@use '@cgoern/lib-colors' with (
$namespace: 'acme',
$useDarkMode: false,
$useDisplayP3: false
);Use the predefined modules:
@use '@cgoern/lib-colors/core';
@use '@cgoern/lib-colors/gray';
:root {
@include core.palette;
@include gray.palette;
}Use the built-in mixins
Declare multiple colors:
$myPalette: (
'brand': rgb(242 59 34),
'accent': rgb(52 195 117),
);
:root {
@include lib-colors.colors($myPalette);
}Declare a single color:
:root {
// RGB color
@include lib-colors.color('brand', rgb(242 59 34));
// Display P3 color
@include lib-colors.color('brand', rgb(242 59 34), true);
}