alphaReplacedDropShadowProperties() — tailwindcss Function Reference
Architecture documentation for the alphaReplacedDropShadowProperties() function in utilities.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 2fb3c38b_1032_ddeb_49cf_fcc482602e23["alphaReplacedDropShadowProperties()"] ffde8eb7_7def_91ee_918c_be4f250f76a2["utilities.ts"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|defined in| ffde8eb7_7def_91ee_918c_be4f250f76a2 c58cbb33_f3cc_0b4f_844a_15bf66a1dc61["segment()"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|calls| c58cbb33_f3cc_0b4f_844a_15bf66a1dc61 da3c2484_686d_b298_523c_750c3035414c["replaceShadowColors()"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|calls| da3c2484_686d_b298_523c_750c3035414c 2e8f6051_b6e8_4985_14e1_e11717a8d2ab["withAlpha()"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|calls| 2e8f6051_b6e8_4985_14e1_e11717a8d2ab c9298b5e_9901_b387_90f5_20565f550298["replaceAlpha()"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|calls| c9298b5e_9901_b387_90f5_20565f550298 1369a6dc_e395_347d_5d24_b88e22c5446d["decl()"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|calls| 1369a6dc_e395_347d_5d24_b88e22c5446d 085cf56e_8188_afb1_04da_5ccd0fb7babc["rule()"] 2fb3c38b_1032_ddeb_49cf_fcc482602e23 -->|calls| 085cf56e_8188_afb1_04da_5ccd0fb7babc style 2fb3c38b_1032_ddeb_49cf_fcc482602e23 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
Defined In
Source
Frequently Asked Questions
What does alphaReplacedDropShadowProperties() do?
alphaReplacedDropShadowProperties() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/utilities.ts.
Where is alphaReplacedDropShadowProperties() defined?
alphaReplacedDropShadowProperties() is defined in packages/tailwindcss/src/utilities.ts at line 6493.
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