Skip to content

stacknyu/denim-republic-shopify

 
 

Repository files navigation

Brought to you and maintained by Trellis Commerce - A full-service eCommerce agency based in Boston, MA

Latest merged code from Dawn v15.0.1

Dawn + Tailwind CSS + Prettier Shopify Starter Theme

Shopify Dawn theme with Tailwind CSS & Prettier integrations

The starter theme includes an integration of:

  • Configured to use prefix: twcss- in order to not clash with Dawn’s existing styles

Trellis' Prettier config with Husky pre-commit hooks

  • Formats JS & CSS whenever a git commit is made
  • Set up your own VSCode to apply Prettier formatting when a file is saved (optional)

Other Noted Modifications

  • Set the default page width to 1440px and tweaked the desktop page width range to be 1200px to 1600px with a step adjustment of 10px (standard desktop width used at Trellis and allows for more fine tuning)
  • There is a page template called noindexnofollow with the meta tag noindex, nofollow for any pages that need to be hidden from search engine site crawlers

Steps to Start Using this Starter Theme

  1. Fork this repository & enable actions in the repo's Actions tab.
‼️ When forking this repo, make sure to change the settings in the forked repo under Settings > Actions > General > Workflow permissions to be Read and write permissions and check Allow GitHub Actions to create and approve pull requests for the Theme Check & Lighthouse actions to run
  1. Clone the forked repo, navigate to the directory in your terminal, & run npm install.

  2. In the theme section of your Shopify admin you can connect to a GitHub repository via “Add theme” button.

Add a theme and connect it to your github repo

  1. In your terminal, navigate to the cloned repo directory, and use the Shopify CLI to launch the development server to your store with shopify theme dev --store=mystore.myshopify.com and upload the theme with shopify theme share.
‼️ If you are working on a development store and are signed in via your partner dashboard, you must add a separate user in that Shopify store with admin rights and sign in with this new user when logging in using the Shopify CLI

You can add users in the store Settings:

Where to add users in the store settings

Add GitHub secrets for Lighthouse CI Performance Evaluation Actions

‼️ This repo does not have the following secrets configured, which is why the Lighthouse action is failing.

First, make sure your Workflow permissions are set like below in order for the actions to run:

Workflow permissions settings

In your GitHub repo, navigate to Settings > Secrets > Actions and add the following repository secrets:

SHOP_ACCESS_TOKEN

  • Settings > Apps and sales channels > Develop Apps > Create an app. Name it something like Lighthouse and give the app permissions of read_products,write_themes. Install the app and use the token value that will start with shpat_.

SHOP_STORE

  • mystore.myshopify.com (ex. trellis-sandbox.myshopify.com)

SHOP_PASSWORD

  • Need if Preferences > Password protection is enabled

SHOP_COLLECTION_HANDLE

SHOP_PRODUCT_HANDLE

LHCI_GITHUB_APP_TOKEN

  • To enable GitHub status checks via the official GitHub app, install and authorize the app with the owner of the target repo. If the repo is within an organization, organization approval might be necessary. Copy the app token provided on the authorization confirmation page and add it to your build environment as LHCI_GITHUB_APP_TOKEN

These secret values are used in the ci.yml GitHub workflow:

Screenshot 2024-07-30 at 1 44 13 PM

Common local development commands

  1. Before beginning any work, it is good practice to pull down the latest changes from the Shopify Dawn theme: git fetch upstream git pull upstream main

  2. Add upstream link if you get the error fatal: 'upstream' does not appear to be a git repository run: git remote add upstream https://github.com/Shopify/dawn.git or git remote add upstream https://github.com/TrellisCommerce/shopify-tailwind-starter-base depending on which repository you want to pull updates from

  3. Pull down changes from the theme editor: shopify theme pull -d

  4. Anytime you add a Tailwind CSS class (remember to prefix it with twcss-), run the CLI tool to scan your template files for classes and build your CSS to assets/app.css: npx tailwindcss -i ./assets/app-tailwind.css -o ./assets/app.css --watch

  • Run this command in a separate terminal, so it will continue to run while you are developing.
  • Note that using a Tailwind CSS class without a space afterward when followed by a liquid tag causes compiling issues: lg:!twcss-px-[32px]{% endif %}'> But this does work: lg:!twcss-px-[32px] {% endif %}'>
  1. Launch the local development server: shopify theme dev

About

Stacknyu-demin-republic

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Liquid 68.8%
  • CSS 20.9%
  • JavaScript 10.3%