mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 08:52:46 +08:00
* add: media upload button * add: support for custom icon * fix: code alignment, phpcs * fix: code alignment and linting * add: mixpanel events * fix: styling of custom svg * fix: missing variable * fix: missing variable * fix: load gutenberg block without css * fix: icon spacing in preview * fix: indentation * fix: indents
35 lines
775 B
JavaScript
35 lines
775 B
JavaScript
import { styled } from '@elementor/ui/styles';
|
|
import { useSettings } from '@ea11y/hooks';
|
|
|
|
const CustomIcon = ({ size }) => {
|
|
const { iconDesign } = useSettings();
|
|
const strokeColor = `lch(from ${iconDesign?.color || '#fff'} calc((50 - l) * 100) 0 0)`;
|
|
|
|
return (
|
|
<StyledDiv
|
|
className="custom-icon"
|
|
style={{
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
}}
|
|
dangerouslySetInnerHTML={{ __html: iconDesign?.custom?.svg }}
|
|
size={size}
|
|
strokeColor={strokeColor}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default CustomIcon;
|
|
|
|
const StyledDiv = styled('div')`
|
|
svg {
|
|
font-size: ${({ size }) => size}px;
|
|
width: ${({ size }) => size}px;
|
|
fill: ${({ strokeColor }) => strokeColor};
|
|
|
|
path {
|
|
fill: ${({ strokeColor }) => strokeColor};
|
|
}
|
|
}
|
|
`;
|