Files
rc-compat/bash-setup-scripts/patch-tailwind-reference.sh
T

23 lines
573 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/zsh
echo "🩹 Auto-patching SCSS files with @reference \"tailwindcss\"..."
SCSS_FILES=$(find src -type f -name "*.scss")
for FILE in $SCSS_FILES; do
echo "Checking: $FILE"
# Skip if already has @reference
if grep -q '@reference "tailwindcss"' "$FILE"; then
echo " ✔ Already patched"
continue
fi
echo " Adding @reference to $FILE"
# Prepend @reference at top of file
echo '@reference "tailwindcss";' | cat - "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE"
done
echo "🎉 All SCSS files have been patched for Tailwind v4!"