Skip to content

Tailwind support #12

@struckchure

Description

@struckchure

🧰 Available Options to Integrate TailwindCSS into a Go SDK

1. Wrap Tailwind CLI (Rust Binary) in Go

  • How it works: Use os/exec in Go to run the official tailwindcss binary.
  • Pros:
    • Easiest and quickest to implement.
    • Always in sync with official Tailwind updates.
    • No need to modify Tailwind’s source code.
  • Cons:
    • Requires bundling or downloading the binary.
    • Relies on an external process, not fully embedded.
    • Less portable in sandboxed or restricted environments.

2. FFI (Rust → Go) via cgo

  • How it works: Expose Rust functions using #[no_mangle] extern "C" and call them from Go using cgo.
  • Pros:
    • Runs completely in-process.
    • Native performance.
    • Can tightly couple with Go SDK logic.
  • Cons:
    • Requires extracting or rewriting parts of Tailwind in Rust (as the official implementation is CLI-oriented).
    • More complex to set up and maintain (especially cross-platform builds).
    • Rust <-> Go memory handling and safety can be tricky.

3. Re-implement Tailwind in Pure Go

  • How it works: Fully translate Tailwind’s utility and JIT logic into Go.
  • Pros:
    • 100% native, no external binaries or toolchains.
    • Maximum control and customization.
    • Extremely portable (even in embedded or serverless contexts).
  • Cons:
    • Massive undertaking.
    • Difficult to match full Tailwind feature parity.
    • Easy to get out of sync with upstream Tailwind releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions