@vnmfify/core
Version:
```shell npm i @vnmfify/core -S ```
28 lines (24 loc) • 705 B
JavaScript
import _kebabCase from "lodash/kebabCase";
import { View } from "@vnxjs/components";
import * as React from "react";
import { useMemo } from "react";
function convertThemeVarsToCSSVars(themeVars) {
var cssVars = {};
Object.keys(themeVars).forEach(key => {
cssVars["--".concat(_kebabCase(key))] = themeVars[key];
});
return cssVars;
}
function ConfigProvider(props) {
var {
theme = {},
children
} = props;
var style = useMemo(() => convertThemeVarsToCSSVars(theme), [theme]);
return /*#__PURE__*/React.createElement(View, {
style: style,
children: children
});
}
export default ConfigProvider;
//# sourceMappingURL=config-provider.js.map