@shopify/cli
Version:
A CLI tool to build for the Shopify platform
523 lines (445 loc) • 8.75 kB
CSS
:root {
--aside-width: 400px;
--cart-aside-summary-height-with-discount: 300px;
--cart-aside-summary-height: 250px;
--grid-item-width: 355px;
--header-height: 64px;
--color-dark: #000;
--color-light: #fff;
}
img {
border-radius: 4px;
}
/*
* --------------------------------------------------
* Non anchor links
* --------------------------------------------------
*/
.link:hover {
text-decoration: underline;
cursor: pointer;
}
/*
* --------------------------------------------------
* components/Aside
* --------------------------------------------------
*/
@media (max-width: 45em) {
html:has(.overlay.expanded) {
overflow: hidden;
}
}
aside {
background: var(--color-light);
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
height: 100vh;
width: min(var(--aside-width), 100vw);
position: fixed;
right: calc(-1 * var(--aside-width));
top: 0;
transition: transform 200ms ease-in-out;
}
aside header {
align-items: center;
border-bottom: 1px solid var(--color-dark);
display: flex;
height: var(--header-height);
justify-content: space-between;
padding: 0 20px;
}
aside header h3 {
margin: 0;
}
aside header .close {
font-weight: bold;
opacity: 0.8;
text-decoration: none;
transition: all 200ms;
width: 20px;
}
aside header .close:hover {
opacity: 1;
}
aside header h2 {
margin-bottom: 0.6rem;
margin-top: 0;
}
aside main {
margin: 1rem;
}
aside p {
margin: 0 0 0.25rem;
}
aside p:last-child {
margin: 0;
}
aside li {
margin-bottom: 0.125rem;
}
.overlay {
background: rgba(0, 0, 0, 0.2);
bottom: 0;
left: 0;
opacity: 0;
pointer-events: none;
position: fixed;
right: 0;
top: 0;
transition: opacity 400ms ease-in-out;
transition: opacity 400ms;
visibility: hidden;
z-index: 10;
}
.overlay .close-outside {
background: transparent;
border: none;
color: transparent;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: calc(100% - var(--aside-width));
}
.overlay .light {
background: rgba(255, 255, 255, 0.5);
}
.overlay .cancel {
cursor: default;
height: 100%;
position: absolute;
width: 100%;
}
.overlay.expanded {
opacity: 1;
pointer-events: auto;
visibility: visible;
}
/* reveal aside */
.overlay.expanded aside {
transform: translateX(calc(var(--aside-width) * -1));
}
button.reset {
border: 0;
background: inherit;
font-size: inherit;
}
button.reset > * {
margin: 0;
}
button.reset:not(:has(> *)) {
height: 1.5rem;
line-height: 1.5rem;
}
button.reset:hover:not(:has(> *)) {
text-decoration: underline;
cursor: pointer;
}
/*
* --------------------------------------------------
* components/Header
* --------------------------------------------------
*/
.header {
align-items: center;
background: #fff;
display: flex;
height: var(--header-height);
padding: 0 1rem;
position: sticky;
top: 0;
z-index: 1;
}
.header-menu-mobile-toggle {
@media (min-width: 48em) {
display: none;
}
}
.header-menu-mobile {
display: flex;
flex-direction: column;
grid-gap: 1rem;
}
.header-menu-desktop {
display: none;
grid-gap: 1rem;
@media (min-width: 45em) {
display: flex;
grid-gap: 1rem;
margin-left: 3rem;
}
}
.header-menu-item {
cursor: pointer;
}
.header-ctas {
align-items: center;
display: flex;
grid-gap: 1rem;
margin-left: auto;
}
.header-ctas > * {
min-width: fit-content;
}
/*
* --------------------------------------------------
* components/Footer
* --------------------------------------------------
*/
.footer {
background: var(--color-dark);
margin-top: auto;
}
.footer-menu {
justify-content: center;
display: flex;
flex-wrap: wrap;
grid-gap: 1rem;
padding: 1rem;
}
.footer-menu a {
color: var(--color-light);
min-width: fit-content;
}
/*
* --------------------------------------------------
* components/Cart
* --------------------------------------------------
*/
.cart-main {
height: 100%;
max-height: calc(100vh - var(--cart-aside-summary-height));
overflow-y: auto;
width: auto;
}
.cart-main.with-discount {
max-height: calc(100vh - var(--cart-aside-summary-height-with-discount));
}
.cart-line {
display: flex;
padding: 0.75rem 0;
}
.cart-line img {
height: 100%;
display: block;
margin-right: 0.75rem;
}
.cart-summary-page {
position: relative;
}
.cart-summary-aside {
background: white;
border-top: 1px solid var(--color-dark);
bottom: 0;
padding-top: 0.75rem;
position: absolute;
width: calc(var(--aside-width) - 40px);
}
.cart-line-quantity {
display: flex;
}
.cart-discount {
align-items: center;
display: flex;
margin-top: 0.25rem;
}
.cart-subtotal {
align-items: center;
display: flex;
}
/*
* --------------------------------------------------
* components/Search
* --------------------------------------------------
*/
.predictive-search {
height: calc(100vh - var(--header-height) - 40px);
overflow-y: auto;
}
.predictive-search-form {
background: var(--color-light);
position: sticky;
top: 0;
}
.predictive-search-result {
margin-bottom: 2rem;
}
.predictive-search-result h5 {
text-transform: uppercase;
}
.predictive-search-result-item {
margin-bottom: 0.5rem;
}
.predictive-search-result-item a {
align-items: center;
display: flex;
}
.predictive-search-result-item a img {
margin-right: 0.75rem;
height: 100%;
}
.search-result {
margin-bottom: 1.5rem;
}
.search-results-item {
margin-bottom: 0.5rem;
}
.search-results-item a {
display: flex;
flex: row;
align-items: center;
gap: 1rem;
}
/*
* --------------------------------------------------
* routes/__index
* --------------------------------------------------
*/
.featured-collection {
display: block;
margin-bottom: 2rem;
position: relative;
}
.featured-collection-image {
aspect-ratio: 1 / 1;
@media (min-width: 45em) {
aspect-ratio: 16 / 9;
}
}
.featured-collection img {
height: auto;
max-height: 100%;
object-fit: cover;
}
.recommended-products-grid {
display: grid;
grid-gap: 1.5rem;
grid-template-columns: repeat(2, 1fr);
@media (min-width: 45em) {
grid-template-columns: repeat(4, 1fr);
}
}
.recommended-product img {
height: auto;
}
/*
* --------------------------------------------------
* routes/collections._index.tsx
* --------------------------------------------------
*/
.collections-grid {
display: grid;
grid-gap: 1.5rem;
grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
margin-bottom: 2rem;
}
.collection-item img {
height: auto;
}
/*
* --------------------------------------------------
* routes/collections.$handle.tsx
* --------------------------------------------------
*/
.collection-description {
margin-bottom: 1rem;
max-width: 95%;
@media (min-width: 45em) {
max-width: 600px;
}
}
.products-grid {
display: grid;
grid-gap: 1.5rem;
grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
margin-bottom: 2rem;
}
.product-item img {
height: auto;
width: 100%;
}
/*
* --------------------------------------------------
* routes/products.$handle.tsx
* --------------------------------------------------
*/
.product {
display: grid;
@media (min-width: 45em) {
grid-template-columns: 1fr 1fr;
grid-gap: 4rem;
}
}
.product h1 {
margin-top: 0;
}
.product-image img {
height: auto;
width: 100%;
}
.product-main {
align-self: start;
position: sticky;
top: 6rem;
}
.product-price-on-sale {
display: flex;
grid-gap: 0.5rem;
}
.product-price-on-sale s {
opacity: 0.5;
}
.product-options-grid {
display: flex;
flex-wrap: wrap;
grid-gap: 0.75rem;
}
.product-options-item,
.product-options-item:disabled {
padding: 0.25rem 0.5rem;
background-color: transparent;
font-size: 1rem;
font-family: inherit;
}
.product-option-label-swatch {
width: 1.25rem;
height: 1.25rem;
margin: 0.25rem 0;
}
.product-option-label-swatch img {
width: 100%;
}
/*
* --------------------------------------------------
* routes/blog._index.tsx
* --------------------------------------------------
*/
.blog-grid {
display: grid;
grid-gap: 1.5rem;
grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
margin-bottom: 2rem;
}
.blog-article-image {
aspect-ratio: 3/2;
display: block;
}
.blog-article-image img {
height: 100%;
}
/*
* --------------------------------------------------
* routes/blog.$articlehandle.tsx
* --------------------------------------------------
*/
.article img {
height: auto;
width: 100%;
}
/*
* --------------------------------------------------
* routes/account
* --------------------------------------------------
*/
.account-logout {
display: inline-block;
}