woocommerce/plugins/woocommerce-blocks/assets/js/blocks/product-query/style.scss

33 lines
898 B
SCSS
Raw Normal View History

.color-block-support-panel {
.wc-block-feedback-prompt {
grid-column: 1 / -1;
}
}
Improve Products block Attributes Filter Inspector Controls (https://github.com/woocommerce/woocommerce-blocks/pull/8583) This PR is meant to improve the UI and UX behind the Attributes filter within the Inspector Controls of the “Products (Beta)“ block. Also included: * Refactor `useProductAttributes` hook * Move it into the shared hooks. * Fetch both terms AND attributes via the API (previously, we got the attributes from the settings, but we'd get partial objects compared to the API? Maybe a follow-up to this could be to check why the attributes stored in the settings are incomplete?) * Make sure the return values match the ones expected from search items. * Remove attribute-related types from PQ directory * Improve functionality of `SearchListControl` * Allow the search input to be a Token based input. * Allow for search input to search even collapsed properties. * Use core `CheckboxControl` instead of radio buttons for items having children (includes undeterminated state). * Enable removal of tokens from the input * Improve styles: * Refactor classnames for `SearchItem`. * Add more semantic classes. * Align count label and caret to the right. * Make caret switch direction on expanded. * `cursor: pointer` on collapsible items. * Indent children of collapsible items. * Correctly pass through class names to search item * Enable keyboard navigation for collapsible items * Add link to manage attributes * Change label inside the inspector controls * Make search list attached when token type * Implement more sophisticated behavior of parent checkbox * If indeterminate or unchecked, it will check all children. * If checked, it will uncheck all children. * Remove hardcoded `isSingle` from `expandableSearchListItem`
2023-03-08 16:22:51 +00:00
.woocommerce-product-query-panel__external-link {
display: block;
margin-top: $gap-small;
.components-external-link__icon {
margin-left: $gap-smaller;
}
}
Products block: Using nested selector to add margin between Product elements (https://github.com/woocommerce/woocommerce-blocks/pull/8993) * Using nested selector to style Product elements in Products Block This commit simplifies the INNER_BLOCKS_TEMPLATE array in the product-query constants.ts file by removing the style properties from the individual elements. Instead, the default styles are now managed in the style.scss file, providing a more consistent and centralized approach to styling. In the style.scss file, a new section for default styling has been added to handle product elements inside the Products Block, adhering to the Gutenberg styling hierarchy. This ensures the lowest precedence in the hierarchy, allowing for easier overrides when needed. * Decrease specificity of styles for product elements in Products Block The commit changes the default styles for product elements inside the 'Products Block'. It changes the way the margin-bottom and margin-top properties are set by using the :where() selector instead of using the .products-block-post-template class selector. This is done to decrease the specificity of the CSS selector, ensuring that the styles have the lowest precedence in the hierarchy. It also removes the display: inline-block property from the a selector, and moves the styles to the .editor-styles-wrapper class selector. * Decrease specificity of CSS selectors In these changes, the product elements inside the Products Block have been restyled. The specificity of the CSS selector has been decreased using the :where() selector, to ensure that these styles have the lowest precedence in the hierarchy. In constants.ts, a new class name, products-block-post-template, has been added to the inner block template for the post. This class is used to add default styles for inner blocks. In style.scss, the CSS selector for the inner blocks has been updated to include the new class name. The :where() selector has also been used to ensure that these styles have the lowest precedence in the hierarchy. * Update default margins and remove redundant entries This commit updates the default margin values for the Product Title in the Products block, moving them from the style.scss file to the constants.ts file. It also removes unnecessary empty arrays in the INNER_BLOCKS_TEMPLATE and background-color property from the style.scss file.
2023-04-28 07:43:47 +00:00
/**
* These are the default styles for `product elements` that appear inside the 'Products Block'.
* These styles follow the Gutenberg styling hierarchy, which is as follows:
* Editor Styles > Global Styles > Child Theme > Parent Theme > These styles
*
* To ensure that the styles below have the lowest precedence in the hierarchy,
* we use the :where() selector to decrease the specificity of the CSS selector.
*/
:where(.products-block-post-template .wp-block-post) > * {
margin-bottom: 0.75rem;
margin-top: 0;
}
:where(.editor-styles-wrapper .products-block-post-template .wp-block-post) > * > * {
margin-bottom: 0;
margin-top: 0;
}