@zendeskgarden/react-theming
Version:
Theming utilities and components within the Garden Design System
20 lines (18 loc) • 527 B
JavaScript
/**
* Copyright Zendesk, Inc.
*
* Use of this source code is governed under the Apache License, Version 2.0
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/
function retrieveComponentStyles(componentId, props) {
const components = props.theme?.components;
if (!components) {
return undefined;
}
const componentStyles = components[componentId];
if (typeof componentStyles === 'function') {
return componentStyles(props);
}
return componentStyles;
}
export { retrieveComponentStyles as default };