primevue-mirror/components/lib/chip/style/ChipStyle.js

57 lines
1.5 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-chip {
display: inline-flex;
align-items: center;
background: ${dt('chip.background')};
color: ${dt('chip.color')};
2024-05-09 18:49:49 +00:00
border-radius: ${dt('chip.border.radius')};
padding: ${dt('chip.padding.y')} ${dt('chip.padding.x')};
gap: ${dt('chip.gap')};
}
.p-chip-image {
border-radius: 50%;
2024-05-09 18:49:49 +00:00
width: ${dt('chip.image.width')};
height: ${dt('chip.image.height')};
margin-left: calc(-1 * ${dt('chip.padding.y')});
}
.p-chip:has(.p-chip-remove-icon) {
2024-05-09 18:49:49 +00:00
padding-right: ${dt('chip.padding.y')};
}
.p-chip:has(.p-chip-image) {
padding-top: calc(${dt('chip.padding.y')} / 2);
padding-bottom: calc(${dt('chip.padding.y')} / 2);
}
.p-chip-remove-icon {
cursor: pointer;
2024-05-09 18:49:49 +00:00
border-radius: ${dt('chip.remove.icon.border.radius')};
transition: outline-color ${dt('transition.duration')}, box-shadow-color ${dt('transition.duration')};
outline-color: transparent;
}
.p-chip-remove-icon:focus-visible {
2024-05-09 18:49:49 +00:00
box-shadow: ${dt('chip.remove.icon.focus.ring.shadow')};
outline: ${dt('chip.remove.icon.focus.ring.width')} ${dt('chip.remove.icon.focus.ring.style')} ${dt('chip.remove.icon.focus.ring.color')};
outline-offset: ${dt('chip.remove.icon.focus.ring.offset')};
}
`;
const classes = {
2024-04-07 21:49:16 +00:00
root: 'p-chip p-component',
image: 'p-chip-image',
icon: 'p-chip-icon',
2024-04-07 21:49:16 +00:00
label: 'p-chip-label',
removeIcon: 'p-chip-remove-icon'
};
export default BaseStyle.extend({
name: 'chip',
theme,
classes
});