Image for post
Image for post
Photo by Soragrit Wongsa

Images are some of the most common types of content used on the web, they’re often used to attract user’s attention and they are usually the biggest element on-screen above the fold (think of banners, hero images, product images, etc) so it’s very important we do the best we can to make them display as fast as possible to maintain a good user experience.

Taking a look at there’s an important metric that images can affect and that is “Largest Contentful Paint” (LCP), considering this alone makes up to 25% of the total Lighthouse score it is…


Image for post
Image for post
Photo by Vincentas Liskauskas

Sliders (or carousels) are some of the most common elements in almost any website these days, regardless of how you feel about them they can offer a convenient way of displaying information specially when screen size is limited.

In e-commerce websites use cases range from displaying featured products, banners, promotions, product galleries, you name it! There’s no shortage of these bad boys in the wild even though their effectiveness is it’s one of those things users are used to seeing so it provides a low-friction experience for most people.


Image for post
Image for post
Photo by Marc-Olivier Jodoin

As much as I like working with Magento 2 I have to admit it’s never been known for its blazing performance, page loading speeds in both frontend and backend have been consistently slower than its own 1.9 version and that’s been a problem most Magento developers have had to deal with in some way or another.

Don’t get me wrong, there are a lot of changes Magento’s done to improve development experience: using composer, the plugin system, dependency injection, just to name a few, but page loading speeds (specially on the frontend) have suffered because the frontend stack that Magento…


Image for post
Image for post
Photo by on

CMS blocks are a popular way to enable users to edit elements in their Magento 2 websites from the backend, it requires (almost) no coding skills and provide a relatively safe way of updating content without risking breaking your e-commerce site.

Out of the box Vue Storefront provides support for CMS blocks, if you’re using the official or data pump (v1.6+) CMS blocks and pages are synced to the Elastic Search database so we can query this data very efficiently.

Vue Storefront also includes a component to help us render this content anywhere in our…


Image for post
Image for post
Unrelated, please ignore…

For the past few months Magento has been working on which is, in summary, a collection of tools to help build modern Progressive Web Applications on top of Magento 2 stores.

For the most part these tools have been used in production by other projects with great success so it makes sense that PWA Studio is built on top of them, for example:

  • Peregrine: collection of React-based UI components to help reuse common functionality like routing, render pages, products, prices, etc.
  • PWA Buildpack: build and layout optimisation tooling, it expands webpack to help configure PWA Studio components and…


Image for post
Image for post

I was browsing the website the other day and noticed they have a really nice animation when you click the icons to save some items for later:


Image for post
Image for post

Images are widely used in most websites, web apps and PWAs, have a look at any of your recent projects and it’s likely that images are responsible for a good portion of its bundle size.

Because of this you might have run into this scenario: you have a mix of images and text based content in your page but, as images load, the whole layout shifts, jumps and changes providing a very poor user experience.


Image for post
Image for post
Random gallery photo

I’ve been working with for the past few months and it’s been a great experience. It’s one of the few open-source solutions available to implement PWAs using Magento 2 (and many other e-commerce platforms) in the backend so it brings modern solutions out of the box to a lot of common requirements for web based applications (offline support, lazy loading, small bundle size, server side rendering, etc).

To get a basic understanding of how Vue Storefront works I thought it would be a good idea to document how to implement an Instragram feed in your store. …


Image for post
Image for post

Dropdown menus are a very common pattern around the web, their code is pretty straightforward:

  1. Use position: relative on the parent menu item.
  2. Use position: absolute on submenu.
  3. Toggle submenu visibility on parent hover.

However that doesn’t account for the fact that most users don’t move the cursor to the submenu on a straight line, most of the time they will move the cursor diagonally as it’s the shortest path to the content they’re trying to access.

The problem


Recently I had to work on a relatively simple piece of UI that I’ve seen many times around the web. In essence it’s a ‘grid’ of items that can be clicked to expand a full width section beneath them with more content.

I couldn’t find a name for this kind of elements so, for the sake of this post, I’ll name it ‘accordion grid’ but please let me know in the comments if there’s a more widely known way to call it.

Image for post
Image for post
The ’accordion grid’ element

As simple as it looks it ended up being more complicated to implement than I though, specially because…

Javier Villanueva

Lead Developer at Media Lounge · 6x Magento Certified & Full Stack Developer · E-Commerce Specialist · Currently @ Bournemouth, UK

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store