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

777 lines
12 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;
}
&: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;
}
}
}
&.list {
.product-preview {
overflow: hidden;
}
img {
float: left;
width: 50%;
margin-right: 2em;
margin-bottom: 2em;
}
}
.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;
}
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
}
.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 */
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;
}
}
}
2018-03-14 15:11:36 +00:00
&--current {
cursor: default;
2018-03-14 15:11:36 +00:00
.wc-products-display-options__option-title {
color: $color__option-description;
}
}
2018-02-23 14:57:27 +00:00
}
.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);
2018-03-02 00:24:45 +00:00
margin-top: -2.15em;
2018-02-23 14:57:27 +00:00
.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 {
margin: 0 0 2em 0;
2018-02-23 14:57:27 +00:00
padding: 1em 2em;
text-align: center;
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 {
2018-02-27 11:56:18 +00:00
position: relative;
margin-left: auto;
margin-right: auto;
2018-02-27 14:28:48 +00:00
padding: 0 1em;
overflow: hidden;
box-sizing: border-box;
2018-04-06 22:57:20 +00:00
.wc-products-list-card__input-wrapper {
position: relative;
background: #ffffff;
margin: 0 0 1em;
.dashicon {
position: absolute;
top: calc( 1em - 1px );
left: 1em;
z-index: 1;
}
}
.wc-products-list-card__search {
2018-04-06 22:57:20 +00:00
position: relative;
width: 100%;
2018-04-06 22:57:20 +00:00
margin: 0;
padding: 1em 1.25em 1em 3em;
border-radius: 0;
2018-04-06 22:57:20 +00:00
background: transparent;
border-color: $color__border;
2018-04-06 22:57:20 +00:00
box-shadow: none;
z-index: 2;
}
.wc-products-list-card__results {
max-height: 200px;
overflow-y: auto;
2018-04-06 22:57:20 +00:00
overflow-x: hidden;
box-sizing: border-box;
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% );
}
2018-02-23 14:57:27 +00:00
}
/**
* 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;
}
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 {
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 {
2018-02-27 11:56:18 +00:00
overflow: visible;
2018-04-06 22:57:20 +00:00
&:after {
content: none;
2018-02-26 22:52:12 +00:00
}
.wc-products-list-card__item {
2018-04-06 22:57:20 +00:00
position: relative;
border: none;
2018-02-26 22:52:12 +00:00
img {
2018-04-06 22:57:20 +00:00
margin: 0;
outline: 4px solid $color__link--hover;
outline-offset: -4px;
2018-02-26 22:52:12 +00:00
}
button {
2018-04-06 22:57:20 +00:00
position: absolute;
top: 0;
right: 0;
2018-04-10 14:01:31 +00:00
background: $color__link--hover;
2018-02-26 22:52:12 +00:00
padding: 0;
margin: 0;
border: none;
margin-left: auto;
line-height: 10px;
cursor: pointer;
}
.dashicon {
2018-04-06 22:57:20 +00:00
color: #ffffff;
}
}
.wc-products-list-card__input-wrapper {
margin: 0;
}
.wc-products-list-card__results-wrapper {
@for $i from 1 through 6 {
$width: percentage( 1 / $i );
&--cols-#{$i} {
.wc-products-list-card__item {
width: $width;
}
}
}
}
.wc-products-list-card__results {
max-height: none;
2018-04-10 13:44:12 +00:00
overflow: visible;
2018-04-06 22:57:20 +00:00
h3 {
margin: 0 0 1em;
font-size: 1em;
}
ul {
display: flex;
flex-wrap: wrap;
margin: 0 -.5em -1em;
li {
border: none;
padding: 0 .5em;
margin: 0 0 1em;
}
}
.wc-products-list-card__content {
position: relative;
display: block;
padding: 0;
background: transparent;
border: none;
2018-02-26 22:52:12 +00:00
}
}
}
2018-02-27 11:56:18 +00:00
.wc-products-list-card__search-wrapper {
position: relative;
margin: 0 0 1.5em;
2018-02-27 11:56:18 +00:00
}
2018-02-26 22:52:12 +00:00
.wc-products-list-card__search-results {
2018-02-27 11:56:18 +00:00
width: 100%;
list-style: none;
background: #ffffff;
2018-04-06 22:57:20 +00:00
margin: -1px 0 0;
border: 1px solid $color__border;
2018-04-09 13:32:54 +00:00
box-shadow: 0 1px 3px $color__border;
2018-02-26 22:52:12 +00:00
> div {
2018-04-06 22:57:20 +00:00
max-height: 175px;
overflow-y: auto;
}
2018-02-26 22:52:12 +00:00
.wc-products-list-card__content {
2018-04-06 22:57:20 +00:00
position: relative;
border-width: 1px 0 0;
2018-02-26 22:52:12 +00:00
border-style: solid;
border-color: $color__border;
transition: opacity .7s;
cursor: pointer;
2018-04-09 13:32:54 +00:00
color: $color__link--hover;
2018-04-06 22:57:20 +00:00
&--added {
background-color: lighten( $color__link, 65% );
2018-04-09 13:32:54 +00:00
}
&:hover {
background-color: lighten( $color__link, 65% );
2018-04-06 22:57:20 +00:00
}
&--transition-exit-active {
opacity: 0;
}
2018-02-26 22:52:12 +00:00
2018-04-06 22:57:20 +00:00
&:first-child {
border-top-width: 0;
2018-02-26 22:52:12 +00:00
}
img {
max-width: 2.5em;
margin: 0 1em 0 0;
}
.dashicon {
color: $color__link;
2018-02-26 22:52:12 +00:00
margin-left: auto;
}
}
2018-02-27 11:56:18 +00:00
}
.wc-products-list-card__search-wrapper--with-results +
.wc-products-list-card__results-wrapper {
.wc-products-list-card__item {
img {
outline: none;
}
button {
display: none;
}
}
}
2018-04-06 22:57:20 +00:00
.wc-products-list-card__search-no-results {
display: block;
margin: 1em 0 0;
}
.wc-products-list-card__search-no-selected {
display: block;
margin: -.75em 0 0;
}
2018-02-27 11:56:18 +00:00
.wc-products-list-card__results-wrapper {
position: relative;
overflow: hidden;
2018-02-27 14:28:48 +00:00
}
@media only screen and (min-width: 700px) {
.wc-products-settings-heading {
display: flex;
justify-content: space-between;
2018-02-27 14:28:48 +00:00
}
.wc-products-list-card {
max-width: 480px;
2018-02-27 14:28:48 +00:00
}
}