add: сборка tailwind v3.4.19
This commit is contained in:
+1810
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "hypn0-tailwind",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "tailwindcss -i input.css -o ../../public/static/css/tailwind.min.css --minify"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"tailwindcss": "^3.4.0",
|
||||||
|
"postcss": "^8.4.35",
|
||||||
|
"autoprefixer": "^10.4.17"
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
|
||||||
|
/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.static{position:static}.mx-auto{margin-left:auto;margin-right:auto}.block{display:block}.min-h-screen{min-height:100vh}.max-w-7xl{max-width:80rem}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-4{padding-left:1rem;padding-right:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.font-serif{font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}@media (prefers-color-scheme:dark){.dark\:bg-slate-950{--tw-bg-opacity:1;background-color:rgb(2 6 23/var(--tw-bg-opacity,1))}.dark\:text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity,1))}}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Сборка Tailwind CSS v3 для фронтенда HYPN0
|
||||||
|
# Запуск из корня проекта: bash ./scripts/build-tailwind.sh
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
TAILWIND_DIR="$PROJECT_ROOT/frontend-assembly/tailwind"
|
||||||
|
OUTPUT_DIR="$PROJECT_ROOT/public/static/css"
|
||||||
|
|
||||||
|
log() {
|
||||||
|
printf '[tailwind] %s\n' "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
printf '[tailwind] %s\n' "$*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# cleanup() — удаляет временные файлы при любом завершении скрипта.
|
||||||
|
# Все рабочие файлы (postcss.config.js, tailwind.config.js, input.css)
|
||||||
|
# создаются здесь и удаляются в EXIT/INT/TERM.
|
||||||
|
cleanup() {
|
||||||
|
rm -rf "$TAILWIND_DIR/node_modules" \
|
||||||
|
"$TAILWIND_DIR/postcss.config.js" \
|
||||||
|
"$TAILWIND_DIR/tailwind.config.js" \
|
||||||
|
"$TAILWIND_DIR/input.css"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
|
if ! command -v npm >/dev/null 2>&1; then
|
||||||
|
fail 'Не найден `npm`. Установи Node.js и повтори сборку.'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$TAILWIND_DIR/package.json" ]]; then
|
||||||
|
fail "Не найден package.json: $TAILWIND_DIR/package.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$TAILWIND_DIR/package-lock.json" ]]; then
|
||||||
|
fail "Не найден package-lock.json: $TAILWIND_DIR/package-lock.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$OUTPUT_DIR"
|
||||||
|
|
||||||
|
# --- tailwind.config.js ---
|
||||||
|
log "Создаю tailwind.config.js"
|
||||||
|
cat > "$TAILWIND_DIR/tailwind.config.js" <<'TWEOF'
|
||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
module.exports = {
|
||||||
|
content: [
|
||||||
|
'../../hypn0/templates/**/*.html',
|
||||||
|
'../../hypn0/hypn0_site/**/*.py',
|
||||||
|
],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
||||||
|
TWEOF
|
||||||
|
|
||||||
|
# --- postcss.config.js ---
|
||||||
|
log "Создаю postcss.config.js"
|
||||||
|
cat > "$TAILWIND_DIR/postcss.config.js" <<'PCEOF'
|
||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
PCEOF
|
||||||
|
|
||||||
|
# --- input.css ---
|
||||||
|
log "Создаю input.css"
|
||||||
|
cat > "$TAILWIND_DIR/input.css" <<'EOF'
|
||||||
|
/*
|
||||||
|
input.css — точка входа для сборки prod-версии Tailwind CSS v3.
|
||||||
|
|
||||||
|
Собирается через `npm run build` (PostCSS) в
|
||||||
|
файл public/static/css/tailwind.min.css, который подключается в _base.html
|
||||||
|
для production (когда settings.DEBUG == False).
|
||||||
|
|
||||||
|
Здесь же подключаются кастомные стили из hypn0/templates/css/tailwind-custom.css —
|
||||||
|
того же самого файла, который в dev-режиме подключается через {% include %} внутрь
|
||||||
|
инлайнового <style type="text/tailwindcss"> в _base.html.
|
||||||
|
|
||||||
|
Это обеспечивает единый источник кастомных стилей для dev и prod.
|
||||||
|
*/
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@import "../../hypn0/templates/css/tailwind-custom.css";
|
||||||
|
EOF
|
||||||
|
|
||||||
|
log "СОБИРАЮ Tailwind CSS v3"
|
||||||
|
cd "$TAILWIND_DIR"
|
||||||
|
|
||||||
|
log 'Устанавливаю зависимости через npm ci'
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
log 'Собираю CSS'
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
log 'ГОТОВО! Результат: '"$OUTPUT_DIR/tailwind.min.css"
|
||||||
Reference in New Issue
Block a user