alphaReplacedDropShadowProperties() — tailwindcss Function Reference
Architecture documentation for the alphaReplacedDropShadowProperties() function in utilities.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD db4785ee_f9d4_d30c_c923_4237d7c754d9["alphaReplacedDropShadowProperties()"] 2a20ea29_c850_cd61_5600_aeebbe3dda66["segment()"] db4785ee_f9d4_d30c_c923_4237d7c754d9 -->|calls| 2a20ea29_c850_cd61_5600_aeebbe3dda66 a71313ee_9751_a814_644d_8bed22215dfc["replaceShadowColors()"] db4785ee_f9d4_d30c_c923_4237d7c754d9 -->|calls| a71313ee_9751_a814_644d_8bed22215dfc bf187488_02a1_3fac_d926_9593a941af2d["withAlpha()"] db4785ee_f9d4_d30c_c923_4237d7c754d9 -->|calls| bf187488_02a1_3fac_d926_9593a941af2d 7f9cdd8b_d232_6558_6182_eead52aa2507["replaceAlpha()"] db4785ee_f9d4_d30c_c923_4237d7c754d9 -->|calls| 7f9cdd8b_d232_6558_6182_eead52aa2507 85b46de2_edfa_9371_e2c6_e60f3f5346a2["decl()"] db4785ee_f9d4_d30c_c923_4237d7c754d9 -->|calls| 85b46de2_edfa_9371_e2c6_e60f3f5346a2 08f33202_11d1_569a_e8df_de23eb987e2f["rule()"] db4785ee_f9d4_d30c_c923_4237d7c754d9 -->|calls| 08f33202_11d1_569a_e8df_de23eb987e2f style db4785ee_f9d4_d30c_c923_4237d7c754d9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/utilities.ts lines 6493–6542
function alphaReplacedDropShadowProperties(
property: string,
value: string,
alpha: string | null | undefined,
varInjector: (color: string) => string,
prefix: string = '',
): AstNode[] {
let requiresFallback = false
let replacedValue = segment(value, ',')
.map((value) =>
replaceShadowColors(value, (color) => {
if (alpha == null) {
return varInjector(color)
}
// When the input is currentcolor, we use our existing `color-mix(…)` approach to increase
// browser support. Note that the fallback of this is handled more generically in
// post-processing.
if (color.startsWith('current')) {
return varInjector(withAlpha(color, alpha))
}
// If any dynamic values are needed for the relative color syntax, we need to insert a
// replacement as lightningcss won't be able to resolve them statically.
if (color.startsWith('var(') || alpha.startsWith('var(')) {
requiresFallback = true
}
return varInjector(replaceAlpha(color, alpha))
}),
)
.map((value) => `drop-shadow(${value})`)
.join(' ')
if (requiresFallback) {
return [
decl(
property,
prefix +
segment(value, ',')
.map((value) => `drop-shadow(${replaceShadowColors(value, varInjector)})`)
.join(' '),
),
rule('@supports (color: lab(from red l a b))', [decl(property, prefix + replacedValue)]),
]
} else {
return [decl(property, prefix + replacedValue)]
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does alphaReplacedDropShadowProperties() do?
alphaReplacedDropShadowProperties() is a function in the tailwindcss codebase.
What does alphaReplacedDropShadowProperties() call?
alphaReplacedDropShadowProperties() calls 6 function(s): decl, replaceAlpha, replaceShadowColors, rule, segment, withAlpha.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free