PromucFlow_constructor/app/client/src/constants/IconConstants.tsx
ram-primathon 3b0fb539d5
Property Pane re design (#3057)
Co-authored-by: devrk96 <rohit.kumawat@primathon.in>
Co-authored-by: hetunandu <hetu@appsmith.com>
Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
Co-authored-by: Vicky Bansal <67091118+vicky-primathon@users.noreply.github.com>
Co-authored-by: nandan.anantharamu <nandan.anantharamu@thoughtspot.com>
2021-03-15 17:47:56 +05:30

40 lines
926 B
TypeScript

import styled from "styled-components";
import { Color } from "./Colors";
export type IconProps = {
width?: number;
height?: number;
color?: Color;
background?: Color;
onClick?: (e?: any) => void;
className?: string;
keepColors?: boolean;
};
export const IconWrapper = styled.div<IconProps>`
&:focus {
outline: none;
}
display: inline-block;
width: ${(props) => props.width}px;
height: ${(props) => props.height}px;
&& svg {
width: ${(props) => props.width || props.theme.fontSizes[6]}px;
height: ${(props) => props.height || props.theme.fontSizes[6]}px;
${(props) =>
!props.keepColors
? `
path {
fill: ${props.color || props.theme.colors.textOnDarkBG};
}
circle {
fill: ${props.background || props.theme.colors.paneBG};
}
rect {
fill: ${props.background || props.theme.colors.propertyPane.jsIconBg};
}`
: ""}
}
`;