Skip to content

Commit 64fa382

Browse files
committed
Rename variable
1 parent 578b64c commit 64fa382

File tree

1 file changed

+36
-52
lines changed

1 file changed

+36
-52
lines changed

packages/tailwindcss/src/utilities.ts

Lines changed: 36 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4358,7 +4358,7 @@ export function createUtilities(theme: Theme) {
43584358
let textShadowProperties = () => {
43594359
return atRoot([
43604360
property('--tw-text-shadow-color'),
4361-
property('--tw-text-shadow-intensity', '100%', '<percentage>'),
4361+
property('--tw-text-shadow-alpha', '100%', '<percentage>'),
43624362
])
43634363
}
43644364

@@ -4368,14 +4368,14 @@ export function createUtilities(theme: Theme) {
43684368
])
43694369

43704370
utilities.functional('text-shadow', (candidate) => {
4371-
let intensity: string | undefined
4371+
let alpha: string | undefined
43724372

43734373
if (candidate.modifier) {
43744374
if (candidate.modifier.kind === 'arbitrary') {
4375-
intensity = candidate.modifier.value
4375+
alpha = candidate.modifier.value
43764376
} else {
43774377
if (isPositiveInteger(candidate.modifier.value)) {
4378-
intensity = `${candidate.modifier.value}%`
4378+
alpha = `${candidate.modifier.value}%`
43794379
}
43804380
}
43814381
}
@@ -4386,14 +4386,10 @@ export function createUtilities(theme: Theme) {
43864386

43874387
return [
43884388
textShadowProperties(),
4389-
decl('--tw-text-shadow-intensity', intensity),
4389+
decl('--tw-text-shadow-alpha', alpha),
43904390
decl(
43914391
'text-shadow',
4392-
replaceShadowColors(
4393-
value,
4394-
intensity,
4395-
(color) => `var(--tw-text-shadow-color, ${color})`,
4396-
),
4392+
replaceShadowColors(value, alpha, (color) => `var(--tw-text-shadow-color, ${color})`),
43974393
),
43984394
]
43994395
}
@@ -4408,18 +4404,18 @@ export function createUtilities(theme: Theme) {
44084404
if (value === null) return
44094405
return [
44104406
textShadowProperties(),
4411-
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-intensity)')),
4407+
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-alpha)')),
44124408
]
44134409
}
44144410
default: {
44154411
return [
44164412
textShadowProperties(),
4417-
decl('--tw-text-shadow-intensity', intensity),
4413+
decl('--tw-text-shadow-alpha', alpha),
44184414
decl(
44194415
'text-shadow',
44204416
replaceShadowColors(
44214417
value,
4422-
intensity,
4418+
alpha,
44234419
(color) => `var(--tw-text-shadow-color, ${color})`,
44244420
),
44254421
),
@@ -4440,14 +4436,10 @@ export function createUtilities(theme: Theme) {
44404436
if (value) {
44414437
return [
44424438
textShadowProperties(),
4443-
decl('--tw-text-shadow-intensity', intensity),
4439+
decl('--tw-text-shadow-alpha', alpha),
44444440
decl(
44454441
'text-shadow',
4446-
replaceShadowColors(
4447-
value,
4448-
intensity,
4449-
(color) => `var(--tw-text-shadow-color, ${color})`,
4450-
),
4442+
replaceShadowColors(value, alpha, (color) => `var(--tw-text-shadow-color, ${color})`),
44514443
),
44524444
]
44534445
}
@@ -4459,7 +4451,7 @@ export function createUtilities(theme: Theme) {
44594451
if (value) {
44604452
return [
44614453
textShadowProperties(),
4462-
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-intensity)')),
4454+
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-alpha)')),
44634455
]
44644456
}
44654457
}
@@ -4496,10 +4488,10 @@ export function createUtilities(theme: Theme) {
44964488
return atRoot([
44974489
property('--tw-shadow', nullShadow),
44984490
property('--tw-shadow-color'),
4499-
property('--tw-shadow-intensity', '100%', '<percentage>'),
4491+
property('--tw-shadow-alpha', '100%', '<percentage>'),
45004492
property('--tw-inset-shadow', nullShadow),
45014493
property('--tw-inset-shadow-color'),
4502-
property('--tw-inset-shadow-intensity', '100%', '<percentage>'),
4494+
property('--tw-inset-shadow-alpha', '100%', '<percentage>'),
45034495
property('--tw-ring-color'),
45044496
property('--tw-ring-shadow', nullShadow),
45054497
property('--tw-inset-ring-color'),
@@ -4516,14 +4508,14 @@ export function createUtilities(theme: Theme) {
45164508
staticUtility('shadow-initial', [boxShadowProperties, ['--tw-shadow-color', 'initial']])
45174509

45184510
utilities.functional('shadow', (candidate) => {
4519-
let intensity: string | undefined
4511+
let alpha: string | undefined
45204512

45214513
if (candidate.modifier) {
45224514
if (candidate.modifier.kind === 'arbitrary') {
4523-
intensity = candidate.modifier.value
4515+
alpha = candidate.modifier.value
45244516
} else {
45254517
if (isPositiveInteger(candidate.modifier.value)) {
4526-
intensity = `${candidate.modifier.value}%`
4518+
alpha = `${candidate.modifier.value}%`
45274519
}
45284520
}
45294521
}
@@ -4534,10 +4526,10 @@ export function createUtilities(theme: Theme) {
45344526

45354527
return [
45364528
boxShadowProperties(),
4537-
decl('--tw-shadow-intensity', intensity),
4529+
decl('--tw-shadow-alpha', alpha),
45384530
decl(
45394531
'--tw-shadow',
4540-
replaceShadowColors(value, intensity, (color) => `var(--tw-shadow-color, ${color})`),
4532+
replaceShadowColors(value, alpha, (color) => `var(--tw-shadow-color, ${color})`),
45414533
),
45424534
decl('box-shadow', cssBoxShadowValue),
45434535
]
@@ -4554,20 +4546,16 @@ export function createUtilities(theme: Theme) {
45544546

45554547
return [
45564548
boxShadowProperties(),
4557-
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-intensity)')),
4549+
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-alpha)')),
45584550
]
45594551
}
45604552
default: {
45614553
return [
45624554
boxShadowProperties(),
4563-
decl('--tw-shadow-intensity', intensity),
4555+
decl('--tw-shadow-alpha', alpha),
45644556
decl(
45654557
'--tw-shadow',
4566-
replaceShadowColors(
4567-
value,
4568-
intensity,
4569-
(color) => `var(--tw-shadow-color, ${color})`,
4570-
),
4558+
replaceShadowColors(value, alpha, (color) => `var(--tw-shadow-color, ${color})`),
45714559
),
45724560
decl('box-shadow', cssBoxShadowValue),
45734561
]
@@ -4591,10 +4579,10 @@ export function createUtilities(theme: Theme) {
45914579
if (value) {
45924580
return [
45934581
boxShadowProperties(),
4594-
decl('--tw-shadow-intensity', intensity),
4582+
decl('--tw-shadow-alpha', alpha),
45954583
decl(
45964584
'--tw-shadow',
4597-
replaceShadowColors(value, intensity, (color) => `var(--tw-shadow-color, ${color})`),
4585+
replaceShadowColors(value, alpha, (color) => `var(--tw-shadow-color, ${color})`),
45984586
),
45994587
decl('box-shadow', cssBoxShadowValue),
46004588
]
@@ -4607,7 +4595,7 @@ export function createUtilities(theme: Theme) {
46074595
if (value) {
46084596
return [
46094597
boxShadowProperties(),
4610-
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-intensity)')),
4598+
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-alpha)')),
46114599
]
46124600
}
46134601
}
@@ -4635,14 +4623,14 @@ export function createUtilities(theme: Theme) {
46354623
])
46364624

46374625
utilities.functional('inset-shadow', (candidate) => {
4638-
let intensity: string | undefined
4626+
let alpha: string | undefined
46394627

46404628
if (candidate.modifier) {
46414629
if (candidate.modifier.kind === 'arbitrary') {
4642-
intensity = candidate.modifier.value
4630+
alpha = candidate.modifier.value
46434631
} else {
46444632
if (isPositiveInteger(candidate.modifier.value)) {
4645-
intensity = `${candidate.modifier.value}%`
4633+
alpha = `${candidate.modifier.value}%`
46464634
}
46474635
}
46484636
}
@@ -4653,14 +4641,10 @@ export function createUtilities(theme: Theme) {
46534641

46544642
return [
46554643
boxShadowProperties(),
4656-
decl('--tw-inset-shadow-intensity', intensity),
4644+
decl('--tw-inset-shadow-alpha', alpha),
46574645
decl(
46584646
'--tw-inset-shadow',
4659-
replaceShadowColors(
4660-
value,
4661-
intensity,
4662-
(color) => `var(--tw-inset-shadow-color, ${color})`,
4663-
),
4647+
replaceShadowColors(value, alpha, (color) => `var(--tw-inset-shadow-color, ${color})`),
46644648
),
46654649
decl('box-shadow', cssBoxShadowValue),
46664650
]
@@ -4677,18 +4661,18 @@ export function createUtilities(theme: Theme) {
46774661

46784662
return [
46794663
boxShadowProperties(),
4680-
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-intensity)')),
4664+
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-alpha)')),
46814665
]
46824666
}
46834667
default: {
46844668
return [
46854669
boxShadowProperties(),
4686-
decl('--tw-inset-shadow-intensity', intensity),
4670+
decl('--tw-inset-shadow-alpha', alpha),
46874671
decl(
46884672
'--tw-inset-shadow',
46894673
`inset ${replaceShadowColors(
46904674
value,
4691-
intensity,
4675+
alpha,
46924676
(color) => `var(--tw-inset-shadow-color, ${color})`,
46934677
)}`,
46944678
),
@@ -4715,12 +4699,12 @@ export function createUtilities(theme: Theme) {
47154699
if (value) {
47164700
return [
47174701
boxShadowProperties(),
4718-
decl('--tw-inset-shadow-intensity', intensity),
4702+
decl('--tw-inset-shadow-alpha', alpha),
47194703
decl(
47204704
'--tw-inset-shadow',
47214705
replaceShadowColors(
47224706
value,
4723-
intensity,
4707+
alpha,
47244708
(color) => `var(--tw-inset-shadow-color, ${color})`,
47254709
),
47264710
),
@@ -4735,7 +4719,7 @@ export function createUtilities(theme: Theme) {
47354719
if (value) {
47364720
return [
47374721
boxShadowProperties(),
4738-
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-intensity)')),
4722+
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-alpha)')),
47394723
]
47404724
}
47414725
}

0 commit comments

Comments
 (0)