Skip to content

Instantly share code, notes, and snippets.

@abimaelmartell
Created May 14, 2025 01:03
Show Gist options
  • Select an option

  • Save abimaelmartell/42bd1cf3b1d073e90c4ee0a1a3f1a97f to your computer and use it in GitHub Desktop.

Select an option

Save abimaelmartell/42bd1cf3b1d073e90c4ee0a1a3f1a97f to your computer and use it in GitHub Desktop.

Revisions

  1. abimaelmartell created this gist May 14, 2025.
    53 changes: 53 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    # Your Tailwind CSS version
    TAILWIND_VERSION := 4.1.6

    # Your output and input CSS files
    OUTPUT_CSS := dist/tailwind.min.css
    INPUT_CSS := src/input.css

    # Platform detection
    UNAME_S := $(shell uname -s)
    UNAME_M := $(shell uname -m)

    ifeq ($(UNAME_S), Linux)
    ifeq ($(UNAME_M), x86_64)
    PLATFORM := linux-x64
    else
    PLATFORM := linux-arm64
    endif
    else ifeq ($(UNAME_S), Darwin)
    ifeq ($(UNAME_M), arm64)
    PLATFORM := macos-arm64
    else
    PLATFORM := macos-x64
    endif
    endif

    # Tailwind CLI binary
    TAILWIND_CLI := bin/tailwindcss
    TAILWIND_URL := https://github.com/tailwindlabs/tailwindcss/releases/download/v$(TAILWIND_VERSION)/tailwindcss-$(PLATFORM)

    .PHONY: all build cli clean

    all: build

    cli: $(TAILWIND_CLI)

    $(TAILWIND_CLI):
    @echo "👉 Downloading Tailwind CLI v$(TAILWIND_VERSION) for $(PLATFORM)"
    @mkdir -p $(dir $@)
    @curl -fsSL $(TAILWIND_URL) -o $@
    @chmod +x $@

    $(OUTPUT_CSS): $(INPUT_CSS) cli
    @echo "👉 Building Tailwind CSS → $@"
    @mkdir -p $(dir $@)
    @$(TAILWIND_CLI) \
    -i $(INPUT_CSS) \
    -o $(OUTPUT_CSS) \
    --minify

    build: $(OUTPUT_CSS)

    clean:
    @rm -rf $(OUTPUT_CSS) $(TAILWIND_CLI)