+```
+
+### Modal/Dialog
+
+```liquid
+
+```
+
+## Подробная документация
+
+- [VITE_SETUP.md](./VITE_SETUP.md) - Полная настройка Vite
+- [README.md](./README.md) - Общая документация темы
+
+Happy coding! 🎉
diff --git a/README.md b/README.md
index eaf59b2c..4a45e829 100644
--- a/README.md
+++ b/README.md
@@ -7,17 +7,22 @@
A minimal, carefully structured Shopify theme designed to help you quickly get started. Designed with modularity, maintainability, and Shopify's best practices in mind.
+**Enhanced with Vite + TailwindCSS v4** for blazing-fast development with Hot Module Replacement (HMR).
+
+
+
## Getting started
### Prerequisites
-Before starting, ensure you have the latest Shopify CLI installed:
+Before starting, ensure you have the following installed:
+- [Node.js](https://nodejs.org/) (v18 or higher) – required for Vite and TailwindCSS
- [Shopify CLI](https://shopify.dev/docs/api/shopify-cli) – helps you download, upload, preview themes, and streamline your workflows
If you use VS Code:
@@ -30,30 +35,58 @@ Clone this repository using Git or Shopify CLI:
```bash
git clone git@github.com:Shopify/skeleton-theme.git
-# or
-shopify theme init
+cd skeleton-theme
+```
+
+### Install Dependencies
+
+Install Node.js dependencies for Vite and TailwindCSS:
+
+```bash
+npm install
```
-### Preview
+### Development
-Preview this theme using Shopify CLI:
+Run both Vite dev server (with HMR) and Shopify CLI preview:
```bash
-shopify theme dev
+npm run dev
+```
+
+This starts:
+- **Vite dev server** on `http://localhost:5173` with Hot Module Replacement
+- **Shopify CLI** theme preview with Liquid hot-reload
+
+For more details, see [VITE_SETUP.md](./VITE_SETUP.md).
+
+### Build for Production
+
+Generate optimized assets:
+
+```bash
+npm run build
```
## Theme architecture
```bash
.
-├── assets # Stores static assets (CSS, JS, images, fonts, etc.)
-├── blocks # Reusable, nestable, customizable UI components
-├── config # Global theme settings and customization options
-├── layout # Top-level wrappers for pages (layout templates)
-├── locales # Translation files for theme internationalization
-├── sections # Modular full-width page components
-├── snippets # Reusable Liquid code or HTML fragments
-└── templates # Templates combining sections to define page structures
+├── src/ # Source files (processed by Vite)
+│ ├── main.css # TailwindCSS entry point
+│ └── main.js # JavaScript entry point
+├── assets/ # Static assets + Vite build output
+│ ├── main.min.css # Generated by Vite (gitignored)
+│ └── main.min.js # Generated by Vite (gitignored)
+├── blocks/ # Reusable, nestable, customizable UI components
+├── config/ # Global theme settings and customization options
+├── layout/ # Top-level wrappers for pages (layout templates)
+├── locales/ # Translation files for theme internationalization
+├── sections/ # Modular full-width page components
+├── snippets/ # Reusable Liquid code or HTML fragments
+├── templates/ # Templates combining sections to define page structures
+├── vite.config.ts # Vite bundler configuration
+└── tailwind.config.ts # TailwindCSS customization
```
To learn more, refer to the [theme architecture documentation](https://shopify.dev/docs/storefronts/themes/architecture).
@@ -143,11 +176,28 @@ When developing components defined by schema settings, we recommend these guidel
## CSS & JavaScript
-For CSS and JavaScript, we recommend using the [`{% stylesheet %}`](https://shopify.dev/docs/api/liquid/tags#stylesheet) and [`{% javascript %}`](https://shopify.dev/docs/api/liquid/tags/javascript) tags. They can be included multiple times, but the code will only appear once.
+### TailwindCSS v4
+
+This theme uses **TailwindCSS v4** for styling. You can use utility classes directly in your Liquid templates:
+
+```liquid
+
+
{{ product.title }}
+
+```
+
+Customize design tokens in `tailwind.config.ts`.
+
+### Component Styles
+
+For component-specific styles, you can still use the [`{% stylesheet %}`](https://shopify.dev/docs/api/liquid/tags#stylesheet) and [`{% javascript %}`](https://shopify.dev/docs/api/liquid/tags/javascript) tags within sections. They can be included multiple times, but the code will only appear once.
-### `critical.css`
+### Global Styles
-The Skeleton Theme explicitly separates essential CSS necessary for every page into a dedicated `critical.css` file.
+Global styles are defined in `src/main.css`, which includes:
+- TailwindCSS base, components, and utilities
+- Custom base styles (similar to the previous `critical.css`)
+- Component-level styles using `@layer`
## Contributing
diff --git a/VITE_SETUP.md b/VITE_SETUP.md
new file mode 100644
index 00000000..e6814ccc
--- /dev/null
+++ b/VITE_SETUP.md
@@ -0,0 +1,303 @@
+# Vite + TailwindCSS v4 Setup Guide
+
+This Skeleton Theme is now enhanced with **Vite** and **TailwindCSS v4** for modern, fast development with Hot Module Replacement (HMR).
+
+## 🚀 Quick Start
+
+### 1. Install Dependencies
+
+```bash
+npm install
+```
+
+### 2. Development Mode
+
+Run both Vite dev server and Shopify CLI simultaneously:
+
+```bash
+npm run dev
+```
+
+This will start:
+- **Vite dev server** on `http://localhost:5173` (with HMR for CSS/JS)
+- **Shopify CLI** theme preview (with hot-reload for Liquid)
+
+### Alternative: Run Separately
+
+If you prefer to run servers in separate terminals:
+
+```bash
+# Terminal 1 - Vite dev server
+npm run vite:dev
+
+# Terminal 2 - Shopify theme preview
+npm run shopify:dev
+```
+
+### 3. Build for Production
+
+Generate minified assets:
+
+```bash
+npm run build
+```
+
+This creates:
+- `assets/main.min.css` - Compiled TailwindCSS
+- `assets/main.min.js` - Bundled JavaScript
+
+### 4. Push to Shopify
+
+```bash
+npm run shopify:push
+```
+
+---
+
+## 📁 Project Structure
+
+```
+skeleton-theme/
+├── src/ # Source files (processed by Vite)
+│ ├── main.css # TailwindCSS entry point
+│ └── main.js # JavaScript entry point
+├── assets/ # Output directory for built assets
+│ ├── main.min.css # Generated by Vite (gitignored)
+│ ├── main.min.js # Generated by Vite (gitignored)
+│ ├── critical.css # Legacy critical CSS (can be removed)
+│ └── *.svg # Static assets
+├── sections/ # Shopify sections (Liquid)
+├── snippets/ # Shopify snippets (Liquid)
+│ └── vite.liquid # Vite asset loader
+├── layout/ # Theme layouts
+│ └── theme.liquid # Updated to include Vite assets
+├── vite.config.ts # Vite configuration
+├── tailwind.config.ts # TailwindCSS v4 configuration
+├── postcss.config.cjs # PostCSS configuration
+└── package.json # Dependencies and scripts
+```
+
+---
+
+## 🎨 Using TailwindCSS
+
+### In Liquid Templates
+
+Use TailwindCSS utility classes directly in your `.liquid` files:
+
+```liquid
+
+
+ {{ product.title }}
+
+
+ {{ product.description }}
+
+
+```
+
+### In src/main.css
+
+Add custom styles using Tailwind's `@layer` directive:
+
+```css
+@layer components {
+ .btn-primary {
+ @apply px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700;
+ }
+}
+```
+
+### Customizing Theme
+
+Edit `tailwind.config.ts` to customize colors, spacing, fonts, etc.:
+
+```ts
+export default {
+ theme: {
+ extend: {
+ colors: {
+ primary: '#1a73e8',
+ },
+ },
+ },
+} satisfies Config;
+```
+
+---
+
+## ⚡ Hot Module Replacement (HMR)
+
+### What Gets HMR?
+
+- ✅ **CSS changes** (`src/main.css`) - Instant updates without page reload
+- ✅ **JavaScript changes** (`src/main.js`) - Fast updates with state preservation
+- ✅ **TailwindCSS classes** in Liquid - Instant CSS updates
+
+### What Requires Page Reload?
+
+- ⚠️ **Liquid template changes** (`.liquid` files) - Uses Shopify CLI hot-reload (~2-4s)
+- ⚠️ **Schema changes** in sections/blocks
+- ⚠️ **Config changes** (`settings_schema.json`)
+
+### Development Workflow
+
+```
+Edit CSS/JS in src/ → Vite HMR (~200-500ms) → Browser updates instantly
+Edit Liquid templates → Shopify CLI (~2-4s) → Page reloads
+```
+
+---
+
+## 🔧 Configuration
+
+### Vite Configuration
+
+`vite.config.ts` - Controls bundling, output, and dev server:
+
+```ts
+export default defineConfig({
+ plugins: [shopify(), tailwindcss()],
+ build: {
+ outDir: 'assets',
+ manifest: true,
+ },
+});
+```
+
+### TailwindCSS Configuration
+
+`tailwind.config.ts` - Customize design tokens:
+
+```ts
+export default {
+ content: [
+ './layout/**/*.liquid',
+ './sections/**/*.liquid',
+ './snippets/**/*.liquid',
+ './templates/**/*.liquid',
+ './blocks/**/*.liquid',
+ './src/**/*.{js,ts}',
+ ],
+ // ... your customizations
+} satisfies Config;
+```
+
+### Avoiding Class Name Conflicts
+
+If you want to keep existing CSS and avoid conflicts, add a prefix:
+
+```ts
+// tailwind.config.ts
+export default {
+ prefix: 'tw-',
+ // ...
+} satisfies Config;
+```
+
+Then use classes like `tw-flex`, `tw-bg-blue-500`, etc.
+
+---
+
+## 📦 Available Scripts
+
+| Command | Description |
+|---------|-------------|
+| `npm run dev` | Run both Vite and Shopify CLI simultaneously |
+| `npm run vite:dev` | Run only Vite dev server |
+| `npm run shopify:dev` | Run only Shopify theme preview |
+| `npm run build` | Build production assets |
+| `npm run preview` | Preview production build locally |
+| `npm run shopify:push` | Push theme to Shopify |
+| `npm run shopify:pull` | Pull theme from Shopify |
+
+---
+
+## 🚨 Important Notes
+
+### Before Pushing to Shopify
+
+Always build assets before pushing:
+
+```bash
+npm run build
+npm run shopify:push
+```
+
+### Git Workflow
+
+Generated files are gitignored:
+- `assets/main.min.css`
+- `assets/main.min.js`
+
+**For CI/CD**, add a build step:
+
+```yaml
+# .github/workflows/deploy.yml
+- name: Install dependencies
+ run: npm install
+
+- name: Build assets
+ run: npm run build
+
+- name: Push to Shopify
+ run: shopify theme push
+```
+
+### Removing Critical.css
+
+Since `src/main.css` includes all base styles from `critical.css`, you can:
+
+1. Delete `assets/critical.css`
+2. Remove inline styles from sections if using Tailwind
+3. Simplify your theme
+
+---
+
+## 🐛 Troubleshooting
+
+### Vite dev server not connecting
+
+1. Ensure port 5173 is not in use
+2. Check firewall settings
+3. Restart dev servers
+
+### CSS not updating
+
+1. Make sure `npm run build` was run
+2. Clear browser cache
+3. Check that `vite.liquid` snippet is included in `theme.liquid`
+
+### TailwindCSS classes not working
+
+1. Verify file paths in `tailwind.config.ts` `content` array
+2. Run `npm run build` to regenerate CSS
+3. Check for typos in class names
+
+### "Module not found" errors
+
+```bash
+rm -rf node_modules package-lock.json
+npm install
+```
+
+---
+
+## 📚 Resources
+
+- [Vite Documentation](https://vitejs.dev/)
+- [TailwindCSS v4 Documentation](https://tailwindcss.com/)
+- [Shopify Vite Plugin](https://github.com/Shopify/vite-plugin-shopify)
+- [Shopify Theme Development](https://shopify.dev/docs/themes)
+
+---
+
+## 🎯 Next Steps
+
+1. **Start developing**: Use TailwindCSS classes in your Liquid templates
+2. **Customize theme**: Edit `tailwind.config.ts` to match your brand
+3. **Add components**: Create reusable components in `src/`
+4. **TypeScript support**: Rename `.js` files to `.ts` for type safety
+5. **Optimize performance**: Use Vite's code splitting and lazy loading
+
+Happy coding! 🚀
diff --git a/layout/theme.liquid b/layout/theme.liquid
index 8123ab78..61389789 100644
--- a/layout/theme.liquid
+++ b/layout/theme.liquid
@@ -4,8 +4,8 @@
{% # Inlined CSS Variables %}
{% render 'css-variables' %}
- {% # Load and preload the critical CSS %}
- {{ 'critical.css' | asset_url | stylesheet_tag: preload: true }}
+ {% # Load Vite assets (includes TailwindCSS) %}
+ {% render 'vite' %}
{% # Social, title, etc. %}
{% render 'meta-tags' %}
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..6da56435
--- /dev/null
+++ b/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "skeleton-theme",
+ "version": "0.1.0",
+ "description": "A minimal, carefully structured Shopify theme with Vite and TailwindCSS v4",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "dev": "concurrently \"npm run vite:dev\" \"npm run shopify:dev\" --names \"VITE,SHOPIFY\" --prefix-colors \"blue,magenta\"",
+ "vite:dev": "vite",
+ "shopify:dev": "shopify theme dev",
+ "build": "vite build",
+ "preview": "vite preview",
+ "shopify:push": "shopify theme push",
+ "shopify:pull": "shopify theme pull"
+ },
+ "devDependencies": {
+ "@shopify/vite-plugin-shopify": "^1.0.2",
+ "@tailwindcss/vite": "^4.0.0",
+ "@types/node": "^22.10.2",
+ "autoprefixer": "^10.4.20",
+ "concurrently": "^9.1.2",
+ "postcss": "^8.4.49",
+ "tailwindcss": "^4.0.0",
+ "typescript": "^5.7.2",
+ "vite": "^6.0.5"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+}
diff --git a/postcss.config.cjs b/postcss.config.cjs
new file mode 100644
index 00000000..a47ef4f9
--- /dev/null
+++ b/postcss.config.cjs
@@ -0,0 +1,5 @@
+module.exports = {
+ plugins: {
+ autoprefixer: {},
+ },
+};
diff --git a/sections/hero.liquid b/sections/hero.liquid
new file mode 100644
index 00000000..16d53601
--- /dev/null
+++ b/sections/hero.liquid
@@ -0,0 +1,134 @@
+{% comment %}
+ Hero Section - Example with TailwindCSS v4
+
+ This section demonstrates how to use TailwindCSS utility classes
+ combined with Shopify theme settings for customizable components.
+{% endcomment %}
+
+
+