{{.Name}}
-{{.Name}}
+
- {{template "main" .}} - +
+
diff --git a/lib/stylegen/base.css b/lib/stylegen/base.css index e21092c..da42a5d 100644 --- a/lib/stylegen/base.css +++ b/lib/stylegen/base.css @@ -1,14 +1,29 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; +@import "tailwindcss"; @layer base { html, container, body { - height: 100%; - width: 100%; - overflow-y: auto; - position: fixed; + height: 100% !important; + width: 100% !important; + overflow-y: auto !important; + position: fixed !important; + } + + main { + margin-left: auto !important; + margin-right: auto !important; + width: 100% !important; + max-width: 100% !important; + text-align: center !important; + } + + .container { + margin-left: auto !important; + margin-right: auto !important; + display: flex !important; + flex-direction: column !important; + align-items: center !important; + justify-content: center !important; } } diff --git a/lib/stylegen/gen.sh b/lib/stylegen/gen.sh index a29acad..d632db8 100755 --- a/lib/stylegen/gen.sh +++ b/lib/stylegen/gen.sh @@ -67,7 +67,7 @@ echo "Detected Architecture: $ARCH" # Function to construct the binary download URL based on version, OS, and architecture get_binary_url() { - echo "https://github.com/tailwindlabs/tailwindcss/releases/download/$VERSION/tailwindcss-extra-$OS-$ARCH" + echo "https://github.com/tailwindlabs/tailwindcss/releases/download/$VERSION/tailwindcss-$OS-$ARCH" } # Create the 'tw' directory for storing the downloaded binary @@ -101,37 +101,12 @@ echo "Extensions: $EXTENSIONS" echo "Directory: $DIRECTORY" echo "Output Directory: $OUTPUT_DIR" -# Initialize an array for name conditions -name_conditions=() +# Generate the minified version for production +echo "Generating minified CSS for production..." +"$BINARY" -i "${SCRIPT_DIR}/base.css" -o "${OUTPUT_DIR}/styles.css" --minify -# Assuming $EXTENSIONS is a comma-separated list of extensions -IFS=',' read -ra ADDR <<< "$EXTENSIONS" -for ext in "${ADDR[@]}"; do - name_conditions+=(-name "*.$ext") -done +# Create empty daisyui.css and themes.css files if they don't exist +touch "${OUTPUT_DIR}/daisyui.css" +touch "${OUTPUT_DIR}/themes.css" -# Use find with the array of conditions -INCLUDE_FILES=$(find "$DIRECTORY" -type f \( "${name_conditions[@]}" \)) - -echo "Files found: $INCLUDE_FILES" - -INCLUDE_FILES_ARRAY=$(echo "$INCLUDE_FILES" | awk '{printf "\"%s\",", $0}' | sed 's/,$//') - -# Generate Tailwind config in script directory -CONFIG_FILE="${SCRIPT_DIR}/tailwind.config.js" -echo "module.exports = { - content: [$INCLUDE_FILES_ARRAY], - theme: { - extend: {}, - }, - daisyui: { - themes: [\"night\"], - }, - plugins: [require('daisyui'), require('@tailwindcss/typography')], -}" > "$CONFIG_FILE" - -# Run the binary with the generated config -"$BINARY" build -i "${SCRIPT_DIR}/base.css" -c "$CONFIG_FILE" -o "${OUTPUT_DIR}/styles.css" --minify - -# Wait for all background processes to finish -wait +echo "All CSS files generated" diff --git a/pages/templates/layouts/base.html b/pages/templates/layouts/base.html index 57bb3d9..36d0f32 100644 --- a/pages/templates/layouts/base.html +++ b/pages/templates/layouts/base.html @@ -8,9 +8,9 @@