woocommerce/plugins/woocommerce-blocks/assets/js/icons
Daniel W. Robert 056e6946e8 Add new icon for mini cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6784)
* Add new icon for mini cart block (inserter).

See https://github.com/woocommerce/woocommerce-blocks/issues/6617.

* Adjust size of SVG

The new SVG was rendering a little bit smaller than the original icon.
Potentially because of the mask and the artboard size.

This commit adjusts the size to render at the same size as the original
version of the icon in the inserter.
2022-07-29 15:40:03 -04:00
..
library Add new icon for mini cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6784) 2022-07-29 15:40:03 -04:00
stories Remove custom `Icon` component in favour of `@wordpress/icons` where possible (https://github.com/woocommerce/woocommerce-blocks/pull/5599) 2022-02-01 16:54:38 +00:00
README.md Improve the structure of the WooCommerce Blocks Handbook (https://github.com/woocommerce/woocommerce-blocks/pull/6429) 2022-06-09 17:52:19 +02:00
index.js Add new icon for mini cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6784) 2022-07-29 15:40:03 -04:00
tsconfig.json Add types to packages directory (https://github.com/woocommerce/woocommerce-blocks/pull/3914) 2021-03-05 14:03:48 +00:00

README.md

Icons

Table of contents

WooCommerce Blocks Icons Library.

Usage

Note we use the Icon component from @wordpress/icons. We use some SVG icons from @woocommerce/icons for WC Blocks specific icons, but we also use existing icons from @wordpress/icons.

import { woo } from '@woocommerce/icons';
import { Icon, postComments } from '@wordpress/icons';

<Icon icon={ woo } /> // icon  from '@woocommerce/icons'
<Icon icon={ postComments } /> // icon from '@wordpress/icons'
<Icon icon={ woo } size={ 16 } />
<Icon icon={ woo } width={ 20 } height={ Math.floor( 20 * 1.67 ) } />

Adding Icons

Before adding a new icon, make sure the icon is not already included in the Library that comes with @wordpress/icons package. If there is no existing icon suitable:

  1. Add the icon file to ./library folder.
  2. Make sure to use SVG primitive from @wordpress/primitives and not a native svg. SVG offers more accessibility features.
  3. Remove width and height since they're handled by Icon.
  4. Remove any hardcoded colors on the svg. If necessary, use CurrentColor.
  5. Export the Icon in ./library/index.js.

We're hiring! Come work with us!

🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.