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
setupTailwindProject()
In your kotlin
block use setupTailwindProject()
function.
The setupTailwindProject()
function performs the following:
Sets up the Js(IR) target with webpack settings to enable CSS support.
Installs necessary npm dependencies:
tailwindcss: 3.3.2
postcss: 8.4.8
autoprefixer: 10.4.2
postcss-loader: 4.3.0
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.