Docs 0.0.3 Help

Usage

To use the tailwind-kt plugin follow these steps:

Configure tailwind { } block.

The tailwind-kt plugin offers configuration options that can be customised through the tailwind {} block in your build.gradle. Although it is optional and not necessary in most cases, you can adjust the default settings according to your requirements .Refer to TailwindPluginExtension for more details

tailwind { configDir.set(rootDir.resolve("my_configs_dir")) moduleName.set("my_module_name") }

setupTailwindProject()

In your kotlin block use setupTailwindProject() function.

kotlin { setupTailwindProject() // ... }

The setupTailwindProject() function performs the following:

  1. Sets up the Js(IR) target with webpack settings to enable CSS support.

  2. Installs necessary npm dependencies:

    • tailwindcss: 3.3.2

    • postcss: 8.4.8

    • autoprefixer: 10.4.2

    • postcss-loader: 4.3.0

  3. Adds the following dependency: org.jetbrains.kotlin-wrappers:kotlin-extensions:1.0.1-pre.256-kotlin-1.5.31

Skipping Dependencies

You can skip installing npm dependencies by passing skipDependencies = true when calling setupTailwindProject().

🎉 Now you can start using tailwind classes in your application.

Last modified: 21 October 2023