Home / Function/ parseVariantValue() — tailwindcss Function Reference

parseVariantValue() — tailwindcss Function Reference

Architecture documentation for the parseVariantValue() function in plugin-api.ts from the tailwindcss codebase.

Function typescript Oxide Extractor calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  18e3ad78_ceaa_f1dc_df00_cefc3e549b9c["parseVariantValue()"]
  da5d1116_ab2a_437a_6b13_c1429fd546fa["plugin-api.ts"]
  18e3ad78_ceaa_f1dc_df00_cefc3e549b9c -->|defined in| da5d1116_ab2a_437a_6b13_c1429fd546fa
  31653e23_464a_3652_4a48_0c82332a92c4["buildPluginApi()"]
  31653e23_464a_3652_4a48_0c82332a92c4 -->|calls| 18e3ad78_ceaa_f1dc_df00_cefc3e549b9c
  7d413960_20c6_4d5d_15db_b8648bd65a79["substituteAtSlot()"]
  18e3ad78_ceaa_f1dc_df00_cefc3e549b9c -->|calls| 7d413960_20c6_4d5d_15db_b8648bd65a79
  9d7d664d_b6fd_88fd_8800_4b530c33a95b["parse()"]
  18e3ad78_ceaa_f1dc_df00_cefc3e549b9c -->|calls| 9d7d664d_b6fd_88fd_8800_4b530c33a95b
  085cf56e_8188_afb1_04da_5ccd0fb7babc["rule()"]
  18e3ad78_ceaa_f1dc_df00_cefc3e549b9c -->|calls| 085cf56e_8188_afb1_04da_5ccd0fb7babc
  style 18e3ad78_ceaa_f1dc_df00_cefc3e549b9c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/plugin-api.ts lines 590–602

function parseVariantValue(resolved: string | string[], nodes: AstNode[]): AstNode[] {
  let resolvedArray = typeof resolved === 'string' ? [resolved] : resolved
  return resolvedArray.flatMap((r) => {
    if (r.trim().endsWith('}')) {
      let updatedCSS = r.replace('}', '{@slot}}')
      let ast = CSS.parse(updatedCSS)
      substituteAtSlot(ast, nodes)
      return ast
    } else {
      return rule(r, nodes)
    }
  })
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does parseVariantValue() do?
parseVariantValue() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/plugin-api.ts.
Where is parseVariantValue() defined?
parseVariantValue() is defined in packages/tailwindcss/src/compat/plugin-api.ts at line 590.
What does parseVariantValue() call?
parseVariantValue() calls 3 function(s): parse, rule, substituteAtSlot.
What calls parseVariantValue()?
parseVariantValue() is called by 1 function(s): buildPluginApi.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free