Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 4f2d3f1

Browse files
jameskosterryelle
authored andcommitted
Featured Products style tweaks (#316)
* Update search list item padding * Fix search list item radio alignment * Star icon: Material -> Dashicons * Featured product min height * placeholder icon + explanation of explicit height value * Fix linter errors * Remove unnecessary Icon from block registration * Remove the star icon
1 parent c6388de commit 4f2d3f1

File tree

6 files changed

+8
-29
lines changed

6 files changed

+8
-29
lines changed

assets/js/blocks/featured-product/block.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import PropTypes from 'prop-types';
3030
/**
3131
* Internal dependencies
3232
*/
33-
import { IconStar } from '../../components/icons';
3433
import ProductControl from '../../components/product-control';
3534

3635
// Copied from core/cover, updated for product.
@@ -161,7 +160,7 @@ class FeaturedProduct extends Component {
161160

162161
return (
163162
<Placeholder
164-
icon={ <IconStar /> }
163+
icon="star-filled"
165164
label={ __( 'Featured Product', 'woo-gutenberg-products-block' ) }
166165
className="wc-block-featured-product"
167166
>
@@ -270,7 +269,7 @@ class FeaturedProduct extends Component {
270269
) : (
271270
<Placeholder
272271
className="wc-block-featured-product"
273-
icon={ <IconStar /> }
272+
icon="star-filled"
274273
label={ __( 'Featured Product', 'woo-gutenberg-products-block' ) }
275274
>
276275
{ ! loaded ? (

assets/js/blocks/featured-product/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ import { registerBlockType } from '@wordpress/blocks';
99
*/
1010
import './style.scss';
1111
import Block from './block';
12-
import { IconStar } from '../../components/icons';
1312

1413
/**
1514
* Register and run the "Featured Product" block.
1615
*/
1716
registerBlockType( 'woocommerce/featured-product', {
1817
title: __( 'Featured Product', 'woo-gutenberg-products-block' ),
19-
icon: <IconStar />,
18+
icon: 'star-filled',
2019
category: 'woocommerce',
2120
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
2221
description: __(

assets/js/blocks/featured-product/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
background-color: $black;
44
background-size: cover;
55
background-position: center center;
6-
min-height: 430px;
6+
min-height: 500px;
77
width: 100%;
88
margin: 0 0 1.5em 0;
99
display: flex;

assets/js/components/icons/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ export { default as IconCheckUnchecked } from './checkbox-unchecked';
44
export { default as IconNewReleases } from './new-releases';
55
export { default as IconRadioSelected } from './radio-selected';
66
export { default as IconRadioUnselected } from './radio-unselected';
7-
export { default as IconStar } from './star';
87
export { default as IconWidgets } from './widgets';

assets/js/components/icons/star.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

assets/js/components/search-list-control/style.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
.woocommerce-search-list__list {
3838
padding: 0;
39-
max-height: 18.5em;
39+
max-height: 17em;
4040
overflow-x: hidden;
4141
overflow-y: auto;
4242
border-top: 1px solid $core-grey-light-500;
@@ -85,7 +85,7 @@
8585
display: flex;
8686
align-items: center;
8787
margin-bottom: 0;
88-
padding: $gap;
88+
padding: $gap-small $gap;
8989
background: $white;
9090
// !important to keep the border around on hover
9191
border-bottom: 1px solid $core-grey-light-500 !important;
@@ -102,6 +102,8 @@
102102
.woocommerce-search-list__item-state {
103103
flex: 0 0 16px;
104104
margin-right: $gap-smaller;
105+
// Set an explicit height to ensure vertical alignment
106+
height: 24px;
105107
}
106108

107109
.woocommerce-search-list__item-label {

0 commit comments

Comments
 (0)