Skip to content

Commit

Permalink
Merge tag 'v14.0.0' into v14
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaJasonLiu committed May 23, 2024
2 parents 59860ec + 87da4ff commit 2e23834
Show file tree
Hide file tree
Showing 137 changed files with 4,535 additions and 3,848 deletions.
10 changes: 0 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ We relentlessly and continuously optimize code within the constraint of being We

Themes must be built with purpose. They shouldn’t support each and every feature in Shopify.

### JavaScript not required, fails gracefully

_NoJS is our baseline._

We extract every bit of speed and functionality out of HTTP, semantic HTML, and CSS before writing our first line of JavaScript.

JavaScript can only be used to progressively enhance features. JavaScript cannot be required to find or purchase products. And the little JavaScript that we use must always fail gracefully, such that every browser gets the most “enhanced” experience that it can within the capabilities that it has.

>:information_source: We do so not because we expect buyers to experience our storefronts with JavaScript disabled, but because it keeps us aligned with the other principles: writing fast, server-rendered, Web-native code.
### Server-rendered

_Our main constraint._
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ Dawn represents a HTML-first, JavaScript-only-as-needed approach to theme develo

* **Web-native in its purest form:** Themes run on the [evergreen web](https://www.w3.org/2001/tag/doc/evergreen-web/). We leverage the latest web browsers to their fullest, while maintaining support for the older ones through progressive enhancement—not polyfills.
* **Lean, fast, and reliable:** Functionality and design defaults to “no” until it meets this requirement. Code ships on quality. Themes must be built with purpose. They shouldn’t support each and every feature in Shopify.
* **JavaScript not required, fails gracefully:** We extract every bit of speed and functionality out of HTTP, semantic HTML, and CSS before writing our first line of JavaScript. JavaScript can only be used to progressively enhance features.
* **Server-rendered:** HTML must be rendered by Shopify servers using Liquid. Business logic and platform primitives such as translations and money formatting don’t belong on the client. Async and on-demand rendering of parts of the page is OK, but we do it sparingly as a progressive enhancement.
* **Functional, not pixel-perfect:** The Web doesn’t require each page to be rendered pixel-perfect by each browser engine. Using semantic markup, progressive enhancement, and clever design, we ensure that themes remain functional regardless of the browser.

You can find a more detailed version of our theme code principles in the [contribution guide](https://github.com/Shopify/dawn/blob/main/.github/CONTRIBUTING.md#theme-code-principles).

## Getting started
We recommend using Dawn as a starting point for theme development. [Learn more on Shopify.dev](https://shopify.dev/themes/getting-started/create).
We recommend using Dawn as a starting point for theme development. [Learn more on Shopify.dev](https://shopify.dev/themes/getting-started/create).

> If you're building a theme for the Shopify Theme Store, then you can use Dawn as a starting point. However, the theme that you submit needs to be [substantively different from Dawn](https://shopify.dev/themes/store/requirements#uniqueness) so that it provides added value for merchants. Learn about the [ways that you can use Dawn](https://shopify.dev/themes/tools/dawn#ways-to-use-dawn).
Expand Down Expand Up @@ -61,7 +60,7 @@ There are a number of really useful tools that the Shopify Themes team uses duri

[Shopify CLI](https://github.com/Shopify/shopify-cli) helps you build Shopify themes faster and is used to automate and enhance your local development workflow. It comes bundled with a suite of commands for developing Shopify themes—everything from working with themes on a Shopify store (e.g. creating, publishing, deleting themes) or launching a development server for local theme development.

You can follow this [quick start guide for theme developers](https://github.com/Shopify/shopify-cli#quick-start-guide-for-theme-developers) to get started.
You can follow this [quick start guide for theme developers](https://shopify.dev/docs/themes/tools/cli) to get started.

### Theme Check

Expand Down
99 changes: 24 additions & 75 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,6 @@

/* base */

.no-js:not(html) {
display: none !important;
}

html.no-js .no-js:not(html) {
display: block !important;
}

.no-js-inline {
display: none !important;
}

html.no-js .no-js-inline {
display: inline-block !important;
}

html.no-js .no-js-hidden {
display: none !important;
}

.page-width {
max-width: var(--page-width);
margin: 0 auto;
Expand Down Expand Up @@ -594,6 +574,7 @@ details > * {
--duration-medium: 300ms;
--duration-long: 500ms;
--duration-extra-long: 600ms;
--duration-extra-longer: 750ms;
--duration-extended: 3s;
--ease-out-slow: cubic-bezier(0, 0, 0.3, 1);
--animation-slide-in: slideIn var(--duration-extra-long) var(--ease-out-slow) forwards;
Expand Down Expand Up @@ -714,19 +695,12 @@ summary::-webkit-details-marker {
}

/* Fallback - for browsers that don't support :focus-visible, a fallback is set for :focus */
.focused,
.no-js *:focus {
.focused {
outline: 0.2rem solid rgba(var(--color-foreground), 0.5);
outline-offset: 0.3rem;
box-shadow: 0 0 0 0.3rem rgb(var(--color-background)), 0 0 0.5rem 0.4rem rgba(var(--color-foreground), 0.3);
}

/* Negate the fallback side-effect for browsers that support :focus-visible */
.no-js *:focus:not(:focus-visible) {
outline: 0;
box-shadow: none;
}

/*
Focus ring - inset
*/
Expand All @@ -737,18 +711,12 @@ summary::-webkit-details-marker {
box-shadow: 0 0 0.2rem 0 rgba(var(--color-foreground), 0.3);
}

.focused.focus-inset,
.no-js .focus-inset:focus {
.focused.focus-inset {
outline: 0.2rem solid rgba(var(--color-foreground), 0.5);
outline-offset: -0.2rem;
box-shadow: 0 0 0.2rem 0 rgba(var(--color-foreground), 0.3);
}

.no-js .focus-inset:focus:not(:focus-visible) {
outline: 0;
box-shadow: none;
}

/*
Focus ring - none
*/
Expand All @@ -765,18 +733,12 @@ summary::-webkit-details-marker {
box-shadow: 0 0 0 1rem rgb(var(--color-background)), 0 0 0.2rem 1.2rem rgba(var(--color-foreground), 0.3);
}

.focus-offset.focused,
.no-js .focus-offset:focus {
.focus-offset.focused {
outline: 0.2rem solid rgba(var(--color-foreground), 0.5);
outline-offset: 1rem;
box-shadow: 0 0 0 1rem rgb(var(--color-background)), 0 0 0.2rem 1.2rem rgba(var(--color-foreground), 0.3);
}

.no-js .focus-offset:focus:not(:focus-visible) {
outline: 0;
box-shadow: none;
}

/* component-title */
.title,
.title-wrapper-with-link {
Expand Down Expand Up @@ -2037,34 +1999,14 @@ product-info .loading__spinner:not(.hidden) ~ *,
list-style-type: none;
}

.no-js details[open] .modal__toggle {
position: absolute;
z-index: 5;
}

.modal__toggle-close {
display: none;
}

.no-js details[open] svg.modal__toggle-close {
display: flex;
z-index: 1;
height: 1.7rem;
width: 1.7rem;
}

.modal__toggle-open {
display: flex;
}

.no-js details[open] .modal__toggle-open {
display: none;
}

.no-js .modal__close-button.link {
display: none;
}

.modal__close-button.link {
display: flex;
justify-content: center;
Expand Down Expand Up @@ -2331,13 +2273,25 @@ product-info .loading__spinner:not(.hidden) ~ *,
}

@keyframes translateAnnouncementSlideIn {
0% {opacity: 0; transform: translateX(var(--announcement-translate-from))}
100% {opacity: 1; transform: translateX(0)}
0% {
opacity: 0;
transform: translateX(var(--announcement-translate-from));
}
100% {
opacity: 1;
transform: translateX(0);
}
}

@keyframes translateAnnouncementSlideOut {
0% {opacity: 1; transform: translateX(0)}
100% {opacity: 0; transform: translateX(var(--announcement-translate-to))}
0% {
opacity: 1;
transform: translateX(0);
}
100% {
opacity: 0;
transform: translateX(var(--announcement-translate-to));
}
}

/* section-header */
Expand Down Expand Up @@ -2601,6 +2555,10 @@ product-info .loading__spinner:not(.hidden) ~ *,
background: rgba(var(--color-foreground), 0.5);
}

.header__icon--account shop-user-avatar {
--shop-avatar-size: 2.8rem;
}

/* Search */
menu-drawer + .header__search {
display: none;
Expand Down Expand Up @@ -2648,10 +2606,6 @@ menu-drawer + .header__search {
}
}

.no-js .predictive-search {
display: none;
}

details[open] > .search-modal {
opacity: 1;
animation: animateMenuOpen var(--duration-default) ease;
Expand All @@ -2671,11 +2625,6 @@ details[open] .modal-overlay::after {
height: 100vh;
}

.no-js details[open] > .header__icon--search {
top: 1rem;
right: 0.5rem;
}

.search-modal {
opacity: 0;
border-bottom: 0.1rem solid rgba(var(--color-foreground), 0.08);
Expand Down
7 changes: 6 additions & 1 deletion assets/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ class CartItems extends HTMLElement {
}

onChange(event) {
this.updateQuantity(event.target.dataset.index, event.target.value, document.activeElement.getAttribute('name'), event.target.dataset.quantityVariantId);
this.updateQuantity(
event.target.dataset.index,
event.target.value,
document.activeElement.getAttribute('name'),
event.target.dataset.quantityVariantId
);
}

onCartUpdate() {
Expand Down
Loading

0 comments on commit 2e23834

Please sign in to comment.