Loading...
Loading...
Create a Hyvä child theme in a Magento 2 project. This skill should be used when the user wants to create a new Hyvä child theme, set up a custom theme based on Hyvä, or initialize a new frontend theme directory structure. Trigger phrases include "create hyva child theme", "new hyva theme", "setup child theme", "create custom theme", "initialize theme".
npx skill4agent add hyva-themes/hyva-ai-tools hyva-child-themebin/magentohyva-exec-shell-cmdHyva/default-cspHyva/default{Vendor}/{ThemeName}app/design/frontend/hyva-theme-listHyva/default-cspHyva/default{Vendor}/{ThemeName}vendor/hyva-themes/magento2-default-theme-cspvendor/hyva-themes/magento2-default-themeapp/design/frontend/{Vendor}/{ThemeName}app/design/frontend/<Vendor>/<themeName>/app/design/frontend/<Vendor>/<themeName>/
├── registration.php
├── theme.xml
├── composer.json
└── web/
└── tailwind/
└── (copied from parent theme)<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register( ComponentRegistrar::THEME, 'frontend/<Vendor>/<themeName>', __DIR__);<?xml version="1.0"?>
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Example Store Theme</title>
<parent>Hyva/default-csp</parent>
</theme>StoreThemeStore Theme<Vendor> <Theme Name Words>Example/StoreThemeExample Store Theme<parent>Hyva/default-cspHyva/default{ParentVendor}/{ParentThemeName}Example/baseTheme{
"name": "<vendor-lowercase>/<package-name>",
"description": "Example Store Theme based on Hyvä",
"type": "magento2-theme",
"license": "proprietary",
"require": {
"hyva-themes/magento2-default-theme-csp": "*"
},
"autoload": {
"files": [
"registration.php"
]
}
}<ThemeName>StoreThemestore-theme-themeStoreThemestore-themeCustomStorecustom-store-thememyThememy-themerequirehyva-themes/magento2-default-theme-csphyva-themes/magento2-default-themecomposer.jsonnode_modulesmkdir -p app/design/frontend/<Vendor>/<ThemeName>/web
rsync -a --exclude='node_modules' <parent_theme_path>/web/tailwind app/design/frontend/<Vendor>/<ThemeName>/web/<parent_theme_path>vendor/hyva-themes/magento2-default-theme-cspvendor/hyva-themes/magento2-default-themeapp/design/frontend/{ParentVendor}/{ParentTheme}web/tailwind/hyva.config.json{
"tailwind": {
"include": [
{ "src": "vendor/hyva-themes/magento2-default-theme-csp" }
]
}
}{
"tailwind": {
"include": [
{ "src": "app/design/frontend/{ParentVendor}/{ParentTheme}" },
{ "src": "vendor/hyva-themes/magento2-default-theme-csp" }
]
}
}hyva.config.jsonhyva-compile-tailwind-cssapp/design/frontend/<Vendor>/<ThemeName>/bin/magento config:set design/theme/theme_id <theme_id>bin/magento setup:upgrade
bin/magento cache:flushcomposer require hyva-themes/magento2-default-themehyva-themes/magento2-default-theme-cspcomposer installweb/tailwindvendor/hyva-themes/magento2-default-theme-csp/web/tailwindnode --versionnode_modulespackage-lock.jsonnpm installhyva.config.jsonhyva.config.jsonapp/design/frontend/<Vendor>/<ThemeName>/Hyva/default-cspHyva/default{Vendor}/{ThemeName}web/tailwind/tailwind-source.cssnpm run watchnpm run build