html - Timber Shopify Theme Push/Pull columns based on screen size
Been stuck on this shopify html template that's using the Timber CSS framework. https://github.com/Shopify/Timber/blob/master/assets/timber.scss.liquid (https://github.com/Shopify/Timber/blob/master/assets/timber.scss.liquid)
I need to swap two divs with the class
grid__item
if the user is on a mobile device.
Below is the code that I have. I have no idea on how to make the swap. I believe bootstrap refers to this as push/pull?
<div class="grid">
<div class="grid__item one-half medium-down--one-whole">1</div>
<div class="grid__item one-half medium-down--one-whole">2</div>
</div>
Answer
Solution:
Timber has options for push and pull
https://github.com/Shopify/Timber/blob/master/assets/timber.scss.liquid#L38 (https://github.com/Shopify/Timber/blob/master/assets/timber.scss.liquid#L38)
So, to achieve the order change on mobile you should or put the items reversed in markup for desktop dopush and pull
, or useflexbox
adding custom styles in .scss files of your theme
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.