Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
302 changes: 302 additions & 0 deletions rfcs/084-shopify-integration-strategies/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file contains a list of files that will be excluded from Shopify CLI
# operations such as push, pull, dev, etc.
#
# Examples:
#
# Ignore a specific file:
# templates/product.json
#
# Ignore templates with a wildcard pattern:
# templates/*.json
#
# Ignore templates and sections with a regular expression:
# /(templates|sections)/.*\.json/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: theme-check:recommended
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Copyright (c) 2018-present Shopify Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, sell and/or create derivative works of the Software or any part thereof, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The rights granted above may only be exercised to develop themes that integrate or interoperate with Shopify software or services, and, if applicable, to distribute, offer for sale or otherwise make available any such themes via the Shopify Theme Store. All other uses of the Software are strictly prohibited.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
160 changes: 160 additions & 0 deletions rfcs/084-shopify-integration-strategies/skeleton-theme/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<h1 align="center" style="position: relative;">
<br>
<img src="./assets/shoppy-x-ray.svg" alt="logo" width="200">
<br>
Shopify Skeleton Theme
</h1>

A minimal, carefully structured Shopify theme designed to help you quickly get started. Designed with modularity, maintainability, and Shopify's best practices in mind.

<p align="center">
<a href="./LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License"></a>
<a href="./actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Shopify/skeleton-theme/actions/workflows/ci.yml/badge.svg"></a>
</p>

## Getting started

### Prerequisites

Before starting, ensure you have the latest Shopify CLI installed:

