Giter Site home page Giter Site logo

hyva-modules-tailwind-js's People

Contributors

grimlink avatar thijsdewitt avatar vinai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hyva-modules-tailwind-js's Issues

Add export function to include parent theme templates into the purge content

It would be useful to add a function to the library that adds templates from parent themes to the purge content fallback, if they are not overridden.

There is a non-generic example for this in the Advanced Purge Config docs.

The function for this library should determine the theme parent hierarchy up until hyva-themes/magento2-reset-theme.

Here is a draft for the algorithm:

Assuming the theme hierarchy
themeA => themeB => magento2-default-theme => magento2-reset-theme

The desired output is an array of template files to use as the (purge) content configuration.

Initially the list of files is empty [].

It should first build a list of all template files in the reset-theme child magento2-default-theme.

Then, it checks the next theme in the hierarchy, which is themeB.
For any file in themeB that is also present in the magento2-default-theme, the file in themeB should replace the file from magento2-default-theme in the result list.
Any new file in themeB that is not also in magento-default-theme should be added to the list.

The result at this time is a list of all template files in themeB and magento2-default-theme following the Magento theme fallback.

Then, it checks the next theme in the hierarchy, which is themeA.
The same process that already was done for themeB now is done for themeA.
For any file in themeA that is also present in themeB or magento2-default-theme, the file in themeA should replace the file from the parent themes in the result list.
Any new file in themeA that is not present in one of the parent themes should be added to the list.

The final result is an array of all template files in the theme hierarchy according to the Magento theme fallback.

Ideally, the file types to check should be configurable, e.g.
/*/templates/**/*.phtml would check for any templates in parent themes, /*/layout/**/*.xml would check for layouts etc - you get the idea.

Allow excluding or overriding css files from modules

For example, a standard way the prevent vendor/hyva-themes/checkout-default/src/view/frontend/tailwind/tailwind-source.css from being loaded? It contains some very specific rules which break my layout (e.g. buttons), I would prefer to use utility classes in the template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.