Home / Function/ test_modifier_extraction() — tailwindcss Function Reference

test_modifier_extraction() — tailwindcss Function Reference

Architecture documentation for the test_modifier_extraction() function in modifier_machine.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  8fc388c9_9ad1_b6b1_9002_3beecb8cc242["test_modifier_extraction()"]
  2c61e6dd_1b50_c9dd_3887_d30248d91c0b["modifier_machine.rs"]
  8fc388c9_9ad1_b6b1_9002_3beecb8cc242 -->|defined in| 2c61e6dd_1b50_c9dd_3887_d30248d91c0b
  style 8fc388c9_9ad1_b6b1_9002_3beecb8cc242 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/extractor/modifier_machine.rs lines 138–166

    fn test_modifier_extraction() {
        for (input, expected) in [
            // Simple modifier
            ("foo/bar", vec!["/bar"]),
            ("foo/bar-baz", vec!["/bar-baz"]),
            // Simple modifier with numbers
            ("foo/20", vec!["/20"]),
            // Simple modifier with numbers
            ("foo/20", vec!["/20"]),
            // Arbitrary value
            ("foo/[20]", vec!["/[20]"]),
            // Arbitrary value with CSS variable shorthand
            ("foo/(--x)", vec!["/(--x)"]),
            ("foo/(--foo-bar)", vec!["/(--foo-bar)"]),
            // --------------------------------------------------------

            // Empty arbitrary value is not allowed
            ("foo/[]", vec![]),
            // Empty arbitrary value shorthand is not allowed
            ("foo/()", vec![]),
            // A CSS variable must start with `--` and must have at least a single character
            ("foo/(-)", vec![]),
            ("foo/(--)", vec![]),
            // Arbitrary value shorthand should be a valid CSS variable
            ("foo/(--my#color)", vec![]),
        ] {
            assert_eq!(ModifierMachine::test_extract_all(input), expected);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does test_modifier_extraction() do?
test_modifier_extraction() is a function in the tailwindcss codebase, defined in crates/oxide/src/extractor/modifier_machine.rs.
Where is test_modifier_extraction() defined?
test_modifier_extraction() is defined in crates/oxide/src/extractor/modifier_machine.rs at line 138.

Analyze Your Own Codebase

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

Try Supermodel Free