mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
* WIP * Add failing test for negating default values * Add dynamic negative value opt-in (#5713) * Add `supportsNegativeValues` plugin option * Update `getClassList` to support dynamic negative values * Add test for using a negative scale value with a plugin that does not support dynamic negative values * Support dynamic negation of `DEFAULT` values (#5718) * Add test case Co-authored-by: Brad Cornes <bradlc41@gmail.com>
27 lines
979 B
JavaScript
27 lines
979 B
JavaScript
import resolveConfig from '../src/public/resolve-config'
|
|
import { createContext } from '../src/lib/setupContextUtils'
|
|
|
|
it('should generate every possible class, without variants', () => {
|
|
let config = {}
|
|
|
|
let context = createContext(resolveConfig(config))
|
|
expect(context.getClassList()).toBeInstanceOf(Array)
|
|
|
|
// Verify we have a `container` for the 'components' section.
|
|
expect(context.getClassList()).toContain('container')
|
|
|
|
// Verify we handle the DEFAULT case correctly
|
|
expect(context.getClassList()).toContain('border')
|
|
|
|
// Verify we handle negative values correctly
|
|
expect(context.getClassList()).toContain('-inset-1/4')
|
|
expect(context.getClassList()).toContain('-m-0')
|
|
expect(context.getClassList()).not.toContain('-uppercase')
|
|
expect(context.getClassList()).not.toContain('-opacity-50')
|
|
expect(
|
|
createContext(
|
|
resolveConfig({ theme: { extend: { margin: { DEFAULT: '5px' } } } })
|
|
).getClassList()
|
|
).not.toContain('-m-DEFAULT')
|
|
})
|