New modern and lightweight frontend theme experiment #3584
Replies: 5 comments 12 replies
-
Anything tasteful other than Magento flavor is well received. I touched a little on the subject here #1825. Meanwhile, Alpine JS became very popular for different tasks and it has a paid version with a lot of features. I spent a lot of time with both Bootstrap (more than a decade) and Tailwind frameworks. Both have advantages and disadvantages. I am using more Bootstrap 5.3 at this moment and I could migrate pretty fast a lot of website from version 3 & 4. In the case of Tailwind, you have to make your own rules, to use each class in a logical order to be easy to find. When the number of used classes is large, it is increasingly difficult to follow the source code and it becomes tiring, this is in my opinion a disadvantage of Tailwind. The problem gets even more complicated when you want to change the behavior of an element on the size of the screen. |
Beta Was this translation helpful? Give feedback.
-
Interesting approach, I hope to find the time to take a look at it. Personally, I prefer an approach with Gulp and Sass without any framework, but leveraging the power of modern CSS rules. IMHO Tailwind isn't meant to be used through @apply; in this way, it becomes harder to debug. I've tried it myself but found that its use is indeed better when applied directly in HTML using utility classes. For a new modern theme, I was contemplating something completely indipendent that includes all the necessary blocks and css classes but isn't built on top of RWD cause base and rwd theme include smore not necessary html elements or should be restructured |
Beta Was this translation helpful? Give feedback.
-
What is the goal of this project? To be used for new vendors? |
Beta Was this translation helpful? Give feedback.
-
I recommend reading this book https://www.refactoringui.com/. It is written by the one who laid the foundations of Tailwind CSS. |
Beta Was this translation helpful? Give feedback.
-
Just read this discussion this morning so I'll give my insights so far: In the last 4 years I got bored by theme vendors with the classic "include random old/outdated js/css libs in head/body-end" method. At some point I researched webpack and frontend frameworks (react, angular etc). I could not decide which framework to commit so I did not. I created a pure js/css project using webpack:
I used bootstrap@latest, jQuery, swiper at start, importing only required ES6 classes. I was worried about 3rd party OM modules such as an advanced filters navigation modules, infinite scroll, ajax cart etc, but in the end it was easy to just disable these, create my own js libs/corresponding OM controller endpoints. I happened to find arrowjs at some point and liked the idea so I created a js module that handles all OM catalog stuff (both category/search results rendering, incl navigation/filters etc). With the above I still had to create a new theme with bootstrap css classes and handle custom megamenu/mobile menu logic. My latest find:
There is enough custom stuff in-between the above flow like: $controllerAction = $event->getAction();
$module = $controllerAction->getRequest()->getModuleName();
$controller = $controllerAction->getRequest()->getControllerName();
$action = $controllerAction->getRequest()->getActionName();
if($controllerAction->isAjax()) {
$route = implode('_', [$module, $controller, $action]);
// to create <module_dir>/Model/Catalog/Category/View.php for example
if ($model = Mage::getModel('foo/' . $route, ['action' => $action])) {
$model->prepareAjaxView();
}
} and i can expand on it for anyone interested. I'm just saying that a lot is possible here and there could be some features added (like my latest find) to support a 2023-2024 OM theme with nice pagespeeds and easily manageable frontend (npm update, test etc.) |
Beta Was this translation helpful? Give feedback.
-
I've had this idea for more than a year, but I couldn't make it really work. I dedicated a bit more time to it lately and I'd like to share my idea and the results with you now.
What we have now: RWD
I think RWD is still great today, but there could still be areas of improvements to make it more modern, but changing it means breaking all derivatives so... we'll probably never touch it.
My idea
I called this project-experiment "Lanzarote", as the beautiful island I live on.
I wanted to use a 2023 stack, so I chose:
At the moment this new theme inherits
RWD
templates, but my original aim would be inheritbase
instead, which are less opinionated.The idea is to write less phtml possible and less CSS code possible and rely as much as possible on tailwind's
@apply
functionality as shown in Lanzarote's main styles.css file.Screenshot of the first pre-alpha version, category page
Pros
Cons
If you use it "the old way" (adding your custom CSS file inheriting the theme) I'd say there's no con.
But if you want to customize it "the proper way", then:
Project status
mega-pre-alpha-prototype
Feedback
What do you think about this experiment?
Beta Was this translation helpful? Give feedback.
All reactions