woocommerce/plugins/woocommerce-blocks/assets/css/gutenberg-products-block.scss

659 lines
10 KiB
SCSS

$font__sans-serif: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
$color__link: #0073aa;
$color__link--hover: #00a0d2;
$color__border: #e6eaee;
$color__option-description: #86909b;
$color__option-icon: #b9bcc2;
$color__alt-background: #fdfdfd;
/**
* Products block preview mode.
*/
.wc-products-block-preview {
overflow: hidden;
.product-preview {
float: left;
text-align: center;
margin-right: 3.8%;
}
&.cols-1 .product-preview {
float: none;
margin-right: 0;
}
&.cols-2 .product-preview {
width: 48%;
&:nth-of-type(2n) {
margin-right: 0;
}
&:nth-of-type(2n+1) {
clear: both;
}
}
&.cols-3 .product-preview {
width: 30.75%;
&:nth-of-type(3n) {
margin-right: 0;
}
&:nth-of-type(3n+1) {
clear: both;
}
}
&.cols-4 .product-preview {
width: 22.05%;
&:nth-of-type(4n) {
margin-right: 0;
}
&:nth-of-type(4n+1) {
clear: both;
}
}
&.cols-5 .product-preview {
width: 16.9%;
&:nth-of-type(5n) {
margin-right: 0;
}
&:nth-of-type(5n+1) {
clear: both;
}
.product-add-to-cart {
font-size: .75em;
}
}
&.cols-6 .product-preview {
width: 13.5%;
&:nth-of-type(6n) {
margin-right: 0;
}
&:nth-of-type(6n+1) {
clear: both;
}
.product-add-to-cart {
font-size: .75em;
}
}
.product-add-to-cart {
display: inline-block;
background: #ababab;
border-radius: 1.5em;
color: #ffffff;
cursor: pointer;
padding: .75em 1.25em;
line-height: 1.2em;
margin-top: .5em;
margin-bottom: 1em;
}
}
/**
* General styling
*/
.wc-products-settings {
background-color: #f8f9f9;
font-family: $font__sans-serif;
font-size: 13px;
position: relative;
}
/* Block title */
.wc-products-settings__title {
margin: 0;
padding: 1.5rem 0;
text-align: center;
border-bottom: 1px solid $color__border;
.dashicon {
vertical-align: top;
margin-right: .25em;
}
}
/* Block footer */
.wc-products-settings__footer {
margin: 2em 0 0;
padding: 1.5em 0;
border-top: 1px solid $color__border;
text-align: center;
.button {
padding-left: 1.5em;
padding-right: 1.5em;
}
}
.wc-products-settings-heading +
.wc-products-settings__footer,
.wc-products-display-options--popover +
.wc-products-settings__footer {
margin-top: -2em;
border-top: none;
}
/**
* Menu
*/
/* Select an option description */
p.wc-products-block-description {
margin: 2em 0 1.5em 0;
font-family: $font__sans-serif;
font-size: 1em;
text-align: center;
}
/* Select option */
.wc-products-display-options {
margin: 0 0 2.5em;
}
.wc-products-display-options__option {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
margin: 0 auto;
padding: 1.25em 1.5em;
max-width: 80%;
background: #fff;
border-width: 1px 1px 0;
border-style: solid;
border-color: $color__border;
cursor: pointer;
&:last-of-type {
border-bottom-width: 1px;
}
&--featured,
&--best_sellers,
&--best_rated,
&--on_sale,
&--attribute {
display: none;
background-color: $color__alt-background;
padding-top: 1em;
padding-bottom: 1em;
.wc-products-display-options__option-title {
font-size: 1.15em;
}
.wc-products-display-options__icon {
.dashicon {
height: 20px;
width: 20px;
}
}
}
&--current {
cursor: default;
.wc-products-display-options__option-title {
color: $color__option-description;
}
}
}
.wc-products-display-options__option-content {
width: 85%;
align-self: center;
}
.wc-products-display-options__option-title {
display: block;
font-size: 1.25em;
}
p.wc-products-display-options__option-description {
margin: 0;
font-family: $font__sans-serif;
font-size: 1em;
color: $color__option-description;
}
.wc-products-display-options__icon {
align-self: center;
margin-left: auto;
color: $color__option-icon;
.dashicon {
height: 25px;
width: 25px;
}
}
/* Select options popover */
.wc-products-display-options--popover {
position: absolute;
right: -2em;
max-width: 60%;
margin: 0;
z-index: 999;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
margin-top: -2.15em;
.wc-products-display-options__option {
margin: 0;
max-width: none;
}
}
.wc-products-display-options--popover__arrow {
width: 2em;
height: 1.25em;
position: absolute;
top: -1.15em;
right: 30%;
overflow: hidden;
&:after {
content: '';
position: absolute;
width: 1.25em;
height: 1.25em;
background: #fff;
transform: rotate(45deg);
top: .625em;
left: .3125em;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
border: 1px solid $color__border;
}
}
/* Select options extended */
.wc-products-display-options--extended {
.wc-products-display-options__option {
&--featured,
&--best_sellers,
&--best_rated,
&--on_sale,
&--attribute {
display: flex;
}
}
&:not(.wc-products-display-options--popover) {
.wc-products-display-options__option {
&--category {
border-bottom-width: 1px;
}
&--filter {
margin-top: .5em;
}
&--attribute {
margin-bottom: .5em;
border-bottom-width: 1px;
}
}
}
}
/**
* Settings heading
*/
.wc-products-settings-heading {
margin: 0 0 2em 0;
padding: 1em 2em;
text-align: center;
border-bottom: 1px solid $color__border;
}
/**
* List Card
*/
.wc-products-list-card {
position: relative;
margin-left: auto;
margin-right: auto;
padding: 0 1em;
overflow: hidden;
box-sizing: border-box;
.wc-products-list-card__search {
width: 100%;
margin: 0 0 1em;
padding: .75em 1.25em;
border-radius: 0;
border-color: $color__border;
}
.wc-products-list-card__results {
max-height: 200px;
overflow-y: auto;
box-sizing: border-box;
padding: 0 0 1em;
ul {
list-style: none;
li {
margin: 0;
border: 1px solid $color__border;
border-bottom-width: 0;
&:last-child {
border-bottom-width: 1px;
}
}
}
}
.wc-products-list-card__content {
display: flex;
align-items: center;
flex-direction: row;
padding: .75em 1.25em;
background: #fff;
border-bottom: 1px solid $color__border;
}
&:after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 1.5em;
background: linear-gradient( rgba( 255, 255, 255, .1 ) 0, #f8f9f9 100% );
}
}
/**
* Categories / Attributes
*/
.wc-products-list-card--taxonomy {
.wc-products-list-card__taxonomy-count {
text-align: center;
width: 30px;
font-size: .8em;
border: 1px solid #e9e9e9;
border-radius: 1em;
color: #aaa;
}
input[type="checkbox"] {
position: relative;
margin-top: 0;
margin-right: .75em;
border-radius: 0;
}
}
/**
* Categories
*/
.wc-products-list-card--taxonomy-category {
.wc-products-list-card__results {
ul {
li {
margin-top: -1px;
&:first-child {
margin-top: 0;
}
&:last-child {
border-bottom-width: 0;
}
ul {
display: none;
padding: 1em 1.25em 1em 3.25em;
background: $color__alt-background;
border-bottom: 1px solid $color__border;
li {
margin-bottom: .25em;
border: none;
&:last-child {
margin-bottom: 0;
}
}
}
&.wc-products-list-card__accordion-open {
margin: .5em 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
ul {
display: block;
li {
label {
display: flex;
align-items: center;
flex-direction: row;
}
.wc-products-list-card__taxonomy-count {
margin-left: auto;
}
}
}
}
}
}
}
.wc-products-list-card__accordion-button {
cursor: pointer;
color: #666;
margin: 0 1em 0 auto;
padding: 0 0 0 .75em;
border: none;
border-radius: 0;
background: none;
outline: none;
text-decoration: none;
.dashicon {
align-self: center;
display: flex;
}
}
input[type="checkbox"] {
&:indeterminate {
&:before {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
content: '';
margin: 42% 20%;
width: 60%;
background: $color__link;
}
}
}
}
/**
* Attributes
*/
.wc-products-list-card--taxonomy-atributes {
.wc-products-list-card__results {
ul {
padding: 1em 1.25em 1em 3.25em;
background: $color__alt-background;
border-bottom: 1px solid $color__border;
li {
margin-bottom: .25em;
border: none;
.wc-products-list-card__content {
padding: 0;
background: transparent;
border: none;
}
}
}
}
&__atribute {
margin: -1px 0 0;
border-width: 1px 1px 0;
border-style: solid;
border-color: $color__border;
&:first-child {
margin-top: 0;
}
&.wc-products-list-card__accordion-open {
margin-top: .5em;
margin-bottom: .5em;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
}
.wc-products-list-card__taxonomy-count {
margin-left: auto;
}
input[type="radio"] {
position: relative;
margin-top: 0;
margin-right: .75em;
border-radius: 100%;
}
}
/**
* Specific
*/
.wc-products-list-card--specific {
overflow: visible;
.wc-products-list-card__content {
padding: .75em;
border-bottom-width: 0;
}
.wc-products-list-card__item {
img {
max-width: 2.5em;
margin: 0 1em 0 0;
}
button {
background: #f1f1f1;
border-radius: 100%;
padding: 0;
margin: 0;
border: none;
margin-left: auto;
line-height: 10px;
cursor: pointer;
}
.dashicon {
color: #555D66;
}
}
}
.wc-products-list-card__search-wrapper {
position: relative;
}
.wc-products-list-card__search-results {
position: absolute;
top: calc(100% - 1em - 1px);
width: 100%;
z-index: 999;
list-style: none;
background: #ffffff;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
> div {
max-height: 200px;
overflow-y: auto;
}
.wc-products-list-card__content {
border-width: 1px 0 0;
border-style: solid;
border-color: $color__border;
transition: opacity .7s;
&--transition-exit-active {
opacity: 0;
}
&:last-child {
border-bottom-width: 1px;
}
img {
max-width: 2.5em;
margin: 0 1em 0 0;
}
button {
margin-left: auto;
}
}
}
.wc-products-list-card__results-wrapper {
position: relative;
overflow: hidden;
}
@media only screen and (min-width: 700px) {
.wc-products-settings-heading {
display: flex;
justify-content: space-between;
}
.wc-products-list-card {
max-width: 480px;
}
}