Skip to content

Commit 331f009

Browse files
committed
Rename variable
1 parent af51d4b commit 331f009

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
@@ -4280,7 +4280,7 @@ export function createUtilities(theme: Theme) {
42804280
let textShadowProperties = () => {
42814281
return atRoot([
42824282
property('--tw-text-shadow-color'),
4283-
property('--tw-text-shadow-intensity', '100%', '<percentage>'),
4283+
property('--tw-text-shadow-alpha', '100%', '<percentage>'),
42844284
])
42854285
}
42864286

@@ -4290,14 +4290,14 @@ export function createUtilities(theme: Theme) {
42904290
])
42914291

42924292
utilities.functional('text-shadow', (candidate) => {
4293-
let intensity: string | undefined
4293+
let alpha: string | undefined
42944294

42954295
if (candidate.modifier) {
42964296
if (candidate.modifier.kind === 'arbitrary') {
4297-
intensity = candidate.modifier.value
4297+
alpha = candidate.modifier.value
42984298
} else {
42994299
if (isPositiveInteger(candidate.modifier.value)) {
4300-
intensity = `${candidate.modifier.value}%`
4300+
alpha = `${candidate.modifier.value}%`
43014301
}
43024302
}
43034303
}
@@ -4308,14 +4308,10 @@ export function createUtilities(theme: Theme) {
43084308

43094309
return [
43104310
textShadowProperties(),
4311-
decl('--tw-text-shadow-intensity', intensity),
4311+
decl('--tw-text-shadow-alpha', alpha),
43124312
decl(
43134313
'text-shadow',
4314-
replaceShadowColors(
4315-
value,
4316-
intensity,
4317-
(color) => `var(--tw-text-shadow-color, ${color})`,
4318-
),
4314+
replaceShadowColors(value, alpha, (color) => `var(--tw-text-shadow-color, ${color})`),
43194315
),
43204316
]
43214317
}
@@ -4330,18 +4326,18 @@ export function createUtilities(theme: Theme) {
43304326
if (value === null) return
43314327
return [
43324328
textShadowProperties(),
4333-
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-intensity)')),
4329+
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-alpha)')),
43344330
]
43354331
}
43364332
default: {
43374333
return [
43384334
textShadowProperties(),
4339-
decl('--tw-text-shadow-intensity', intensity),
4335+
decl('--tw-text-shadow-alpha', alpha),
43404336
decl(
43414337
'text-shadow',
43424338
replaceShadowColors(
43434339
value,
4344-
intensity,
4340+
alpha,
43454341
(color) => `var(--tw-text-shadow-color, ${color})`,
43464342
),
43474343
),
@@ -4362,14 +4358,10 @@ export function createUtilities(theme: Theme) {
43624358
if (value) {
43634359
return [
43644360
textShadowProperties(),
4365-
decl('--tw-text-shadow-intensity', intensity),
4361+
decl('--tw-text-shadow-alpha', alpha),
43664362
decl(
43674363
'text-shadow',
4368-
replaceShadowColors(
4369-
value,
4370-
intensity,
4371-
(color) => `var(--tw-text-shadow-color, ${color})`,
4372-
),
4364+
replaceShadowColors(value, alpha, (color) => `var(--tw-text-shadow-color, ${color})`),
43734365
),
43744366
]
43754367
}
@@ -4381,7 +4373,7 @@ export function createUtilities(theme: Theme) {
43814373
if (value) {
43824374
return [
43834375
textShadowProperties(),
4384-
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-intensity)')),
4376+
decl('--tw-text-shadow-color', withAlpha(value, 'var(--tw-text-shadow-alpha)')),
43854377
]
43864378
}
43874379
}
@@ -4418,10 +4410,10 @@ export function createUtilities(theme: Theme) {
44184410
return atRoot([
44194411
property('--tw-shadow', nullShadow),
44204412
property('--tw-shadow-color'),
4421-
property('--tw-shadow-intensity', '100%', '<percentage>'),
4413+
property('--tw-shadow-alpha', '100%', '<percentage>'),
44224414
property('--tw-inset-shadow', nullShadow),
44234415
property('--tw-inset-shadow-color'),
4424-
property('--tw-inset-shadow-intensity', '100%', '<percentage>'),
4416+
property('--tw-inset-shadow-alpha', '100%', '<percentage>'),
44254417
property('--tw-ring-color'),
44264418
property('--tw-ring-shadow', nullShadow),
44274419
property('--tw-inset-ring-color'),
@@ -4438,14 +4430,14 @@ export function createUtilities(theme: Theme) {
44384430
staticUtility('shadow-initial', [boxShadowProperties, ['--tw-shadow-color', 'initial']])
44394431

44404432
utilities.functional('shadow', (candidate) => {
4441-
let intensity: string | undefined
4433+
let alpha: string | undefined
44424434

44434435
if (candidate.modifier) {
44444436
if (candidate.modifier.kind === 'arbitrary') {
4445-
intensity = candidate.modifier.value
4437+
alpha = candidate.modifier.value
44464438
} else {
44474439
if (isPositiveInteger(candidate.modifier.value)) {
4448-
intensity = `${candidate.modifier.value}%`
4440+
alpha = `${candidate.modifier.value}%`
44494441
}
44504442
}
44514443
}
@@ -4456,10 +4448,10 @@ export function createUtilities(theme: Theme) {
44564448

44574449
return [
44584450
boxShadowProperties(),
4459-
decl('--tw-shadow-intensity', intensity),
4451+
decl('--tw-shadow-alpha', alpha),
44604452
decl(
44614453
'--tw-shadow',
4462-
replaceShadowColors(value, intensity, (color) => `var(--tw-shadow-color, ${color})`),
4454+
replaceShadowColors(value, alpha, (color) => `var(--tw-shadow-color, ${color})`),
44634455
),
44644456
decl('box-shadow', cssBoxShadowValue),
44654457
]
@@ -4476,20 +4468,16 @@ export function createUtilities(theme: Theme) {
44764468

44774469
return [
44784470
boxShadowProperties(),
4479-
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-intensity)')),
4471+
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-alpha)')),
44804472
]
44814473
}
44824474
default: {
44834475
return [
44844476
boxShadowProperties(),
4485-
decl('--tw-shadow-intensity', intensity),
4477+
decl('--tw-shadow-alpha', alpha),
44864478
decl(
44874479
'--tw-shadow',
4488-
replaceShadowColors(
4489-
value,
4490-
intensity,
4491-
(color) => `var(--tw-shadow-color, ${color})`,
4492-
),
4480+
replaceShadowColors(value, alpha, (color) => `var(--tw-shadow-color, ${color})`),
44934481
),
44944482
decl('box-shadow', cssBoxShadowValue),
44954483
]
@@ -4513,10 +4501,10 @@ export function createUtilities(theme: Theme) {
45134501
if (value) {
45144502
return [
45154503
boxShadowProperties(),
4516-
decl('--tw-shadow-intensity', intensity),
4504+
decl('--tw-shadow-alpha', alpha),
45174505
decl(
45184506
'--tw-shadow',
4519-
replaceShadowColors(value, intensity, (color) => `var(--tw-shadow-color, ${color})`),
4507+
replaceShadowColors(value, alpha, (color) => `var(--tw-shadow-color, ${color})`),
45204508
),
45214509
decl('box-shadow', cssBoxShadowValue),
45224510
]
@@ -4529,7 +4517,7 @@ export function createUtilities(theme: Theme) {
45294517
if (value) {
45304518
return [
45314519
boxShadowProperties(),
4532-
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-intensity)')),
4520+
decl('--tw-shadow-color', withAlpha(value, 'var(--tw-shadow-alpha)')),
45334521
]
45344522
}
45354523
}
@@ -4557,14 +4545,14 @@ export function createUtilities(theme: Theme) {
45574545
])
45584546

45594547
utilities.functional('inset-shadow', (candidate) => {
4560-
let intensity: string | undefined
4548+
let alpha: string | undefined
45614549

45624550
if (candidate.modifier) {
45634551
if (candidate.modifier.kind === 'arbitrary') {
4564-
intensity = candidate.modifier.value
4552+
alpha = candidate.modifier.value
45654553
} else {
45664554
if (isPositiveInteger(candidate.modifier.value)) {
4567-
intensity = `${candidate.modifier.value}%`
4555+
alpha = `${candidate.modifier.value}%`
45684556
}
45694557
}
45704558
}
@@ -4575,14 +4563,10 @@ export function createUtilities(theme: Theme) {
45754563

45764564
return [
45774565
boxShadowProperties(),
4578-
decl('--tw-inset-shadow-intensity', intensity),
4566+
decl('--tw-inset-shadow-alpha', alpha),
45794567
decl(
45804568
'--tw-inset-shadow',
4581-
replaceShadowColors(
4582-
value,
4583-
intensity,
4584-
(color) => `var(--tw-inset-shadow-color, ${color})`,
4585-
),
4569+
replaceShadowColors(value, alpha, (color) => `var(--tw-inset-shadow-color, ${color})`),
45864570
),
45874571
decl('box-shadow', cssBoxShadowValue),
45884572
]
@@ -4599,18 +4583,18 @@ export function createUtilities(theme: Theme) {
45994583

46004584
return [
46014585
boxShadowProperties(),
4602-
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-intensity)')),
4586+
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-alpha)')),
46034587
]
46044588
}
46054589
default: {
46064590
return [
46074591
boxShadowProperties(),
4608-
decl('--tw-inset-shadow-intensity', intensity),
4592+
decl('--tw-inset-shadow-alpha', alpha),
46094593
decl(
46104594
'--tw-inset-shadow',
46114595
`inset ${replaceShadowColors(
46124596
value,
4613-
intensity,
4597+
alpha,
46144598
(color) => `var(--tw-inset-shadow-color, ${color})`,
46154599
)}`,
46164600
),
@@ -4637,12 +4621,12 @@ export function createUtilities(theme: Theme) {
46374621
if (value) {
46384622
return [
46394623
boxShadowProperties(),
4640-
decl('--tw-inset-shadow-intensity', intensity),
4624+
decl('--tw-inset-shadow-alpha', alpha),
46414625
decl(
46424626
'--tw-inset-shadow',
46434627
replaceShadowColors(
46444628
value,
4645-
intensity,
4629+
alpha,
46464630
(color) => `var(--tw-inset-shadow-color, ${color})`,
46474631
),
46484632
),
@@ -4657,7 +4641,7 @@ export function createUtilities(theme: Theme) {
46574641
if (value) {
46584642
return [
46594643
boxShadowProperties(),
4660-
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-intensity)')),
4644+
decl('--tw-inset-shadow-color', withAlpha(value, 'var(--tw-inset-shadow-alpha)')),
46614645
]
46624646
}
46634647
}

0 commit comments

Comments
 (0)