hyva-themes / hyva-modules-tailwind-js Goto Github PK
View Code? Open in Web Editor NEWHyvä-themes TailwindCSS utility functions
License: BSD 3-Clause "New" or "Revised" License
Hyvä-themes TailwindCSS utility functions
License: BSD 3-Clause "New" or "Revised" License
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.
a single npm installation in app/design/frontend
or app/design/frontend/[vendor]
for shops with multiple Hyvä based themes.
Relative path to app/etc/hyva-themes.json
is hard coded, so it is not taken into account (everything else works fine)
https://github.com/hyva-themes/hyva-modules-tailwind-js/blob/main/src/index.js#L12-L17
Dynamically determine path by going up in the file system until app/etc
is found.
When the tailwind.config.js
is in the project root. It can't properly determine the basePath, since it doesn't scan the current directory for /app
and /vendor
, but rather goes straight to scanning it's parent folder.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.