- [Shopify CLI](https://shopify.dev/docs/api/shopify-cli) – helps you download, upload, preview themes, and streamline your workflows

If you use VS Code:

- [Shopify Liquid VS Code Extension](https://shopify.dev/docs/storefronts/themes/tools/shopify-liquid-vscode) – provides syntax highlighting, linting, inline documentation, and auto-completion specifically designed for Liquid templates

### Clone

Clone this repository using Git or Shopify CLI:

```bash
git clone git@github.com:Shopify/skeleton-theme.git
# or
shopify theme init
```

### Preview

Preview this theme using Shopify CLI:

```bash
shopify theme dev
```

## Theme architecture

```bash
.
├── assets # Stores static assets (CSS, JS, images, fonts, etc.)
├── blocks # Reusable, nestable, customizable UI components
├── config # Global theme settings and customization options
├── layout # Top-level wrappers for pages (layout templates)
├── locales # Translation files for theme internationalization
├── sections # Modular full-width page components
├── snippets # Reusable Liquid code or HTML fragments
└── templates # Templates combining sections to define page structures
```

To learn more, refer to the [theme architecture documentation](https://shopify.dev/docs/storefronts/themes/architecture).

### Templates

[Templates](https://shopify.dev/docs/storefronts/themes/architecture/templates#template-types) control what's rendered on each type of page in a theme.

The Skeleton Theme scaffolds [JSON templates](https://shopify.dev/docs/storefronts/themes/architecture/templates/json-templates) to make it easy for merchants to customize their store.

None of the template types are required, and not all of them are included in the Skeleton Theme. Refer to the [template types reference](https://shopify.dev/docs/storefronts/themes/architecture/templates#template-types) for a full list.

### Sections

[Sections](https://shopify.dev/docs/storefronts/themes/architecture/sections) are Liquid files that allow you to create reusable modules of content that can be customized by merchants. They can also include blocks which allow merchants to add, remove, and reorder content within a section.

Sections are made customizable by including a `{% schema %}` in the body. For more information, refer to the [section schema documentation](https://shopify.dev/docs/storefronts/themes/architecture/sections/section-schema).

### Blocks

[Blocks](https://shopify.dev/docs/storefronts/themes/architecture/blocks) let developers create flexible layouts by breaking down sections into smaller, reusable pieces of Liquid. Each block has its own set of settings, and can be added, removed, and reordered within a section.

Blocks are made customizable by including a `{% schema %}` in the body. For more information, refer to the [block schema documentation](https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/schema).

## Schemas

When developing components defined by schema settings, we recommend these guidelines to simplify your code:

- **Single property settings**: For settings that correspond to a single CSS property, use CSS variables:

```liquid
<div class="collection" style="--gap: {{ block.settings.gap }}px">
...
</div>

{% stylesheet %}
.collection {
gap: var(--gap);
}
{% endstylesheet %}

{% schema %}
{
"settings": [{
"type": "range",
"label": "gap",
"id": "gap",
"min": 0,
"max": 100,
"unit": "px",
"default": 0,
}]
}
{% endschema %}
```

- **Multiple property settings**: For settings that control multiple CSS properties, use CSS classes:

```liquid
<div class="collection {{ block.settings.layout }}">
...
</div>

{% stylesheet %}
.collection--full-width {
/* multiple styles */
}
.collection--narrow {
/* multiple styles */
}
{% endstylesheet %}

{% schema %}
{
"settings": [{
"type": "select",
"id": "layout",
"label": "layout",
"values": [
{ "value": "collection--full-width", "label": "t:options.full" },
{ "value": "collection--narrow", "label": "t:options.narrow" }
]
}]
}
{% endschema %}
```

## CSS & JavaScript

For CSS and JavaScript, we recommend using the [`{% stylesheet %}`](https://shopify.dev/docs/api/liquid/tags#stylesheet) and [`{% javascript %}`](https://shopify.dev/docs/api/liquid/tags/javascript) tags. They can be included multiple times, but the code will only appear once.

### `critical.css`

The Skeleton Theme explicitly separates essential CSS necessary for every page into a dedicated `critical.css` file.

## Contributing

We're excited for your contributions to the Skeleton Theme! This repository aims to remain as lean, lightweight, and fundamental as possible, and we kindly ask your contributions to align with this intention.

Visit our [CONTRIBUTING.md](./CONTRIBUTING.md) for a detailed overview of our process, guidelines, and recommendations.

## License

Skeleton Theme is open-sourced under the [MIT](./LICENSE.md) License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/** Critical CSS for the theme. This file is included on every page. */

/* Reset styles inspired by https://www.joshwcomeau.com/css/custom-css-reset/ */
* {
box-sizing: border-box;
margin: 0;
}

body {
display: flex;
flex-direction: column;
margin: 0;
min-height: 100svh;
}

html:has(dialog[scroll-lock][open], details[scroll-lock][open]) {
overflow: hidden;
}

img,
picture,
video,
canvas,
svg {
display: block;
max-width: 100%;
height: auto;
}

input,
textarea,
select {
font: inherit;
border-radius: var(--style-border-radius-inputs);
}

select {
background-color: var(--color-background);
color: currentcolor;
}

dialog {
background-color: var(--color-background);
color: var(--color-foreground);
}

p {
text-wrap: pretty;
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
overflow-wrap: break-word;
}

p:empty {
display: none;
}

:is(p, h1, h2, h3, h4, h5, h6):first-child,
:empty:first-child + :where(p, h1, h2, h3, h4, h5, h6) {
margin-block-start: 0;
}

:is(p, h1, h2, h3, h4, h5, h6):last-child,
:where(p, h1, h2, h3, h4, h5, h6) + :has(+ :empty:last-child) {
margin-block-end: 0;
}

/** Theme styles below */
body {
font-family: var(--font-body--family);
background-color: var(--color-background);
color: var(--color-foreground);
}

h1, h2, h3, h4, h5, h6 {
font-family: var(--font-heading--family);
}

/** Section layout utilities */

/**
* Setup a grid that enables both full-width and constrained layouts
* depending on the class of the child elements.
*
* By default, a minimum content margin is set on the left and right
* sides of the section and the content is centered in the viewport to
* not exceed the maximum page width.
*
* When a child element is given the `full-width` class, it will span
* the entire viewport.
*/
.shopify-section {
--content-width: min(
calc(var(--page-width) - var(--page-margin) * 2),
calc(100% - var(--page-margin) * 2)
);
--content-margin: minmax(var(--page-margin), 1fr);
--content-grid: var(--content-margin) var(--content-width) var(--content-margin);

/* This is required to make <img> elements work as background images */
position: relative;
grid-template-columns: var(--content-grid);
display: grid;
width: 100%;
}

/* Child elements, by default, are constrained to the central column of the grid. */
.shopify-section > * {
grid-column: 2;
}

/* Child elements that use the full-width utility class span the entire viewport. */
.shopify-section > .full-width {
grid-column: 1 / -1;
}

.shopify-section-group-header-group {
border-bottom: 1px solid #ccc;
margin-bottom: 2rem;
}

/** Card grid layout */
.highlights {
display: grid;
gap: 2rem;
grid-template-columns: repeat(3, 1fr);
margin-top: 2rem;
}

@media (max-width: 1100px) {
.highlights {
grid-template-columns: 1fr;
}
}

.highlight {
display: flex;
flex-direction: column;
height: 100%;
border-radius: 8px;
background-color: #edece4;
color: rgb(92, 95, 98);
line-height: 1.4;
text-decoration: none;
overflow: hidden;
}

.highlight > * {
padding-inline: 24px;
}

.highlight > *:first-child {
padding-top: 24px;
}

.highlight > *:last-child {
padding-bottom: 24px;
}

.highlight > * + * {
margin-top: 1rem;
}

.highlight > .image {
padding-inline: 0;
padding-top: 0;
}

.highlight h3 {
font-size: 1rem;
color: rgb(32, 34, 35);
}

.highlight-description {
flex: 1 1;
}

.section-heading::before {
content: '';
width: 64px;
height: 18px;
background: #ffce3c;
display: block;
margin-bottom: 1rem;

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading