Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

Add option to show preview bar #1068

Open presto2116 opened 4 years ago

presto2116 commented 4 years ago

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.

cgilbe27 commented 4 years ago

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