Releases: mertasan/tailwindcss-variables
Releases · mertasan/tailwindcss-variables
v1.3.1
This release updates dependencies:
dependencies | from | to |
---|---|---|
tailwindcss | ^2.2.2 | ^2.2.4 |
autoprefixer | ^10.2.5 | ^10.2.6 |
postcss | ^8.3.0 | ^8.3.5 |
eslint | ^7.27.0 | ^7.29.0 |
jest | ^27.0.1 | ^27.0.5 |
prettier | ^2.2.1 | ^2.3.1 |
peerDependencies | from | to |
---|---|---|
tailwindcss | npm:@tailwindcss/postcss7-compat@^2.2.2 | npm:@tailwindcss/postcss7-compat@^2.2.4 |
postcss | ^7.0.35 | ^7.0.36 |
v1.3.0 - New features
v1.2.1
v1.2.0
v1.1.3
v1.1.2
v1.1.1
fixes for colorVariable()
helper. ref: #2
New option:
plugins: [
require('@mertasan/tailwindcss-variables'){
colorVariables: true
}
]
Usage:
module.exports = {
theme: {
colors: {
primary: colorVariable('--colors-primary'),
secondary: colorVariable('var(--colors-secondary)'), // or
gray: 'var(--colors-gray)', // or default usage
},
}
}
Output:
:root {
--colors-primary: #ff0;
--colors-secondary: #000000;
--colors-gray: #6B7280;
--colors-primary-rgb: 255,255,0;
--colors-secondary-rgb: 0,0,0;
--colors-gray-rgb: 107,114,128
}
.text-primary {
--tw-text-opacity: 1;
color: rgba(var(--colors-primary-rgb), var(--tw-text-opacity))
}
.bg-secondary {
--tw-bg-opacity: 1;
background-color: rgba(var(--colors-secondary-rgb), var(--tw-bg-opacity))
}
.bg-gray {
background-color: var(--colors-gray)
}