Shopify/slate

Add option to show preview bar

presto2116 opened this issue · 1 comments

This repo is currently on low maintenance. See README for details

Problem

With beta 16 the preview bar was completely removed when on localhost. This seems like a bandaid fix and poor dev experience. I work locally on multiple themes and need to know which theme I am currently in. Also with Shopify's theme caching, you can get kicked out of theme without even knowing.
As a workaround for the broken preview bar, I created a component with a close button that was placed above the preview bar and it added the #preview-bar-iframe { height: 60px !important; }` when on localhost.
Just outrightly removing the preview bar seems like a cop-out instead of fixing the actual problem in shopify core or coming up with a better solution in slate.
I would revert to beta 15, but since boomerang script gets loaded randomly as html that is also not going to work.

Replication steps

Use beta 16 or above and type yarn start

Possible Solution

Add a flag to show or hide preview bar. you can default it to hide or show, but at least have the option to add the &pb=0 to const queryStringComponents = ['_fd=0&pb=0'];
either --show-preview-bar or --hide-preview-bar depending on which you would want the default to be.

You can always do Shopify.theme to see the current theme details