$ yarn add @kirschbaum-development/tailwindcss-scale-utilities --dev
or
$ npm install @kirschbaum-development/tailwindcss-scale-utilities --save-dev
theme: {
scale: {
0: 0,
25: '.25',
50: '.5',
75: '.75',
1: 1
}
},
variants: {
scale: ['responsive', 'hover', 'focus']
}
// tailwind.config.js
{
theme: {
scale: {
'90': '0.9',
'100': '1',
'110': '1.1'
}
},
variants: {
scale: ['responsive']
},
plugins: [
require('tailwindcss-scale-utilities')()
]
}
This plugin generates the following utilities:
/* configurable with the "scale" theme object */
.scale-[key] {
transform: scale([value]);
}
/* specifying a negative key will follow framework conventions */
.-scale-[key] {
transform: scale([value]);
}