mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Replace special handling of 'default' with 'DEFAULT'
This commit is contained in:
parent
ddd017cb38
commit
e897e40189
@ -217,7 +217,7 @@ test('responsive horizontal padding can be included by default', () => {
|
||||
},
|
||||
container: {
|
||||
padding: {
|
||||
default: '1rem',
|
||||
DEFAULT: '1rem',
|
||||
sm: '2rem',
|
||||
lg: '4rem',
|
||||
xl: '5rem',
|
||||
|
||||
@ -8,7 +8,7 @@ test('it flattens nested color objects', () => {
|
||||
25: 'rgba(255,255,255,.25)',
|
||||
50: 'rgba(255,255,255,.5)',
|
||||
75: 'rgba(255,255,255,.75)',
|
||||
default: '#fff',
|
||||
DEFAULT: '#fff',
|
||||
},
|
||||
red: {
|
||||
1: 'rgb(33,0,0)',
|
||||
|
||||
@ -2,13 +2,13 @@ import _ from 'lodash'
|
||||
import escapeClassName from '../../src/util/escapeClassName'
|
||||
import plugin from '../../src/plugins/boxShadow'
|
||||
|
||||
test('box shadow can use default keyword and negative prefix syntax', () => {
|
||||
test('box shadow can use DEFAULT keyword and negative prefix syntax', () => {
|
||||
const addedUtilities = []
|
||||
|
||||
const config = {
|
||||
theme: {
|
||||
boxShadow: {
|
||||
default: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
|
||||
DEFAULT: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
|
||||
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
||||
'-': 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)',
|
||||
'-md': '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
||||
|
||||
@ -5,7 +5,7 @@ test('generating divide width utilities', () => {
|
||||
const config = {
|
||||
theme: {
|
||||
divideWidth: {
|
||||
default: '1px',
|
||||
DEFAULT: '1px',
|
||||
'0': '0',
|
||||
'2': '2px',
|
||||
'4': '4px',
|
||||
|
||||
@ -20,7 +20,7 @@ export default function() {
|
||||
}
|
||||
|
||||
const utilities = _.fromPairs(
|
||||
_.map(_.omit(colors, 'default'), (value, modifier) => {
|
||||
_.map(_.omit(colors, 'DEFAULT'), (value, modifier) => {
|
||||
return [`.${e(`border-${modifier}`)}`, getProperties(value)]
|
||||
})
|
||||
)
|
||||
|
||||
@ -34,7 +34,7 @@ export default function() {
|
||||
|
||||
const utilities = _.flatMap(generators, generator => {
|
||||
return _.flatMap(theme('borderRadius'), (value, modifier) => {
|
||||
return generator(value, modifier === 'default' ? '' : `-${modifier}`)
|
||||
return generator(value, modifier === 'DEFAULT' ? '' : `-${modifier}`)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ export default function() {
|
||||
|
||||
const utilities = _.flatMap(generators, generator => {
|
||||
return _.flatMap(theme('borderWidth'), (value, modifier) => {
|
||||
return generator(value, modifier === 'default' ? '' : `-${modifier}`)
|
||||
return generator(value, modifier === 'DEFAULT' ? '' : `-${modifier}`)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ export default function() {
|
||||
const utilities = _.fromPairs(
|
||||
_.map(theme('boxShadow'), (value, modifier) => {
|
||||
const className =
|
||||
modifier === 'default' ? 'shadow' : `${e(prefixNegativeModifiers('shadow', modifier))}`
|
||||
modifier === 'DEFAULT' ? 'shadow' : `${e(prefixNegativeModifiers('shadow', modifier))}`
|
||||
return [
|
||||
`.${className}`,
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ function mapMinWidthsToPadding(minWidths, screens, paddings) {
|
||||
if (!_.isObject(paddings)) {
|
||||
return [
|
||||
{
|
||||
screen: 'default',
|
||||
screen: 'DEFAULT',
|
||||
minWidth: 0,
|
||||
padding: paddings,
|
||||
},
|
||||
@ -39,11 +39,11 @@ function mapMinWidthsToPadding(minWidths, screens, paddings) {
|
||||
|
||||
const mapping = []
|
||||
|
||||
if (paddings.default) {
|
||||
if (paddings.DEFAULT) {
|
||||
mapping.push({
|
||||
screen: 'default',
|
||||
screen: 'DEFAULT',
|
||||
minWidth: 0,
|
||||
padding: paddings.default,
|
||||
padding: paddings.DEFAULT,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ html {
|
||||
box-sizing: border-box; /* 1 */
|
||||
border-width: 0; /* 2 */
|
||||
border-style: solid; /* 2 */
|
||||
border-color: theme('borderColor.default', currentColor); /* 2 */
|
||||
border-color: theme('borderColor.DEFAULT', currentColor); /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -20,7 +20,7 @@ export default function() {
|
||||
}
|
||||
|
||||
const utilities = _.fromPairs(
|
||||
_.map(_.omit(colors, 'default'), (value, modifier) => {
|
||||
_.map(_.omit(colors, 'DEFAULT'), (value, modifier) => {
|
||||
return [
|
||||
`.${e(`divide-${modifier}`)} > :not(template) ~ :not(template)`,
|
||||
getProperties(value),
|
||||
|
||||
@ -24,7 +24,7 @@ export default function() {
|
||||
const utilities = _.flatMap(generators, generator => {
|
||||
return [
|
||||
..._.flatMap(theme('divideWidth'), (value, modifier) => {
|
||||
return generator(value, modifier === 'default' ? '' : `-${modifier}`)
|
||||
return generator(value, modifier === 'DEFAULT' ? '' : `-${modifier}`)
|
||||
}),
|
||||
{
|
||||
'.divide-y-reverse > :not(template) ~ :not(template)': {
|
||||
|
||||
@ -5,7 +5,7 @@ export default function() {
|
||||
addUtilities(
|
||||
_.fromPairs(
|
||||
_.map(theme('flexGrow'), (value, modifier) => {
|
||||
const className = modifier === 'default' ? 'flex-grow' : `flex-grow-${modifier}`
|
||||
const className = modifier === 'DEFAULT' ? 'flex-grow' : `flex-grow-${modifier}`
|
||||
return [
|
||||
`.${e(className)}`,
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@ export default function() {
|
||||
addUtilities(
|
||||
_.fromPairs(
|
||||
_.map(theme('flexShrink'), (value, modifier) => {
|
||||
const className = modifier === 'default' ? 'flex-shrink' : `flex-shrink-${modifier}`
|
||||
const className = modifier === 'DEFAULT' ? 'flex-shrink' : `flex-shrink-${modifier}`
|
||||
return [
|
||||
`.${e(className)}`,
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@ import toPairs from 'lodash/toPairs'
|
||||
import castArray from 'lodash/castArray'
|
||||
|
||||
function className(classPrefix, key) {
|
||||
if (key === 'default') {
|
||||
if (key === 'DEFAULT') {
|
||||
return classPrefix
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ export default function flattenColorPalette(colors) {
|
||||
}
|
||||
|
||||
return _.map(color, (value, key) => {
|
||||
const suffix = key === 'default' ? '' : `-${key}`
|
||||
const suffix = key === 'DEFAULT' ? '' : `-${key}`
|
||||
return [`${name}${suffix}`, value]
|
||||
})
|
||||
})
|
||||
|
||||
@ -182,13 +182,13 @@ module.exports = {
|
||||
},
|
||||
borderColor: theme => ({
|
||||
...theme('colors'),
|
||||
default: theme('colors.gray.300', 'currentColor'),
|
||||
DEFAULT: theme('colors.gray.300', 'currentColor'),
|
||||
}),
|
||||
borderOpacity: theme => theme('opacity'),
|
||||
borderRadius: {
|
||||
none: '0',
|
||||
sm: '0.125rem',
|
||||
default: '0.25rem',
|
||||
DEFAULT: '0.25rem',
|
||||
md: '0.375rem',
|
||||
lg: '0.5rem',
|
||||
xl: '0.75rem',
|
||||
@ -197,7 +197,7 @@ module.exports = {
|
||||
full: '9999px',
|
||||
},
|
||||
borderWidth: {
|
||||
default: '1px',
|
||||
DEFAULT: '1px',
|
||||
'0': '0',
|
||||
'2': '2px',
|
||||
'4': '4px',
|
||||
@ -206,7 +206,7 @@ module.exports = {
|
||||
boxShadow: {
|
||||
xs: '0 0 0 1px rgba(0, 0, 0, 0.05)',
|
||||
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
||||
default: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
|
||||
DEFAULT: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
|
||||
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
||||
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
||||
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
|
||||
@ -239,11 +239,11 @@ module.exports = {
|
||||
},
|
||||
flexGrow: {
|
||||
'0': '0',
|
||||
default: '1',
|
||||
DEFAULT: '1',
|
||||
},
|
||||
flexShrink: {
|
||||
'0': '0',
|
||||
default: '1',
|
||||
DEFAULT: '1',
|
||||
},
|
||||
fontFamily: {
|
||||
sans: [
|
||||
@ -638,7 +638,7 @@ module.exports = {
|
||||
transitionProperty: {
|
||||
none: 'none',
|
||||
all: 'all',
|
||||
default: 'background-color, border-color, color, fill, stroke, opacity, box-shadow, transform',
|
||||
DEFAULT: 'background-color, border-color, color, fill, stroke, opacity, box-shadow, transform',
|
||||
colors: 'background-color, border-color, color, fill, stroke',
|
||||
opacity: 'opacity',
|
||||
shadow: 'box-shadow',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user