test_extractor_extract_candidates() — tailwindcss Function Reference
Architecture documentation for the test_extractor_extract_candidates() function in mod.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD baeaa317_38dd_ddfe_d711_87f6ff21386a["test_extractor_extract_candidates()"] 0fcd0fda_f6d1_052f_9575_133f5b2763a7["mod.rs"] baeaa317_38dd_ddfe_d711_87f6ff21386a -->|defined in| 0fcd0fda_f6d1_052f_9575_133f5b2763a7 0b7ae7d0_7e0e_b8cd_767a_15a18e3d04c9["assert_extract_sorted_candidates()"] baeaa317_38dd_ddfe_d711_87f6ff21386a -->|calls| 0b7ae7d0_7e0e_b8cd_767a_15a18e3d04c9 style baeaa317_38dd_ddfe_d711_87f6ff21386a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/oxide/src/extractor/mod.rs lines 461–570
fn test_extractor_extract_candidates() {
for (input, expected) in [
// Simple utility
("flex", vec!["flex"]),
// Simple utility with special character(s)
("@container", vec!["@container"]),
// Single character utility
("a", vec!["a"]),
// Simple utility with dashes
("items-center", vec!["items-center"]),
// Simple utility with numbers
("px-2.5", vec!["px-2.5"]),
// Simple variant with simple utility
("hover:flex", vec!["hover:flex"]),
// Arbitrary properties
("[color:red]", vec!["[color:red]"]),
("![color:red]", vec!["![color:red]"]),
("[color:red]!", vec!["[color:red]!"]),
("[color:red]/20", vec!["[color:red]/20"]),
("![color:red]/20", vec!["![color:red]/20"]),
("[color:red]/20!", vec!["[color:red]/20!"]),
// With multiple variants
("hover:focus:flex", vec!["hover:focus:flex"]),
// Exceptions:
//
// Keys inside of a JS object could be a variant-less candidate. Vue example.
("{ underline: true }", vec!["underline", "true"]),
// With complex variants
(
"[&>[data-slot=icon]:last-child]:right-2.5",
vec!["[&>[data-slot=icon]:last-child]:right-2.5"],
),
// With multiple (complex) variants
(
"[&>[data-slot=icon]:last-child]:sm:right-2.5",
vec!["[&>[data-slot=icon]:last-child]:sm:right-2.5"],
),
(
"sm:[&>[data-slot=icon]:last-child]:right-2.5",
vec!["sm:[&>[data-slot=icon]:last-child]:right-2.5"],
),
// Exceptions regarding boundaries
//
// `flex!` is valid, but since it's followed by a non-boundary character it's invalid.
// `block` is therefore also invalid because it didn't start after a boundary.
("flex!block", vec![]),
] {
for (wrapper, additional) in [
// No wrapper
("{}", vec![]),
// With leading spaces
(" {}", vec![]),
(" {}", vec![]),
(" {}", vec![]),
// With trailing spaces
("{} ", vec![]),
("{} ", vec![]),
("{} ", vec![]),
// Surrounded by spaces
(" {} ", vec![]),
// Inside a string
("'{}'", vec![]),
// Inside a function call
("fn('{}')", vec![]),
// Inside nested function calls
("fn1(fn2('{}'))", vec![]),
// --------------------------
//
// HTML
// Inside a class (on its own)
(r#"<div class="{}"></div>"#, vec!["class"]),
// Inside a class (first)
(r#"<div class="{} foo"></div>"#, vec!["class", "foo"]),
// Inside a class (second)
(r#"<div class="foo {}"></div>"#, vec!["class", "foo"]),
// Inside a class (surrounded)
(
r#"<div class="foo {} bar"></div>"#,
vec!["class", "foo", "bar"],
),
// --------------------------
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_extractor_extract_candidates() do?
test_extractor_extract_candidates() is a function in the tailwindcss codebase, defined in crates/oxide/src/extractor/mod.rs.
Where is test_extractor_extract_candidates() defined?
test_extractor_extract_candidates() is defined in crates/oxide/src/extractor/mod.rs at line 461.
What does test_extractor_extract_candidates() call?
test_extractor_extract_candidates() calls 1 function(s): assert_extract_sorted_candidates.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free