b941b0c332
* Update storybook to 6.3.6 * @storybook/addon-knobs * Remove need for wordpress-compose imports This functionality exists in WP 5.5 so we don't need to import the package any more. * Update to latest non 17x packages * Composer update * Fix for @babel/plugin-proposal-nullish-coalescing-operator and spinner style * onSelect was called before init * Add back env * Update locks * Revert browserlist config increase (ie11 support dropped needs separate discussion) * update locks * SVG can come from the external * Import from components package where possible (5.5 has Gutenberg 9.2.0) and revert component package version change * Revert component imports. Import from wordpress-components in the frontend context. This removes `wp-components` dependency from all -frontend asset files. |
||
---|---|---|
.. | ||
icon | ||
library | ||
stories | ||
README.md | ||
index.js | ||
tsconfig.json |
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 fromwordpress-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
.