forked from TrellisCommerce/shopify-tailwind-starter-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dawn theme files, Tailwind & Prettier integrations
- Loading branch information
Christy
committed
Apr 8, 2022
1 parent
93cf10e
commit 8f00d2c
Showing
261 changed files
with
104,616 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
# Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to make participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, nationality, personal | ||
appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all project spaces, and it also applies when | ||
an individual is representing the project or its community in public spaces. | ||
Examples of representing a project or community include using an official | ||
project e-mail address, posting via an official social media account, or acting | ||
as an appointed representative at an online or offline event. Representation of | ||
a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at <[email protected]>. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see | ||
https://www.contributor-covenant.org/faq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
# Contributing | ||
|
||
[Before contributing](#before-contributing) | | ||
[Scope](#scope) | | ||
[Theme code principles](#theme-code-principles) | | ||
[Contributing code](#contributing-code) | | ||
[Reporting a bug](#reporting-a-bug) | | ||
[Reviewing](#reviewing) | ||
|
||
We're really glad you're reading this, because we would love to have more developers contribute to this theme! If you're passionate about building for the next million entrepreneurs, you're in the right place. | ||
|
||
## Before contributing | ||
|
||
If you encounter a bug or think of a useful feature for Dawn, please [create a new issue](https://github.com/Shopify/dawn/issues/new). Creating an issue before jumping into code ensures we can discuss it and determine whether it aligns with the direction of the theme. | ||
|
||
If you want to contribute to the theme, regardless of whether it's a small bug fix or correcting a typo, please feel free to do so. Any help goes a long way! Also, contributions aren't necessarily all code related. Other contributions can be in the form of issues, pull requests, discussions, etc. | ||
|
||
## Scope | ||
|
||
This Github repository exists for the theme development community to discuss and solve problems directly related to Dawn. It **is not the place** to discuss general theme development problems, nor the place to seek help for non-Dawn related problems. | ||
|
||
Shopify theme development is a big topic and it's completely normal that you will encounter problems which might require you to reach out for help. In fact, we provide several knowledge and support platforms for theme development already: | ||
|
||
* [Shopify Development](https://shopify.dev/themes) | ||
* [Shopify Help Center](https://help.shopify.com/themes) | ||
* [Shopify Forum](https://ecommerce.shopify.com/forums) | ||
* [Shopify Experts](https://experts.shopify.com/) | ||
|
||
## Theme code principles | ||
|
||
Before contributing to Dawn, please read the following theme code principles to better understand our fundamental approach to theme development. The expectation is that you follow these principles as you build for Dawn. | ||
|
||
### Why these principles? | ||
|
||
Browsers provide APIs to solve many problems: from [WebGL](https://en.wikipedia.org/wiki/WebGL) and [WASM](https://en.wikipedia.org/wiki/WebAssembly)-powered apps to static websites. The best APIs to use depends on the thing you’re building. Themes power ecommerce websites. In most cases, _Web-native_—making the most of the built-in features of browsers: HTTP, HTML, CSS, JavaScript, and the DOM—is a perfect fit for ecommerce websites. Ecommerce needs incredibly fast websites for mostly “logged out” traffic. | ||
|
||
### Web-native in its purest form | ||
|
||
_The most important principle._ | ||
|
||
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. | ||
|
||
We write bespoke Web-native code with no abstractions. Frameworks, libraries, and dependencies don’t belong in our themes. | ||
|
||
We engage with the browser ecosystem on behalf of our merchants to make Web-native ecommerce the best it can be. | ||
|
||
“Don’t repeat yourself” is an anti-pattern. We do our utmost best to do more with less, but we don’t build abstractions around repetition. Instead, we use linting and testing to enforce consistently-good and up-to-date Web-native code. | ||
|
||
### Lean, fast, and reliable | ||
|
||
_The principle requirement._ | ||
|
||
Code must be lean, fast, and reliable. Our targets include: | ||
|
||
* Zero [Cumulative Layout Shift](https://web.dev/cls/) | ||
* No DOM manipulation before user input | ||
* No render-blocking JavaScript | ||
* No [long tasks](https://developer.mozilla.org/en-US/docs/Web/API/Long_Tasks_API) | ||
|
||
Functionality and design defaults to “no” until it meets this requirement. Code ships on quality. | ||
|
||
We relentlessly and continuously optimize code within the constraint of being Web-native. If ever there is a feature that browsers have not made fast yet, we either don’t use it, or use it “as is” if it is fast enough. We trust that browsers will get faster over time. | ||
|
||
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._ | ||
|
||
HTML must be rendered by Shopify servers using [Liquid](https://shopify.dev/api/liquid). Business logic and platform primitives such as translations and money formatting don’t belong on the client. | ||
|
||
Server-rendered doesn’t imply “full page reload”. 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 | ||
|
||
_No buyer is left behind._ | ||
|
||
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. | ||
|
||
And since legacy browsers are often the slowest, we don’t burden them with polyfills. We rely instead on the fail-open nature of the Web to provide them with a “minimal but functional” experience. | ||
|
||
## Contributing code | ||
|
||
You can follow these steps to go from setting up a store to creating a pull request for Dawn. | ||
|
||
>:information_source: We'll assume you're already set up with Git and GitHub (if you're not familiar with these, [start with these docs](https://docs.github.com/github/getting-started-with-github/quickstart/set-up-git)). | ||
1. Set up a [development store](https://shopify.dev/themes/tools/development-stores) so you can test your code changes (assuming you don't already have a store). | ||
2. Install the [Shopify CLI](https://github.com/Shopify/shopify-cli) by following [these steps](https://shopify.dev/themes/tools/cli/installation). | ||
3. Fork the repository, clone it and create a new branch: | ||
```sh | ||
git clone [email protected]:your-username/dawn.git | ||
cd dawn | ||
git checkout -b your-new-branch-name | ||
``` | ||
4. Launch a development server: | ||
```sh | ||
shopify theme serve | ||
``` | ||
5. Add your changes to the codebase. | ||
6. Commit your changes: | ||
```sh | ||
git commit -a -m="Your commit message" | ||
``` | ||
7. Push your commit to your forked repository: | ||
```sh | ||
git push origin your-new-branch-name | ||
``` | ||
8. Open a pull request. See [GitHub's official documentation](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) for more details. | ||
9. Before you can merge your pull request, you must sign Shopify's [Contributor License Agreement (CLA)](https://cla.shopify.com/). | ||
|
||
## Reporting a bug | ||
|
||
Bugs are tracked as [GitHub issues](https://github.com/Shopify/dawn/issues). Search open issues to see if someone else has reported a similar bug. If it's something new, [open an issue](https://github.com/Shopify/dawn/issues/new). We'll use the issue to have a conversation about the problem you want to fix. | ||
|
||
When creating a new issue, please ensure the issue is clear and include additional details to help maintainers reproduce it: | ||
|
||
* **Use a clear and descriptive title** for the issue to identify the problem. | ||
* **Describe the exact steps which reproduce the problem** in as many details as possible. | ||
* **Provide specific examples to demonstrate the steps.** Include links to files, or copy/pasteable snippets. If you're providing snippets in the issue, use Markdown code blocks. | ||
* **Describe the behavior you observed** after following the steps and point out what exactly is the problem with that behavior. | ||
* **Explain which behavior you expected to see** instead and why. | ||
* **Include screenshots and animated GIFs** where possible. | ||
|
||
## Reviewing | ||
|
||
We (the Themes team) review every single PR. The purpose of reviews is to create the best version of Dawn we can for merchants, developers, and others who use it. | ||
|
||
:yellow_heart: Reviews are always respectful, acknowledging that everyone did the best possible job with the knowledge they had at the time. | ||
:yellow_heart: Reviews discuss content, not the person who created it. | ||
:yellow_heart: Reviews are constructive and start conversation around feedback. | ||
|
||
### Self review | ||
|
||
You should always review your own PR first. | ||
|
||
For code changes, make sure that you: | ||
- [ ] Confirm that the changes meet our [theme code principles](#theme-code-principles). | ||
- [ ] Check new or updated Liquid docs to confirm that the code used is up to date and isn't deprecated. | ||
- [ ] If there are any failing checks in your PR, troubleshoot them until they're all passing. | ||
- [ ] Add @Shopify/themes-front-end-developers as a reviewer. | ||
|
||
### Pull request template | ||
|
||
When you open a pull request, you must fill out the "Ready for review" template before we can review your PR. This template helps reviewers understand your changes and the purpose of your pull request. | ||
|
||
### Suggested changes | ||
|
||
We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. | ||
|
||
As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Bug issue | ||
about: Use this template for reporting a bug | ||
labels: 'type:bug' | ||
|
||
--- | ||
|
||
**Describe the current behavior** | ||
|
||
**Describe the expected behavior** | ||
|
||
**Version information (Dawn, browsers and operating systems)** | ||
- Dawn Version: 1.0.0 | ||
- Chrome Version 91.0.4472.114 | ||
- macOS Version 11.3.1 | ||
|
||
**Possible solution** | ||
|
||
**Additional context/screenshots** | ||
Add any other context about the problem here. If applicable, add screenshots to help explain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: "Feature request" | ||
about: "Use this template for suggesting a Dawn enhancement" | ||
labels: 'i: enhancement' | ||
|
||
--- | ||
|
||
**Describe the enhancement you'd like** | ||
A clear and concise description of what you want added to Dawn. Add any considered drawbacks. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context/screenshots** | ||
Maybe a screenshot or design? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
**PR Summary:** | ||
|
||
_Please include a short description (using non-technical terms, 1-2 sentences) about the changes you are introducing, what problem is being fixed and/or describe the benefit to merchants. This content will be used in our release notes for Dawn on [themes.shopify.com](https://themes.shopify.com/themes/dawn/styles/default#ReleaseNotes)._ | ||
|
||
|
||
**Why are these changes introduced?** | ||
|
||
Fixes #0. | ||
|
||
**What approach did you take?** | ||
|
||
**Other considerations** | ||
|
||
**Testing steps/scenarios** | ||
- [ ] _List all the testing tasks that applies to your fix and help peers to review your work._ | ||
|
||
**Demo links** | ||
_Please include a link to a demo store that includes preconfigured sections and settings to allow reviewers to easily test the features you are working on._ | ||
|
||
- [Store](url) | ||
- [Editor](url) | ||
|
||
**Checklist** | ||
- [ ] Added PR summary for [release notes](https://themes.shopify.com/themes/dawn/styles/default#ReleaseNotes) | ||
- [ ] Notified the [help.shopify.com](https://help.shopify.com) team about updates to theme settings (current contact: Kimli) | ||
- [ ] Followed [theme code principles](https://github.com/Shopify/dawn/blob/main/.github/CONTRIBUTING.md#theme-code-principles) | ||
- [ ] Linted with [Theme Check](https://github.com/Shopify/theme-check) | ||
- [ ] Tested on [mobile](https://shopify.dev/themes/store/requirements#mobile-browser-requirements) | ||
- [ ] Tested on [multiple browsers](https://shopify.dev/themes/store/requirements#desktop-browser-requirements) | ||
- [ ] Tested for [accessibility](https://shopify.dev/themes/best-practices/accessibility) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
enabled: | ||
- cla |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: CI | ||
on: [push] | ||
jobs: | ||
lhci: | ||
name: Lighthouse | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Lighthouse | ||
uses: shopify/[email protected] | ||
with: | ||
app_id: ${{ secrets.SHOP_APP_ID }} | ||
app_password: ${{ secrets.SHOP_APP_PASSWORD }} | ||
store: ${{ secrets.SHOP_STORE }} | ||
password: ${{ secrets.SHOP_PASSWORD }} | ||
lhci_github_app_token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | ||
product_handle: ${{ secrets.SHOP_PRODUCT_HANDLE }} | ||
collection_handle: ${{ secrets.SHOP_COLLECTION_HANDLE }} | ||
theme-check: | ||
name: Theme Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Theme Check | ||
uses: shopify/theme-check-action@v1 | ||
with: | ||
token: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package.json | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
MatchingTranslations: | ||
enabled: false | ||
TemplateLength: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["shopify.theme-check-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Copyright (c) 2021-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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# dawn-tailwind-starter-base | ||
# Dawn + TailWindCSS + Prettier Shopify Starter Theme | ||
Shopify Dawn theme with TailWindCSS & Prettier integrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
Oops, something went wrong.