1
0
Fork 1
mirror of https://github.com/SomboChea/ui synced 2024-06-28 22:15:32 +07:00
verdaccio-ui/src/webui/components/Icon/styles.js
2019-04-04 21:23:40 +02:00

56 lines
854 B
JavaScript

/**
* @prettier
* @flow
*/
import styled, { css } from 'react-emotion';
import { IProps } from './types';
const getSize = (size: string) => {
switch (size) {
case 'md':
return `
width: 18px;
height: 18px;
`;
case 'lg':
return `
width: 20px;
height: 20px;
`;
default:
return `
width: 14px;
height: 16px;
`;
}
};
const commonStyle = ({ size = 'sm', pointer, modifiers }: IProps) => css`
&& {
display: inline-block;
cursor: ${pointer ? 'pointer' : 'default'};
${getSize(size)};
${modifiers && modifiers};
}
`;
export const Svg = styled.svg`
&& {
${commonStyle};
}
`;
export const ImgWrapper = styled.span`
&& {
${commonStyle};
}
`;
export const Img = styled.img`
&& {
width: 100%;
height: auto;
}
`;