9bdcbe0b4d
* Fix circular dependencies in Icons package * CircularDependencyPlugin * Fix deriveSelectedShippingRates CD * Move useStoreNotices to context/hooks * Move useStoreCart to base/context/hooks * Move useStoreEvents to base/context/hooks * Move collection/product hooks * Move useStoreAddToCart * Move useCustomerData * move shipping hooks * Move checkout and payment hooks * Context should import hooks with relative paths * Prevent circular dependency in store notices container components * Move address fields to settings so they are shared * Import PaymentMethod components direct * relative import * Fix select CD * Move ValidationInputError * Move components consumed by context * Fix up internal imports in context * fix CD in checkout package * Separate providers * Fixing context exports * Fix base context hook import * fix mocks * Pass hooks to Slot Fills as Fill Props to avoid imports from base-context * Export components, not hooks * Pass props to ExperimentalOrderMeta * Run CD plugin when using `npm start` only * Rename CIRCULAR_DEPS to CHECK_CIRCULAR_DEPS * Remove duplicate key from rebase * Move packages component back to main file * Remove dashicon module replacement * Restore SVG import from package not external * Move core locale handling to avoid impact settings package size * Remove deleted file from rebase |
||
---|---|---|
.. | ||
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 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
.