cd9f7e0ccb
* Product selection when out of context for price and title blocks * Move product element name/description/icons to constant files * Add attributes and hocs to all elements * Standalone block rendering * Add a placeholder if title has no content * Revert "Add a placeholder if title has no content" This reverts commit 29115154b33eedc661ccd3cc758acdbc5041ffbc. * parentClassName is not always present * Loading state * Wrap description in P * Fixed loading styles when nested * Maintain product shape in useProductData * feature gate elements from showing in inserter * fix feature flag * include price PR * edit withProductSelector to be a hoc * fix lint issue Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com> |
||
---|---|---|
.. | ||
icon | ||
library | ||
stories | ||
README.md | ||
index.js |
README.md
Icons
WooCommerce Blocks Icons Library.
Usage
import { Icon, bill, woo } from '@woocommerce/icons';
<Icon srcElement={ bill } />
<Icon srcElement={ bill } size={ 16 } />
<Icon srcElement={ woo } width={ 20 } height={ Math.floor( 20 * 1.67 ) } />
Props
Name | Type | Default | Description |
---|---|---|---|
size |
integer |
24 |
Size of icon in pixels. |
Adding Icons
- Add the icon file to
./library
folder. - Make sure to use
SVG
primitive from@wordpress/components
and not a native svg.SVG
offers more accessibility features. - Remove width and height since they're handled by Icon.
- Remove any hardcoded colors on the svg. If necessary, use
CurrentColor
. - Export the Icon in
./library/index.js
.