import styled from 'styled-components'
const BadgeStyled = styled.div`
border-radius: 100px;
display:flex;
justify-content:center;
${p => {
if (p.width === 'full')
return 'width:100%;'
else if (p.width === 'content')
return `width:fit-content;`
else
return `width:${p.width};`;
}};
margin: 3px;
&.primary {
color: #2870b2;
background-color: #e7f0f7;
}
&.success
{
color: #6f9e32;
background-color: #dcecc9;
}
&.warning
{
color: #e8b007;
background-color: #fff2d2;
}
&.secondary {
color: #95a3b7;
background-color: #f4f5f8;
}
&.default {
color: #333;
background-color: #eee;
}
&.danger {
color: #de4246;
background-color: #fcdfdf;
}
&.dark {
color: #ffffff;
background-color: #3b495e;
}
>.badge-prefix, >.badge-suffix{
display:flex;
align-items:center;
justify-content:center;
width: 30px;
height: 100%;
}
.badge-label
{
text-align:center;
font-size: 12px;
font-weight: 600;
white-space: nowrap;
width: 100%;
height: 100%;
}
&.badge-small{
padding:1px 1px;
height: 15px;
>.badge-label{
padding: 0px 10px;
}
}
&.badge-medium{
padding:2px 2px;
height: 20px;
>.badge-label{
padding: 1px 20px;
}
}
&.badge-large{
padding:2px 4px;
height: 30px;
>.badge-label{
padding: 2px 30px;
line-height: 24px;
}
}
`
export default BadgeStyled
|