primevue-mirror/components/lib/avatar/style/AvatarStyle.js

89 lines
1.7 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-avatar {
display: inline-flex;
align-items: center;
justify-content: center;
2024-05-09 18:18:08 +00:00
width: ${dt('avatar.width')};
height: ${dt('avatar.height')};
font-size: ${dt('avatar.font.size')};
background: ${dt('avatar.background')};
2024-05-09 18:18:08 +00:00
border-radius: ${dt('avatar.border.radius')};
}
.p-avatar-image {
2024-05-09 18:18:08 +00:00
background: transparent;
}
.p-avatar-circle {
border-radius: 50%;
}
.p-avatar-circle img {
border-radius: 50%;
}
.p-avatar-icon {
2024-05-09 18:18:08 +00:00
font-size: ${dt('avatar.font.size')};
}
.p-avatar img {
width: 100%;
height: 100%;
}
.p-avatar-lg {
2024-05-09 18:18:08 +00:00
width: ${dt('avatar.lg.width')};
height: ${dt('avatar.lg.width')};
font-size: ${dt('avatar.lg.font.size')};
}
.p-avatar-lg .p-avatar-icon {
2024-05-09 18:18:08 +00:00
font-size: ${dt('avatar.lg.font.size')};
}
.p-avatar-xl {
2024-05-09 18:18:08 +00:00
width: ${dt('avatar.xl.width')};
height: ${dt('avatar.xl.width')};
font-size: ${dt('avatar.xl.font.size')};
}
.p-avatar-xl .p-avatar-icon {
2024-05-09 18:18:08 +00:00
font-size: ${dt('avatar.xl.font.size')};
}
.p-avatar-group {
display: flex;
align-items: center;
}
.p-avatar-group .p-avatar + .p-avatar {
2024-05-09 18:18:08 +00:00
margin-left: ${dt('avatar.group.offset')};
}
.p-avatar-group .p-avatar {
2024-05-04 12:12:43 +00:00
border: 2px solid ${dt('avatar.group.border.color')};
}
`;
const classes = {
root: ({ props }) => [
'p-avatar p-component',
{
'p-avatar-image': props.image != null,
'p-avatar-circle': props.shape === 'circle',
'p-avatar-lg': props.size === 'large',
'p-avatar-xl': props.size === 'xlarge'
}
],
2024-04-07 21:44:20 +00:00
label: 'p-avatar-label',
icon: 'p-avatar-icon'
};
export default BaseStyle.extend({
name: 'avatar',
theme,
classes
});