0.0.1 • Published 2 years ago

tailwind-preset-primer v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

tailwind-preset-primer

Tailwind preset for the GitHub Design System (Primer)

Getting started

To install tailwind-preset-primer in your project, you will need to run the following command using npm:

npm install -S tailwind-preset-primer

If you prefer Yarn, use the following command instead:

yarn add tailwind-preset-primer

You can then add this package as a preset in your project's tailwind.config.js file:

module.exports = {
  presets: [require('tailwind-preset-primer')],
};

Supported themes

tailwind-preset-primer supports the following themes from Primer out-of-the-box:

ThemeImport
dark-colorblindrequire('tailwind-preset-primer/dark-colorblind')
dark-high-contrastrequire('tailwind-preset-primer/dark-high-contrast')
dark-tritanopiarequire('tailwind-preset-primer/dark-tritanopia')
darkrequire('tailwind-preset-primer/dark')
light-colorblindrequire('tailwind-preset-primer/light-colorblind')
light-dimmedrequire('tailwind-preset-primer/light-dimmed')
light-high-contrastrequire('tailwind-preset-primer/light-high-contrast')
light-tritanopiarequire('tailwind-preset-primer/light-tritanopia')
lightrequire('tailwind-preset-primer/light')

The preset also includes support for a dynamic theme through require('tailwind-preset-primer/dynamic'). The dynamic theme allows you to swap between themes instead of using only one theme.

Dynamic theme

The dynamic theme requires your project to setup CSS Custom Properties from @primer/primitives that correspond to the various color scales and tokens based on each theme.

You can find an example of this using Sass in our Next.js example.

📚 Examples

If you're looking for more examples on how to use tailwind-preset-primer, we have some examples that you can check out:

📝 License

Licensed under the Apache 2.0 License.