Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

hyva-tailwind-integration

БесплатноБез исполняемых скриптовНе проверен

Comprehensive guidance on integrating Tailwind CSS and JavaScript in Hyvä Themes, including configuration merging, module registration, and build processes…

ProxiBlueот ProxiBlue★ 17 звёзд на GitHub17 установок в других каталогах

Об этом скилле

Hyvä Theme Tailwind CSS & JS Integration Skill

Purpose

This skill provides comprehensive guidance on integrating Tailwind CSS and JavaScript in Hyvä Themes, including configuration merging, module registration, and build processes for Magento 2.

When to Use This Skill

  • Setting up a new Hyvä theme with Tailwind CSS
  • Creating Hyvä compatibility modules with custom styles
  • Configuring Tailwind config merging across modules
  • Understanding the Hyvä Tailwind build system
  • Troubleshooting CSS compilation issues
  • Implementing theme inheritance with proper Tailwind configuration

Overview of Hyvä Tailwind Architecture

Hyvä Themes uses a sophisticated Tailwind CSS build system that:

  • Automatically merges Tailwind configurations from multiple modules
  • Scans templates across theme, parent themes, and modules for CSS classes
  • Supports CSS variables via the twProps utility for dynamic theming
  • Enables module-specific styling without theme modifications

Key Components

  1. @hyva-themes/hyva-modules - NPM package for config/CSS merging
  2. hyva-themes.json - Registry of modules with Tailwind configs
  3. tailwind.config.js - Theme-level Tailwind configuration
  4. tailwind-source.css - Source CSS with @tailwind directives

Directory Structure

app/design/frontend/Vendor/ThemeName/
├── web/
│   ├── css/
│   │   └── styles.css                    # Compiled output (git-ignored)
│   ├── js/
│   │   └── custom.js                     # Custom JavaScript
│   └── tailwind/
│       ├── package.json                  # NPM dependencies
│       ├── postcss.config.js             # PostCSS configuration
│       ├── tailwind.config.js            # Main Tailwind config
│       ├── tailwind-source.css           # Source CSS
│       ├── tailwind.browser-jit.css      # Browser JIT styles (optional)
│       ├── tailwind.browser-jit-config.js # Browser JIT config (optional)
│       └── components/                   # Component-specific CSS
│           ├── typography.css
│           ├── button.css
│           ├── forms.css
│           └── ...

Setup Process

1. Install Hyvä Modules Package (Themes < 1.1.14)

Navigate to your theme's web/tailwind directory:

cd app/design/frontend/Vendor/ThemeName/web/tailwind
npm install @hyva-themes/hyva-modules

For Hyvä 1.1.14+: This package is included by default.

2. Configure tailwind.config.js

Update your theme's tailwind.config.js to use mergeTailwindConfig:

const { twProps, mergeTailwindConfig } = require('@hyva-themes/hyva-modules');
const colors = require('tailwindcss/colors');

/** @type {import('tailwindcss').Config} */
module.exports = mergeTailwindConfig({
    content: [
        // Current theme's phtml and layout XML files
        '../../**/*.phtml',
        '../../*/layout/*.xml',
        '../../*/page_layout/override/base/*.xml',

        // Parent theme (for child themes)
        // '../../../../../../../vendor/hyva-themes/magento2-default-theme/**/*.phtml',
        // '../../../../../../../vendor/hyva-themes/magento2-default-theme/*/layout/*.xml',

        // app/code modules (if using custom modules)
        // '../../../../../../../app/code/**/*.phtml',
    ],
    theme: {
        extend: {
            fontFamily: {
                sans: ['Segoe UI', 'Helvetica Neue', 'Arial', 'sans-serif']
            },
            colors: twProps({
                primary: {
                    lighter: colors.blue['600'],
                    DEFAULT: colors.blue['700'],
                    darker: colors.blue['800']
                },
                secondary: {
                    lighter: colors.gray['100'],
                    DEFAULT: colors.gray['200'],
                    darker: colors.gray['300']
                }
            }),
            backgroundColor: twProps({
                container: {
                    lighter: '#ffffff',
                    DEFAULT: '#fafafa',
                    darker: '#f5f5f5'
                }
            }),
            textColor: ({ theme }) => ({
                ...twProps({
                    primary: {
                        lighter: colors.gray['700'],
                        DEFAULT: colors.gray['800'],
                        darker: colors.gray['900']
                    }
                }, 'text')
            }),
            minHeight: {
                'a11y': '44px',
                'screen-25': '25vh',
                'screen-50': '50vh',
                'screen-75': '75vh'
            },
            container: {
                center: true,
                padding: '1.5rem'
            }
        }
    },
    plugins: [
        require('@tailwindcss/forms'),
        require('@tailwindcss/typography')
    ]
});

Key Features:

  • mergeTailwindConfig() - Wraps config to enable automatic module merging
  • twProps() - Generates CSS variables for dynamic theming
  • content array - Specifies files to scan for Tailwind clas
Полный SKILL.md на GitHub

Установить hyva-tailwind-integration в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл hyva-tailwind-integration?

Comprehensive guidance on integrating Tailwind CSS and JavaScript in Hyvä Themes, including configuration merging, module registration, and build processes for Magento 2.

Как установить скилл hyva-tailwind-integration?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hyva-tailwind-integration запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить hyva-tailwind-integration с