Skip to content

esadewater/laravel-palette

Repository files navigation

Laravel Dynamic Colors

This package dynamically generates color palettes with different shades for usage with e.g. Tailwind-CSS.

Installation

You can install the package via composer:

composer require esadewater/laravel-palette

Usage

In Blade-Layout add new Palette with name and random colors:

@palette('primary')

This will generate the following style:

<style>
    :root {
        --color-primary-100: 244, 250, 246;
        --color-primary-200: 219, 242, 228;
        --color-primary-300: 195, 235, 209;
        --color-primary-400: 171, 224, 191;
        --color-primary-500: 147, 217, 172;
        --color-primary-600: 123, 207, 154;
        --color-primary-700: 98, 199, 135;
        --color-primary-800: 74, 189, 116;
        --color-primary-900: 61, 168, 101;
    }
</style>

You can use this colors with e.g. Tailwind-CSS:

theme: {
    extend: {
        colors: {
            primary: {
                100: "--color-primary-100",
                200: "--color-primary-200",
                300: "--color-primary-300",
                400: "--color-primary-400",
                500: "--color-primary-500",
                600: "--color-primary-600",
                700: "--color-primary-700",
                800: "--color-primary-800",
                900: "--color-primary-900"
            }
        }
    }
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •