woocommerce/plugins/woocommerce-blocks/assets/css/editor.scss

134 lines
2.2 KiB
SCSS
Raw Normal View History

// Import the woocommerce components stylesheet
@import "~@woocommerce/components/build-style/style.css";
// Hack to hide preview overflow.
.editor-block-preview__content {
overflow: hidden;
}
// Align the block icons in edit mode
.components-placeholder__label .gridicon,
.components-placeholder__label .material-icon {
margin-right: 1ch;
fill: currentColor;
}
Dynamic grid blocks: Try using ServerSideRender component for preview (https://github.com/woocommerce/woocommerce-blocks/pull/565) * Add grid block base class to handle rendering all grid blocks Using code from the shortcode handler to create the query, subclass into newest product to show use * Update preview content to match rendering from the new grid block handler * Fix the categories query builder * Update order of rating/price * Remove center alignment * Extract rating & button into separate functions * Wrap the content in a link * Add the current class names for better theme support * Fix some styling in editor preview & frontend * Add back the deprecated cols support for existing blocks * Add multiple-rows class, style tweaks * Switch Newest Products to dynamic rendering, deprecate existing shortcode method * Add “On Sale” flag * Switch “On Sale Products” to dynamic rendering * Fix reusable block preview * Add correct classes to On Sale Products * Remove dynamic blocks from CSS hidden content rules Content is not output to browser now, so we don’t need to hide it * Fix undefined parameters * Fix attributes for on sale * Add deprecation comment, use more descriptive function name * Addressing review feedback * Update test: classnames have changed, image now wrapped in div * Disable HTML editing for dynamic blocks * Moved rendering logic into block library * Try using ServerSideRender component for preview * Define the schema for contentVisibility This ensures the API correctly uses boolean instead of “true”/“false” strings * Move the star rating CSS to the general grid-blocks section * Remove the list styling, which is added back by core GB styles * Fix stylelint issues
2019-05-21 20:34:48 +00:00
// Remove the list styling, which is added back by core GB styles.
.editor-styles-wrapper .wc-block-grid {
list-style: none;
margin-left: 0;
}
.wc-block-products-grid,
.wc-block-grid {
overflow: hidden;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
&.components-placeholder {
padding: 2em 1em;
}
&.is-loading,
&.is-not-found {
display: block;
}
// Styles for "resuable block" preview.
.editor-block-preview & {
min-width: 5em;
@for $i from 1 to 7 {
&.cols-#{$i},
&.has-#{$i}-columns {
min-width: $i * 5em;
}
}
&.is-loading,
&.is-not-found {
min-width: auto;
}
}
Dynamic grid blocks: Try using ServerSideRender component for preview (https://github.com/woocommerce/woocommerce-blocks/pull/565) * Add grid block base class to handle rendering all grid blocks Using code from the shortcode handler to create the query, subclass into newest product to show use * Update preview content to match rendering from the new grid block handler * Fix the categories query builder * Update order of rating/price * Remove center alignment * Extract rating & button into separate functions * Wrap the content in a link * Add the current class names for better theme support * Fix some styling in editor preview & frontend * Add back the deprecated cols support for existing blocks * Add multiple-rows class, style tweaks * Switch Newest Products to dynamic rendering, deprecate existing shortcode method * Add “On Sale” flag * Switch “On Sale Products” to dynamic rendering * Fix reusable block preview * Add correct classes to On Sale Products * Remove dynamic blocks from CSS hidden content rules Content is not output to browser now, so we don’t need to hide it * Fix undefined parameters * Fix attributes for on sale * Add deprecation comment, use more descriptive function name * Addressing review feedback * Update test: classnames have changed, image now wrapped in div * Disable HTML editing for dynamic blocks * Moved rendering logic into block library * Try using ServerSideRender component for preview * Define the schema for contentVisibility This ensures the API correctly uses boolean instead of “true”/“false” strings * Move the star rating CSS to the general grid-blocks section * Remove the list styling, which is added back by core GB styles * Fix stylelint issues
2019-05-21 20:34:48 +00:00
.star-rating {
overflow: hidden;
position: relative;
width: 5.3em;
height: 1.618em;
line-height: 1.618;
font-size: 1em;
font-family: star; /* stylelint-disable-line */
font-weight: 400;
&::before {
content: "\53\53\53\53\53";
top: 0;
left: 0;
right: 0;
position: absolute;
opacity: 0.25;
}
span {
overflow: hidden;
top: 0;
left: 0;
right: 0;
position: absolute;
padding-top: 1.5em;
}
span::before {
content: "\53\53\53\53\53";
top: 0;
left: 0;
right: 0;
position: absolute;
}
}
}
// @todo Remove this once all grid blocks are switched to dynamic.
.wc-block-products-grid {
display: flex;
flex-wrap: wrap;
&.cols-1 {
display: block;
.wc-block-grid__product {
margin-left: auto;
margin-right: auto;
}
}
@for $i from 2 to 9 {
&.cols-#{$i} .wc-block-grid__product {
flex: 1 0 calc(#{ 100% / $i });
max-width: 100% / $i !important;
}
}
&.cols-4:not(.alignwide):not(.alignfull),
&.cols-5:not(.alignfull),
&.cols-6:not(.alignfull),
&.cols-7,
&.cols-8 {
.wc-block-grid__product-title {
font-size: 0.9em;
}
.wc-block-grid__product-price {
font-size: 0.8em;
}
.wc-block-grid__product-add-to-cart {
font-size: 0.8em !important;
line-height: 1.4 !important;
}
}
}