diff --git a/README.md b/README.md index 204025a..32b8d78 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,20 @@ Now all colors within dracula will require the dracula prefix ``` +## Changing color names +You can just pull in some of the colors and add them to tailwind +``` +const dracula = require('tailwind-dracula/colors') +theme: { + extend: { + colors: { + ...dracula //adds all the colors + pinkish: dracula.buffy //just adds buffy with the name 'pinkish' + } + } + }, +``` + ## Color Palette Palette | Hex | RGB | HSL | ![Color Picker Boxes](https://draculatheme.com/static/img/color-boxes/eyedropper.png) diff --git a/index.js b/index.js index d51af2e..271e347 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,38 @@ const plugin = require('tailwindcss/plugin') -module.exports = plugin(function({ theme }) { +module.exports = function (prefix, hard = false) { + let module = plugin(function({ theme }) { -}, { - theme: { - extend: { - colors: theme => (colors) - } - } -}) + }, { + theme: { + extend: { + colors: theme => ({ + [prefix ? prefix + '-darker' : 'darker']: '#282a36', + [prefix ? prefix + '-dark' : 'dark']: '#44475a', + [prefix ? prefix + '-light' : 'light']: '#f8f8f2', + [prefix ? prefix + '-blue' : 'blue']: '#6272a4', + [prefix ? prefix + '-cyan' : 'cyan']: '#8be9fd', + [prefix ? prefix + '-green' : 'green']: '#50fa7b', + [prefix ? prefix + '-orange' : 'orange']: '#ffb86c', + [prefix ? prefix + '-pink' : 'pink']: '#ff79c6', + [prefix ? prefix + '-purple' : 'purple']: '#bd93f9', + [prefix ? prefix + '-red' : 'red']: '#ff5555', + [prefix ? prefix + '-yellow' : 'yellow']: '#f1fa8c', + [prefix && hard ? prefix + '-nosferatu' : 'nosferatu']: '#282a36', + [prefix && hard ? prefix + '-aro' : 'aro']: '#44475a', + [prefix && hard ? prefix + '-cullen' : 'cullen']: '#f8f8f2', + [prefix && hard ? prefix + '-vonCount' : 'vonCount']: '#6272a4', + [prefix && hard ? prefix + '-vanHelsing' : 'vanHelsing']: '#8be9fd', + [prefix && hard ? prefix + '-blade' : 'blade']: '#50fa7b', + [prefix && hard ? prefix + '-morbius' : 'morbius']: '#ffb86c', + [prefix && hard ? prefix + '-buffy' : 'buffy']: '#ff79c6', + [prefix && hard ? prefix + '-dracula' : 'dracula']: '#bd93f9', + [prefix && hard ? prefix + '-marcelin' : 'marcelin']: '#ff5555', + [prefix && hard ? prefix + '-lincoln' : 'lincoln']: '#f1fa8c', + }) + } + } + }) + + return module; +}