Skip to content

TailwindCssOptions

[<Struct>]
type TailwindCssOptions =
    {
        Binary: Strategy
        TargetExtensions: string list
        TailwindEntryHeader: string list
        TailwindEntryFooter: string list
        ReferenceHandler: TailwindCssImportStatement -> Result<string,string>
    }
AssemblyPartas.Nacara.Plugins.Tailwind
Attributes[<Struct>]

Fields

Binary: Strategy

The strategy to use to find the tailwindcss binary. Implicit strategies will download the binary to a cache using the provided version and platform parameters.

Defaults to TailwindCssBinary.Implicit(TailwindCssBinary.Version(4,3,3), TailwindCssBinary.Platform.Auto).

TargetExtensions: string list

The extensions that will be processed by the tailwindcss plugin. This intended to be used to filter tailwindcss processing for specific files using a composite extension pattern: <FileName>.*.css

Defaults to [".css"].

TailwindEntryHeader: string list

The header that is injected into the target entry style sheet to import the tailwindcss library if it is not already imported.

If the header is empty, it will automatically inject @import "tailwindcss";

Defaults to:

[
"@layer theme, base, components, utilities;"
"@import \"tailwindcss/theme.css\" layer(theme);"
"@import \"tailwindcss/utilities.css\" layer(utilities);"
]
TailwindEntryFooter: string list

The footer is injected at the end of the entry file.

Defaults to [].

ReferenceHandler: TailwindCssImportStatement -> Result<string,string>

A delegate that is used to modify the import statements in the entry style sheet when bundling.

The delegate is called for each import statement found in the entry style sheet, and receives the absolute path to the entry style sheet directory and the import string to modify without quotations.

Return the final path, without quotations.

If the returned string ends with ;, then the string is injected verbatim after the @import <returnValue> statement.

Defaults to fun { AbsoluteDirPath = d; Import = i } -> System.IO.Path.Combine(d, i) |> Ok.