Skip to content

Instantly share code, notes, and snippets.

@abimaelmartell
Created May 14, 2025 01:03
Show Gist options
  • Save abimaelmartell/42bd1cf3b1d073e90c4ee0a1a3f1a97f to your computer and use it in GitHub Desktop.
Save abimaelmartell/42bd1cf3b1d073e90c4ee0a1a3f1a97f to your computer and use it in GitHub Desktop.
# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment