The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Stable v1.0.7

Yireo Hyva Theme Auto Registration

yireo/magento2-hyva-theme-auto-registration

Simplifies registering a module's own tailwind.config.js in the global Hyvä Themes Tailwind configuration, providing an observer that auto-registers modules by name or prefix without per-module boilerplate.

13,719
Downloads
Below average
0
GitHub Stars
8mo ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
19 warnings
L1 PHPStan

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.0.7 on Magento 2.4.9
Jun 3, 2026

Share This Module's Status

Yireo Hyva Theme Auto Registration Magento compatibility status badge

README

Loaded from GitHub

Yireo HyvaThemeAutoRegistration

Magento 2 module to make it easier to register a custom tailwind.config.js file of your own module in the global Hyvä Themes Tailwind configuration

Background

Hyvä Themes offers a Magento 2 CLI command hyva:config:generate to allow building a file app/etc/hyva-themes.json that again is used in modern-day Tailwind configuration of Hyvä-based themes. However, to extend this, one must add a custom observer to the module, which leads to a lot of code duplication across your modules. This module aims to simplify this. It offers an observer following the official Hyvä documentation.

However, this observer automatically registers any module that has a prefix Yireo_ or YireoTraining_ (it works for me). And it allows for extending things with a DI plugin.

Usage

Add this module as a dependency to your composer.json file and etc/module.xml file.

Next, add the following DI configuration to your module its etc/di.xml file (assuming here that Foo_Bar is the name of your own module):

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Yireo\HyvaThemeAutoRegistration\Observer\RegisterModuleForHyvaConfig">
        <arguments>
            <argument name="moduleNames" xsi:type="array">
                <item name="Foo_Bar" xsi:type="string">Foo_Bar</item>
            </argument>
        </arguments>
    </type>
</config>

Alternatively, you can include all your modules by configuring a module prefix:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Yireo\HyvaThemeAutoRegistration\Observer\RegisterModuleForHyvaConfig">
        <arguments>
            <argument name="modulePrefixes" xsi:type="array">
                <item name="Foo_" xsi:type="string">Foo_</item>
            </argument>
        </arguments>
    </type>
</config>

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.