shoelace/src/components/avatar/avatar.styles.ts

69 wiersze
1.3 KiB
TypeScript
Czysty Zwykły widok Historia

2021-07-10 00:45:44 +00:00
import { css } from 'lit';
2022-03-24 11:48:03 +00:00
import componentStyles from '~/styles/component.styles';
2021-07-10 00:45:44 +00:00
export default css`
${componentStyles}
:host {
display: inline-block;
--size: 3rem;
}
.avatar {
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
width: var(--size);
height: var(--size);
background-color: var(--sl-color-neutral-400);
2021-07-10 00:45:44 +00:00
font-family: var(--sl-font-sans);
font-size: calc(var(--size) * 0.5);
font-weight: var(--sl-font-weight-normal);
color: var(--sl-color-neutral-0);
2021-07-10 00:45:44 +00:00
user-select: none;
vertical-align: middle;
}
2022-03-02 14:46:11 +00:00
.avatar--circle,
.avatar--circle .avatar__image {
2021-07-10 00:45:44 +00:00
border-radius: var(--sl-border-radius-circle);
}
2022-03-02 14:46:11 +00:00
.avatar--rounded,
.avatar--rounded .avatar__image {
2021-07-10 00:45:44 +00:00
border-radius: var(--sl-border-radius-medium);
}
.avatar--square {
border-radius: 0;
}
.avatar__icon {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.avatar__initials {
line-height: 1;
text-transform: uppercase;
}
.avatar__image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
2022-03-02 14:46:11 +00:00
overflow: hidden;
2021-07-10 00:45:44 +00:00
}
`;