UNPKG

@shopify/polaris

Version:

Shopify’s admin product component library

38 lines (32 loc) 1.11 kB
import React from 'react'; import './CustomProperties.scss.js'; const DEFAULT_COLOR_SCHEME = 'light'; /** * @deprecated The CustomProperties component will be removed in the next * major version. See the Polaris token documentation for replacing * colors relying on dark color scheme values. * * https://polaris.shopify.com/tokens/all-tokens */ function CustomProperties(props) { const { as: Component = 'div', children, className, colorScheme = DEFAULT_COLOR_SCHEME, style } = props; if (process.env.NODE_ENV === 'development') { // eslint-disable-next-line no-console console.warn('Deprecation: The `CustomProperties` component has been deprecated. See the v10 migration guide for replacing dark color scheme styles. https://github.com/Shopify/polaris/blob/main/documentation/guides/migrating-from-v9-to-v10.md'); } return /*#__PURE__*/React.createElement(Component, { "p-color-scheme": colorScheme, className: className, style: { color: 'var(--p-text)', ...style } }, children); } export { CustomProperties, DEFAULT_COLOR_SCHEME };