diff --git a/examples/demo-app/README.md b/examples/demo-app/README.md new file mode 100644 index 0000000..114c3a0 --- /dev/null +++ b/examples/demo-app/README.md @@ -0,0 +1,114 @@ +# TailwindFX Example Project + +This is an example project demonstrating how to use TailwindFX with the Maven plugin for build-time CSS generation. + +## Prerequisites + +- Java 17 or higher +- Maven 3.6+ +- TailwindFX installed locally (`mvn install` in the main project) + +## Building the Example + +```bash +cd tailwindfx-example +mvn clean compile +``` + +This will: +1. Scan your Java and FXML files for Tailwind classes +2. Generate an optimized CSS file at `target/classes/css/tailwindfx-generated.css` +3. Compile your application + +## Running the Example + +```bash +mvn javafx:run +``` + +## Project Structure + +``` +tailwindfx-example/ +├── pom.xml # Maven configuration with TailwindFX plugin +├── src/main/java/com/example/ +│ ├── HelloApplication.java # Main application class +│ └── HelloController.java # FXML controller +└── src/main/resources/com/example/ + └── hello-view.fxml # FXML view with Tailwind classes +``` + +## Using Tailwind Classes + +In Java code: +```java +button.getStyleClass().addAll("bg-blue-500", "text-white", "p-4"); +``` + +In FXML: +```xml +