Skip to content

Instantly share code, notes, and snippets.

@arielmagbanuazeald
Created May 24, 2019 04:43
Show Gist options
  • Save arielmagbanuazeald/2c1fe6226ff81e933640e5be8718c61f to your computer and use it in GitHub Desktop.
Save arielmagbanuazeald/2c1fe6226ff81e933640e5be8718c61f to your computer and use it in GitHub Desktop.
ProductDisplay/Product Stylesheet
div .component_ProductDisplay_Product {
padding: 0;
margin: 0;
}
div.component_ProductDisplay_CrossSellHorizontal {
padding: 0;
}
div .product {
margin: 0 20px;
}
#product h1, h2, h3 {
text-transform: uppercase;
font-weight: 500;
margin-bottom: 20px;
font-size: 35px;
}
#product {
display: grid;
grid-template-columns: 540px 1fr;
grid-column-gap: 50px;
margin-top: 40px;
font-size: [site-option global_font_size];
}
#product * {
box-sizing: border-box;
}
#product .image {
position: relative;
}
#product .image-main {
position: relative;
display: inline-block;
border: 1px solid #f4f4f4;
}
#image-slider,
#image-slider .glide__track,
#image-slider .glide__slides,
#image-slider .glide__slide {
width: 540px;
height: 540px;
}
#image-slider .glide__slide {
position: relative;
margin-left: 0;
}
#image-slider figure {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
cursor: zoom-in;
background-repeat: no-repeat;
background-position: 50% 50%;
transition: all 0.2s;
}
/* hide the zoom image */
#image-slider figure::before {
content: '';
position: absolute;
background: #fff;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
#image-slider figure:hover::before {
display: none;
}
#image-slider .glide__slide figure:hover img {
display: none;
}
#image-slider .glide__slide img {
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
[if site-option disable_auto_zoom_images]
max-height: 100%;
max-width: 100%;
[else]
width: 100%;
height: 100%;
object-fit: cover;
object-position: center center;
[/else]
[/if]
}
.image-main .glide__bullets {
display: none;
position: absolute;
z-index: 1001;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
}
.image-main .glide__bullets button {
width: 12px;
height: 12px;
background: rgba(255, 255, 255, 0.8);
border: solid 1px rgba(187, 187, 187, 0.8);
border-radius: 50%;
padding: 0;
margin: 0;
}
.image-main .glide__bullets button.glide__bullet--active {
background-color: rgba(63,63,63,0.8);
border-color: solid 1px rgba(255, 255, 255, 0.8);
}
#product .maximise {
display: block;
width: 44px;
height: 44px;
background: #eee;
border-radius: 22px;
-webkit-border-radius: 22px;
-moz-border-radius: 22px;
text-indent: 100%;
white-space:nowrap;
overflow: hidden;
z-index: 10;
padding: 0;
border: none;
position: absolute;
bottom: 24px;
right: 24px;
}
#product .maximise::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
display: block;
width: 16px;
height: 16px;
background: url(__IMAGE_DIR__basic_theme/ui_sprites.svg) no-repeat 0 -710px;
}
/* Thumbnails */
.image-thumbnails {
position: relative;
width: 540px;
height: 100px;
margin-top: 15px;
}
#thumb-slider {
width: calc(100% - 80px);
margin: 0 40px;
height: 100%;
}
#thumb-slider li {
margin-left: 0;
}
.image-thumbnails button,
#thumb-slider button {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background: none;
border: none;
text-align: center;
}
#thumb-slider .glide__slides,
#thumb-slider .glide__slide,
#thumb-slider .glide__slide button,
#thumb-slider .glide__slide img {
max-height: 100%;
height: 100px;
}
.image-thumbnails .thumb-controls {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
#thumb-slider .thumb-controls button.slide-left,
#thumb-slider .thumb-controls button.slide-right {
position: absolute;
top: 0;
left: -40px;
width: 40px;
background: none;
text-indent: -100vw;
overflow: hidden;
}
#thumb-slider .thumb-controls button.slide-right {
left: unset;
right: -40px;
}
.image-thumbnails button.slide-left::before,
.image-thumbnails button.slide-right::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
display: block;
width: 9px;
height: 14px;
background: url(__IMAGE_DIR__basic_theme/ui_sprites.svg) no-repeat 0 -650px;
}
.image-thumbnails button.slide-right::before {
background-position-y: -680px;
}
/* thumbnails - not sliding */
#thumb-slider:not(.glide) {
width: 100%;
margin: 0;
}
#thumb-slider:not(.glide) ul {
display: block;
width: auto;
white-space: nowrap;
font-size: 0px;
}
#thumb-slider:not(.glide) li {
width: calc(20% - 8px);
display: inline-block;
margin-right: 10px;
}
#thumb-slider:not(.glide) li:last-child {
margin-right: 0;
}
#thumb-slider:not(.glide) .thumb-controls {
display: none;
}
#thumb-slider:not(.glide) .glide__slide img,
#thumb-slider .glide__slide img {
[if site-option disable_auto_zoom_images]
height: auto;
width: auto;
[else]
width: 100%;
height: 100%;
object-fit: cover;
object-position: center center;
[/else]
[/if]
}
#product::after {
content: '';
display: table;
clear: both;
}
#product .crumbs {
position: absolute;
left: calc(100% + 50px);
display: inline-block;
white-space: nowrap;
font-size: 0.85em;
margin: 0;
}
#product .summary h1 {
margin: 35px 0 20px;
text-transform: none;
}
#product .price, #product .description {
margin: 0 0 25px;
}
.price mark {
display: inline-block;
font-size: 24px;
font-weight: 500;
color: [site-option link_color];
}
.price mark#flat {
margin-right: 3px;
text-decoration: line-through;
font-weight: normal;
color: #ccc;
}
.order {
display: grid;
grid-template-columns: minmax(min-content, max-content) minmax(min-content, max-content);
grid-column-gap: 20px;
grid-row-gap: 15px;
align-items: center;
}
.order > * {
margin: 0;
}
.order .select-wrap {
display: inline-block;
max-width: 100%;
}
.order div input,
.order div select {
width: 100%;
margin: 0;
}
.order input.qty {
width: 60px;
}
.order .submission {
grid-column: 1 / span 2;
padding-top: 5px;
}
.submission button#add-cart {
border-bottom: solid 4px rgba(0, 0, 0, 0.2);
padding-bottom: 12px;
}
#product .order .add-favourite {
display: inline-block;
margin-left: 15px;
}
#product .order .add-favourite .remove,
#product .order .add-favourite.selected .add {
display: none;
}
#product .order .add-favourite.selected .remove,
#product .order .add-favourite .add {
display: inline-block;
}
.additional {
margin: 35px 0 0;
padding: 0;
}
.additional p {
margin: 0 0 10px;
}
.additional label {
display: inline-block;
font-weight: bold;
white-space: nowrap;
margin: 0 5px 0 0;
vertical-align: middle;
}
.additional label::after {
content: ':';
display: inline-block;
}
.social a {
display: inline-block;
vertical-align: middle;
background-image: url(__IMAGE_DIR__basic_theme/ui_sprites.svg);
background-repeat: no-repeat;
background-position-x: 0;
background-color: transparent;
margin-right: 13px;
}
.social .facebook {
background-position-y: -890px;
width: 7px;
height: 13px;
}
.social .twitter {
background-position-y: -920px;
width: 13px;
height: 10px;
}
.social .google-plus {
background-position-y: -950px;
width: 19px;
height: 12px;
}
.social .email {
background-position-y: -980px;
width: 15px;
height: 11px;
}
.social .pinterest {
background-position-y: -1010px;
width: 12px;
height: 12px;
}
.full-description {
margin-top: 30px;
margin-bottom: 30px;
}
.full-description h2:not(:first-child) {
font-size: 1.9em;
text-transform: initial;
}
.full-description h3 {
font-size: 1.7em;
text-transform: initial;
}
/* badges */
.feature {
position: absolute;
top: 20px;
right: 20px;
display: inline-block;
background: #3cc5f1;
color: #fff;
text-transform: uppercase;
font-size: 14px;
font-weight: bold;
z-index: 10;
line-height: 50px;
width: 50px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
text-align: center;
padding: 0;
}
.feature.long {
top: 10px;
right: 10px;
width: auto;
max-width: calc(100% - 64px);
line-height: 40px;
padding: 0 17px;
margin: 7px;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
}
.feature.feature-2 {
background: #bf211e;
}
.feature.feature-3 {
background: #9bc53d;
}
[comment] cross sell styling [/comment]
body div .component_ProductDisplay_CrossSellHorizontal {
position: relative;
left: -50vw;
margin-left: 50%;
width: 100vw;
background: #eee;
margin-right: 0;
padding-top: 30px !important;
padding-bottom: 30px !important;
}
.cross-sell > h3,
.cross-sell .catview {
margin-left: 20px;
margin-right: 20px;
}
.cross-sell h3 {
text-transform: capitalize;
font-weight: 500;
}
[comment] large image popup [/comment]
div .large-image {
position: fixed;
z-index: 2001;
width: 90vw;
height: 90vh;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
display: none;
}
#large-slider,
#large-slider .glide__track,
#large-slider .glide__slides,
#large-slider .glide__slide {
width: 90vw;
height: 90vh;
}
#large-slider .glide__slide {
position: relative;
}
#large-slider .glide__slide img {
max-width: 100%;
max-height: 100%;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
}
.large-image .large-controls {
position: absolute;
left: -50vw;
margin-left: 50%;
width: 100vw;
height: 100%;
}
.large-image.disabled .large-controls {
display: none;
}
body.pop-overlay-center.large-image .pop-overlay::before,
body.pop-overlay-center.large-image .pop-overlay-inner .close {
display: none;
}
body.pop-overlay-center.large-image #large-image .close {
background: none;
padding: 0;
margin: 0;
text-indent: -100vw;
overflow: hidden;
width: 24px;
height: 24px;
position: fixed;
top: 30px;
right: 30px;
}
body.pop-overlay-center.large-image #large-image .close::before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
display: block;
width: 12px;
height: 12px;
background: url(__IMAGE_DIR__basic_theme/ui_sprites.svg) no-repeat 0 -560px;
transform: scale(2);
cursor: pointer;
}
div .large-image button.next,
div .large-image button.previous {
background: url(__IMAGE_DIR__basic_theme/ui_sprites.svg) no-repeat 5px -680px;
width: 19px;
height: 14px;
padding: 0;
text-indent: -100vh;
overflow: hidden;
transform: scale(3);
position: absolute;
top: 0;
bottom: 0;
right: 30px;
margin: auto;
z-index: 2002;
}
div .large-image button.previous {
background-position-y: -650px;
left: 30px;
right: unset;
}
div .large-image .loading-spinner {
border-color: #ccc;
border-top-color: #fff;
width: 100px;
height: 100px;
border-width: 3px;
display: block;
}
body.pop-overlay-center.large-image .pop-overlay {
background: #fff;
opacity: 1;
}
body.pop-overlay-center.large-image .pop-overlay-inner {
width: 0;
}
body.large-image .large-image {
display: block;
}
#product .notification {
font-weight: normal;
margin-left: 15px;
}
[comment] override pasted styles in RTEs [/comment]
[if !site-option allow_custom_richtext_styles]
/* force font sizes in descriptions to prevent mitigate RTE content */
.product .full-description p,
.product .full-description span,
.product .full-description div,
.product .full-description li,
.product .full-description td,
.product .additional-description p,
.product .additional-description span,
.product .additional-description div,
.product .additional-description li,
.product .additional-description td {
line-height: inherit !important;
/* font: [site-option global_font_size] [site-option body_font] !important; */
font-family: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
margin: initial !important;
background: inherit !important;
vertical-align: inherit !important;
white-space: inherit !important;
color: inherit !important;
}
.product .full-description p {
margin: 1em 0 !important;
}
[/if]
@media screen and (max-width: 1300px) {
body .content .component_ProductDisplay_CrossSellHorizontal {
left: unset;
margin-left: unset;
width: 100%;
}
body .content .component_ProductDisplay_CrossSellHorizontal .cross-sell {
width: 100%;
max-width: 100%;
box-sizing: border-box;
padding: 0 20px;
}
body .content .component_ProductDisplay_CrossSellHorizontal .cross-sell > * {
margin-left: 0;
margin-right: 0;
}
}
@media only screen and (max-width: 1000px) {
#product {
grid-template-columns: 400px 1fr;
}
#image-slider,
#image-slider .glide__track,
#image-slider .glide__slides,
#image-slider .glide__slide {
width: 400px;
height: 400px;
}
#image-slider .glide__slide img {
max-height: 400px;
max-width: 400px;
}
.image-thumbnails {
width: 400px;
height: 75px;
}
#thumb-slider .glide__slides,
#thumb-slider .glide__slide,
#thumb-slider .glide__slide button,
#thumb-slider .glide__slide img {
height: 75px;
}
}
@media only screen and (max-width: 720px) {
#product {
display: block;
margin-top: 0;
}
#product .crumbs {
display: none;
}
.image-main .glide__bullets {
display: inline-block;
}
.image-thumbnails {
display: none;
}
#product .image {
width: 100%;
}
#product .image-main {
margin-left: -20px;
width: 100vw;
}
#image-slider,
#image-slider .glide__track,
#image-slider .glide__slides,
#image-slider .glide__slide {
width: 100vw;
height: 100vw;
max-height: 70vh;
}
#image-slider .glide__slide img {
max-height: 100%;
max-width: 100%;
}
div .large-image,
#large-slider,
#large-slider .glide__track,
#large-slider .glide__slides,
#large-slider .glide__slide {
width: 100vw;
height: 100vh;
}
[if !site-option disable_auto_zoom_images]
#large-slider .glide__slide img {
width: 100% !important;
height: 100% !important;
object-fit: cover;
object-position: center center;
}
[/if]
body.pop-overlay-center.large-image #large-image .close {
z-index: 2020;
border-radius: 50%;
background: #fff;
width: 40px;
height: 40px;
}
body.pop-overlay-center.large-image #large-image .close::before {
transform: unset;
}
}
.hide {
display: none;
}
section#price mark#enquiry_only_label {
font-size: 18px;
font-weight: 300;
}
/*For comment tabs*/
/* Style tab links */
nav#description-tabs {
display: flex;
cursor: pointer;
height: 66px;
margin-top: 10px;
margin-bottom: 36px;
border-top: 1px solid #eee;
}
.tabcontent {
color: inherit;
display: none;
height: 100%;
}
.tabcontent.active {
display: block;
}
nav#description-tabs a.tablink:hover, nav#description-tabs a.tablink.active {
border-top: 3px solid;
font-weight: 500;
color: black;
}
nav#description-tabs a.tablink {
display:flex;
align-items:center;
justify-content:center;
margin-right: 30px;
height: 100%;
font-size: 20px;
font-weight: 500;
text-transform: uppercase;
color: #555;
border-top: 3px solid transparent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment