Skip to content

Instantly share code, notes, and snippets.

@boldsupport
Created February 12, 2019 14:59
Show Gist options
  • Save boldsupport/131376627078a73d8cae40896d59f445 to your computer and use it in GitHub Desktop.
Save boldsupport/131376627078a73d8cae40896d59f445 to your computer and use it in GitHub Desktop.
A neutral CSS template to use on landing pages for Upsell by Email
html {
font-family: "Helvetica Neue", Arial, sans-serif;
}
.flex-spacer {
flex: 1;
}
.content {
min-width: 700px;
max-width: 1000px;
margin-left: auto;
margin-right: auto;
}
.header {
display: flex;
justify-content: center;
background-color: #a0a0a0;
padding: 15px 0;
}
.shop-name {
color: white;
font-size: 24px;
padding: 1rem 0;
}
.sticky-footer {
background-color: white;
position: -webkit-sticky;
position: sticky;
width: 100%;
padding-top: 1rem;
bottom: 0;
box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.footer {
padding-top: 1rem;
}
.title {
margin-top: 3rem;
font-size: 2.25rem;
font-weight: 400;
text-align: center;
}
.message {
text-align: center;
font-size: 1.25rem;
margin: 20px 0 50px;
}
input[type=submit],
button {
text-transform: uppercase;
color: white;
border: none;
border-radius: 2px;
cursor: pointer;
}
input[type=submit] {
margin-bottom: .5rem;
}
hr {
height: 1px;
border: 0;
border-top: 2px solid #f0f0f0;
margin: 20px 0;
padding: 0;
}
.side-products {
margin-bottom: 15px;
}
.one-col{/**/}
.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 15px;
}
.three-col {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 15px;
}
.four-col {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-gap: 15px;
}
/* Card */
.card {
display: grid;
grid-gap: 15px;
grid-template-rows: 1fr auto;
grid-template-columns: auto 1fr;
grid-template-areas:
"image info"
"image actions";
border: #f0f0f0 solid 2px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
align-items: start;
margin: 15px 0;
padding: 30px;
}
.one-col .card {
grid-template-rows: none;
grid-template-columns: auto 1fr auto ;
grid-template-areas:
"image info actions";
align-items: center;
}
.two-col .card {
margin: 0;
}
.three-col .card,
.four-col .card {
grid-template-rows: 1fr auto auto;
grid-template-columns: 1fr ;
grid-template-areas:
"image"
"info"
"actions";
align-items: center;
margin: 0;
}
/* Card Image */
.card-image {
grid-area: image;
object-fit: contain;
align-self: center;
justify-self: center;
width: 200px;
height: 200px;
}
.one-col .card-image {
width: 100px;
height: 100px;
}
.two-col .card-image {
width: 100px;
height: 100px;
}
.three-col .card-image {
width: 150px;
height: 150px;
}
.four-col .card-image {
width: 150px;
height: 150px;
}
/* Card Information */
.card-info {
grid-area: info;
}
.card-info--title,
.card-info--price {
text-transform: uppercase;
font-size: 1.75rem;
font-weight: 700;
}
.card-info--price {
color: #a0a0a0;
}
.side-products .card-info--title,
.side-products .card-info--price{
font-size: 1.25rem;
}
.three-col .card-info--price,
.four-col .card-info--price {
margin-bottom: 0;
}
/* Card Actions */
.card-actions {
grid-area: actions;
display: flex;
justify-self: end;
align-content: end;
align-self: end;
height: 3.6rem;
}
.one-col .card-actions {
align-items: stretch;
align-self: center;
height: 2.5rem;
}
.two-col .card-actions,
.three-col .card-actions,
.four-col .card-actions {
height: 2.5rem;
width: 100%;
}
.card-actions--add-btn {
text-transform: uppercase;
background-color: #a0a0a0;
flex: 2;
width: 12rem;
font-size: 1.6rem;
padding: 0.5rem 0;
}
.one-col .card-actions--add-btn {
font-size: 1.15rem;
padding: 0.25rem 2rem;
}
.two-col .card-actions--add-btn,
.three-col .card-actions--add-btn,
.four-col .card-actions--add-btn {
font-size: 1rem;
padding: 0.25rem 0;
width: auto;
flex: 1;
}
.card-actions--add-btn.added {
background-color: #a0a0a0
}
.card-actions--add-btn.alert {
background-color: rgb(83, 28, 16);
}
.total {
display: grid;
grid-template-columns: auto 1fr;
grid-template-areas: "label value";
}
.total-label--title {
font-size: 2rem;
}
.total-label--subtitle {
color: rgb(132, 132, 132);
font-size: .75rem;
}
.total-value {
display: flex;
align-items: center;
justify-self: end;
align-self: center;
}
.total-value--currency {
color: rgb(132, 132, 132);
margin-right: 8px;
}
.total-value--amount {
font-size: 1.75rem;
}
form {
text-align: right;
}
.submit-btn {
background-color: #a0a0a0;
font-size: 1.5rem;
padding: 0.75rem 2rem;
font-weight: 400;
}
.expiration-date {
text-align: right;
padding-bottom: 1.5rem;
}
/*
-------------------------
Confirmation/Receipt Page
-------------------------
*/
.receipt-msg {
margin-top: 3rem;
margin-bottom: .5rem;
text-align: center;
background-color: #f2f2f2;
font-size: 1.5rem;
padding: .5rem;
}
.row {
display: grid;
width: 100%;
justify-items: left;
align-items: center;
grid-template-columns: 100px 1fr 120px;
grid-template-areas: "image info total";
padding: .5rem .25rem;
border-top: 1px solid #ededed;
}
.row:first-child {
border-top: none;
}
.row:last-child {
border-bottom: 1px solid #e0e0e0;
}
.row-image {
grid-area: image;
object-fit: contain;
align-self: center;
justify-self: center;
width: 90px;
height: 90px;
}
.row-info *,
.row-total * {
margin-bottom: .25rem;
text-transform: uppercase;
font-size: 1.25rem;
font-weight: 700;
}
.row-info--price {
color: #a0a0a0;
}
/*
---------------------------
Custom number input styling
---------------------------
*/
.number-input {
border: 1px solid #e0e0e0;
border-radius: 2px;
display: flex;
align-items: center;
margin-right: 10px;
justify-content: space-around;
}
/*.number-input,*/
.number-input * {
box-sizing: border-box;
}
input[type=number] {
-webkit-appearance: textfield;
-moz-appearance: textfield;
appearance: textfield;
width: 3rem;
}
.three-col input[type=number],
.four-col input[type=number] {
width: 1.75rem;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
.number-input button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: transparent;
border: none;
align-items: center;
justify-content: center;
width: 1.5rem;
height: 100%;
cursor: pointer;
margin: 0;
position: relative;
flex: 1;
}
.three-col .number-input button,
.four-col .number-input button {
width: 1.75rem;
}
/* draw the minus and plus */
.number-input button:before,
.number-input button:after {
display: inline-block;
position: absolute;
content: '';
width: .7rem;
height: 2px;
background-color: #212121;
transform: translate(-50%, -50%);
}
.number-input button.plus:after {
transform: translate(-50%, -50%) rotate(90deg);
}
.number-input input[type=number] {
padding: .5rem;
border-width: 0;
font-size: 1.1rem;
font-weight: bold;
text-align: center;
}
.side-products .number-input input[type=number] {
font-size: .9rem;
}
@media (max-width: 700px) {
.header {
display: flex;
justify-content: center;
background-color: #a0a0a0
padding: 15px 0;
}
.content {
min-width: 0;
width: 90%;
margin: 0 auto;
}
.sticky-footer {
padding-top: .75rem;
}
.logo {
width: 150px;
height: 60px;
}
.title {
margin-top: 3rem;
font-size: 1.75rem;
}
.message {
font-size: 1rem;
text-align: left;
}
.side-products {
display: block;
}
.card {
display: grid;
grid-gap: 10px;
grid-template-rows: 1fr auto auto;
grid-template-columns: 1fr;
grid-template-areas:
"image"
"info"
"actions";
align-items: start;
margin: 15px 0;
padding: 15px;
}
.side-products .card {
grid-template-rows: auto auto;
grid-template-columns: auto 1fr;
grid-template-areas:
"image info"
"image actions";
align-items: center;
margin: 15px 0;
}
.card-image {
height: auto;
width: 100%;
}
.side-products .card-image {
width: 80px;
height: 80px;
}
.card-info {
grid-area: info;
}
.card-info--title,
.card-info--price {
font-size: 1.75rem;
margin-bottom: 0;
}
.side-products .card-info div {
font-size: 1.25rem;
}
.card-actions {
height: 2.7rem;
width: 100%;
}
.card-actions--add-btn {
text-transform: uppercase;
background-color: #a0a0a0;
flex: 2;
width: auto;
font-size: 1.25rem;
padding: 0.5rem 0;
}
.number-input {
flex: 1
}
.side-products .card-actions--add-btn {
font-size: 1rem;
padding: 0.25rem 0;
width: auto;
flex: 2;
}
input[type=number] {
-webkit-appearance: textfield;
-moz-appearance: textfield;
appearance: textfield;
width: 3rem;
}
.total-label--title {
font-size: 1.4rem;
}
.total-label--subtitle {
color: rgb(132, 132, 132);
font-size: .75rem;
}
.total-value {
display: flex;
align-items: center;
justify-self: end;
align-self: center;
}
.total-value--currency {
color: rgb(132, 132, 132);
margin-right: 8px;
}
.total-value--amount {
font-size: 1.5rem;
}
.submit-btn {
margin-top: .5rem;
width: 100%;
font-size: 1.05rem;
padding: .5rem 0;
}
.expiration-date {
font-size: 1rem;
padding-bottom: 1rem;
}
}
.unsubscribe > form {
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment