4f5693e63c
* modify dashicon replacements to be consistent with other icon exports This also involved modifying the dashicon module replacement to use `cloneElement` instead of `createElement`. * import from packages not global * export woo icon consistent with other icons from the library The Woo category icon was not using the Icon system and not exported consistent with other icons. * add missing viewbox to arrowBack * add story for icon library * Update assets/js/icons/stories/index.js Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.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
.