Home / Function/ test_class_shorthand_followed_by_parens() — tailwindcss Function Reference

test_class_shorthand_followed_by_parens() — tailwindcss Function Reference

Architecture documentation for the test_class_shorthand_followed_by_parens() function in slim.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  afddc989_d582_e956_f525_6291d35cc4c6["test_class_shorthand_followed_by_parens()"]
  9bff01b6_bbfb_f7ed_1b53_44928706ceb7["slim.rs"]
  afddc989_d582_e956_f525_6291d35cc4c6 -->|defined in| 9bff01b6_bbfb_f7ed_1b53_44928706ceb7
  style afddc989_d582_e956_f525_6291d35cc4c6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/extractor/pre_processors/slim.rs lines 238–270

    fn test_class_shorthand_followed_by_parens() {
        let input = r#"
              body.border-t-4.p-8(class="\#{body_classes}" data-hotwire-native="\#{hotwire_native_app?}" data-controller="update-time-zone")
        "#;
        Slim::test_extract_contains(input, vec!["border-t-4", "p-8"]);

        // Additional test with CSS Variable shorthand syntax in the attribute itself because `(`
        // and `)` are not valid in the class shorthand version.
        //
        // Also included an arbitrary value including `(` and `)` to make sure that we don't
        // accidentally remove those either.
        let input = r#"
              body.p-8(class="bg-(--my-color) bg-(--my-color)/(--my-opacity) bg-[url(https://example.com)]")
        "#;
        Slim::test_extract_contains(
            input,
            vec![
                "p-8",
                "bg-(--my-color)",
                "bg-(--my-color)/(--my-opacity)",
                "bg-[url(https://example.com)]",
            ],
        );

        // Top-level class shorthand with parens
        let input = r#"
            div class="bg-(--my-color) bg-(--my-color)/(--my-opacity)"
        "#;
        Slim::test_extract_contains(
            input,
            vec!["bg-(--my-color)", "bg-(--my-color)/(--my-opacity)"],
        );
    }

Domain

Subdomains

Frequently Asked Questions

What does test_class_shorthand_followed_by_parens() do?
test_class_shorthand_followed_by_parens() is a function in the tailwindcss codebase, defined in crates/oxide/src/extractor/pre_processors/slim.rs.
Where is test_class_shorthand_followed_by_parens() defined?
test_class_shorthand_followed_by_parens() is defined in crates/oxide/src/extractor/pre_processors/slim.rs at line 238.

Analyze Your Own Codebase

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

Try Supermodel Free