mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2026-01-25 16:44:12 +00:00
* prefix custom properties with tw- * prefix custom properties with tw- in tests * prefix gradient values in the defaultConfig * inline gradient-via-color * simplify --tw-tailwind-empty to --tw-empty * replace the long --tw-font-variant-numeric-... to the way shorter --tw-fvn-... * Rename --tw-box-shadow to --tw-shadow To match class name. * Rename font-variant-numeric variables * Remove 'transform' from transform variables * Shorten gradient variables * Fix style Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
import _ from 'lodash'
|
|
import nameClass from '../util/nameClass'
|
|
|
|
export default function () {
|
|
return function ({ addUtilities, theme, variants }) {
|
|
const generators = [
|
|
(_size, modifier) => {
|
|
const size = _size === '0' ? '0px' : _size
|
|
return {
|
|
[`${nameClass('divide-y', modifier)} > :not([hidden]) ~ :not([hidden])`]: {
|
|
'--tw-divide-y-reverse': '0',
|
|
'border-top-width': `calc(${size} * calc(1 - var(--tw-divide-y-reverse)))`,
|
|
'border-bottom-width': `calc(${size} * var(--tw-divide-y-reverse))`,
|
|
},
|
|
[`${nameClass('divide-x', modifier)} > :not([hidden]) ~ :not([hidden])`]: {
|
|
'--tw-divide-x-reverse': '0',
|
|
'border-right-width': `calc(${size} * var(--tw-divide-x-reverse))`,
|
|
'border-left-width': `calc(${size} * calc(1 - var(--tw-divide-x-reverse)))`,
|
|
},
|
|
}
|
|
},
|
|
]
|
|
|
|
const utilities = _.flatMap(generators, (generator) => {
|
|
return [
|
|
..._.flatMap(theme('divideWidth'), (value, modifier) => {
|
|
return generator(value, modifier)
|
|
}),
|
|
{
|
|
'.divide-y-reverse > :not([hidden]) ~ :not([hidden])': {
|
|
'--tw-divide-y-reverse': '1',
|
|
},
|
|
'.divide-x-reverse > :not([hidden]) ~ :not([hidden])': {
|
|
'--tw-divide-x-reverse': '1',
|
|
},
|
|
},
|
|
]
|
|
})
|
|
|
|
addUtilities(utilities, variants('divideWidth'))
|
|
}
|
|
}
|