
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
tailwind-config
Advanced tools
Easily get values from your resolved Tailwind CSS config.
import tailwind from 'tailwind-config'
const config = tailwind.config('./tailwind.config')
config.theme.colors.black // '#000'
I often like to import values from my Tailwind CSS config file to keep things consistent.
Before tailwindcss@1.0.0, you could easily just import your config file from within your project. After 1.0, your config is merged with the default config in the tailwindcss package.
This package merges your config with the default config, just like Tailwind does, so you can easily get those values.
Make sure you have either npm or yarn installed.
npm install tailwind-config
# or
yarn add tailwind-config
import tailwind from 'tailwind-config'
/* or */
const tailwind = require('tailwind-config')
/* get the theme object */
const theme = tailwind.theme('./relative/path/to/your/tailwind.config')
/* get the value of a specific color */
theme.colors.red[100] // '#fff5f5'
/* use object descructuring */
const { screens, spacing } = tailwind.theme('./relative/path/to/your/tailwind.config')
screens.md // '768px'
spacing['12'] // '3rem'
Make sure to replace ./relative/path/to/your/tailwind.config with the actual relative path to your tailwind config. Alternatively you can pass an object, or pass nothing to just use the default config.
tailwind.config('./relative/path/to/your/tailwind.config')
const theme = config.theme
const plugins = config.plugins
/* ...etc */
Functions exist for each of the top level keys on the config object, as well as the config object itself:
tailwind.config()
tailwind.corePlugins()
tailwind.important()
tailwind.plugins()
tailwind.prefix()
tailwind.separator()
tailwind.theme()
tailwind.variants()
For a list of all the values on the config object, see the Tailwind github repo.
import { separator } from 'tailwind-config'
/* or */
const { separator } = require('tailwind-config')
separator('./relative/path/to/your/tailwind.config') // ':'
const config = tailwind.config('./relative/path/to/your/tailwind.config')
/* or */
import config from '../tailwind.config'
const resolvedConfig = tailwind.config(config)
For any bugs you may experience, please open an issue.
FAQs
Easily get values from your resolved tailwindcss config.
The npm package tailwind-config receives a total of 2,041 weekly downloads. As such, tailwind-config popularity was classified as popular.
We found that tailwind-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.