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

592 lines
9.1 KiB
SCSS
Raw Normal View History

2018-02-26 22:52:12 +00:00
$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.
*/
2018-02-26 22:52:12 +00:00
.wc-products-block-preview {
&.grid {
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;
}
}
&.cols-3 .product-preview {
width: 30.75%;
&:nth-of-type(3n) {
margin-right: 0;
}
}
&.cols-4 .product-preview {
width: 22.05%;
&:nth-of-type(4n) {
margin-right: 0;
}
}
&.cols-5 .product-preview {
width: 16.9%;
&:nth-of-type(5n) {
margin-right: 0;
}
}
}
&.list {
.product-preview {
overflow: hidden;
}
img {
float: left;
width: 50%;
margin-right: 2em;
margin-bottom: 2em;
}
}
.product-add-to-cart {
background: gray;
border-radius: 10px;
color: white;
cursor: pointer;
padding: .5em 1em;
line-height: 3em;
}
}
/**
* General styling
*/
.wc-products-settings {
background-color: #f8f9f9;
font-family: $font__sans-serif;
font-size: 13px;
min-height: 200px;
position: relative;
}
2018-02-23 14:57:27 +00:00
/* 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;
2018-02-23 14:57:27 +00:00
text-align: center;
.button {
padding-left: 1.5em;
padding-right: 1.5em;
}
2018-02-23 14:57:27 +00:00
}
/**
* Menu
*/
/* Select an option description */
2018-02-23 14:57:27 +00:00
p.wc-products-block-description {
margin: 2em 0 1.5em 0;
2018-02-23 14:57:27 +00:00
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;
2018-02-23 14:57:27 +00:00
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;
}
}
}
}
.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: -36px;
.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
*/
2018-02-23 14:57:27 +00:00
.wc-products-settings-heading {
display: flex;
justify-content: space-between;
margin: 0 0 35px 0;
2018-02-23 14:57:27 +00:00
padding: 1em 2em;
border-bottom: 1px solid $color__border;
2018-02-23 14:57:27 +00:00
}
/**
* List Card
*/
2018-02-23 14:57:27 +00:00
.wc-products-list-card {
width: 480px;
margin-left: auto;
margin-right: auto;
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 {
width: 600px;
max-height: 200px;
overflow-y: scroll;
box-sizing: border-box;
padding: 0 0 1em;
> ul {
width: 480px;
}
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;
bottom: 0;
width: 100%;
height: 1.5em;
background: linear-gradient( rgba( 255, 255, 255, .1 ) 0, #f8f9f9 100% );
}
2018-02-23 14:57:27 +00:00
}
/**
* Categories / Attributes
*/
.wc-products-list-card--taxonomy {
.wc-products-list-card__taxonomy-count {
padding: 0 1em;
border: 1px solid #e9e9e9;
border-radius: 1em;
color: #aaa;
font-size: .8em;
}
2018-02-23 14:57:27 +00:00
input[type="checkbox"] {
position: relative;
margin-top: 0;
margin-right: .75em;
border-radius: 0;
}
2018-02-23 14:57:27 +00:00
}
/**
* 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;
}
}
2018-02-23 14:57:27 +00:00
input[type="checkbox"] {
&:indeterminate {
&:before {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
content: '';
margin: 42% 20%;
width: 60%;
background: $color__link;
}
}
}
2018-02-23 14:57:27 +00:00
}
/**
* Attributes
*/
2018-02-23 14:57:27 +00:00
.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 {
width: 480px;
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%;
}
2018-02-26 22:52:12 +00:00
}
/**
* Specific
*/
.wc-products-list-card--specific {
.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-results {
> div {
position: absolute;
width: 480px;
z-index: 999;
list-style: none;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
}
.wc-products-list-card__content {
border-width: 1px 1px 0;
border-style: solid;
border-color: $color__border;
&:last-child {
border-bottom-width: 1px;
}
img {
max-width: 2.5em;
margin: 0 1em 0 0;
}
button {
margin-left: auto;
}
}
}