quoteAttributeValue() — tailwindcss Function Reference
Architecture documentation for the quoteAttributeValue() function in variants.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 7cdbe16d_ed3b_5530_25a5_79bbb144f3c6["quoteAttributeValue()"] 7c96535c_85cb_d6bf_efe4_875fba595c4f["createVariants()"] 7c96535c_85cb_d6bf_efe4_875fba595c4f -->|calls| 7cdbe16d_ed3b_5530_25a5_79bbb144f3c6 2a20ea29_c850_cd61_5600_aeebbe3dda66["segment()"] 7cdbe16d_ed3b_5530_25a5_79bbb144f3c6 -->|calls| 2a20ea29_c850_cd61_5600_aeebbe3dda66 style 7cdbe16d_ed3b_5530_25a5_79bbb144f3c6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/variants.ts lines 1165–1193
function quoteAttributeValue(input: string) {
if (input.includes('=')) {
let [attribute, ...after] = segment(input, '=')
let value = after.join('=').trim()
// If the value is already quoted, skip.
if (value[0] === "'" || value[0] === '"') {
return input
}
// Handle case sensitivity flags on unescaped values
if (value.length > 1) {
let trailingCharacter = value[value.length - 1]
if (
value[value.length - 2] === ' ' &&
(trailingCharacter === 'i' ||
trailingCharacter === 'I' ||
trailingCharacter === 's' ||
trailingCharacter === 'S')
) {
return `${attribute}="${value.slice(0, -2)}" ${trailingCharacter}`
}
}
return `${attribute}="${value}"`
}
return input
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does quoteAttributeValue() do?
quoteAttributeValue() is a function in the tailwindcss codebase.
What does quoteAttributeValue() call?
quoteAttributeValue() calls 1 function(s): segment.
What calls quoteAttributeValue()?
quoteAttributeValue() is called by 1 function(s): createVariants.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free