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

68 lines
1.8 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')};
}
2024-05-09 18:55:56 +00:00
.p-chip-icon {
color: ${dt('chip.icon.color')};
font-size: ${dt('chip.icon.font.size')};
width: ${dt('chip.icon.size')};
height: ${dt('chip.icon.size')};
}
.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:55:56 +00:00
font-size: ${dt('chip.remove.icon.font.size')};
width: ${dt('chip.remove.icon.size')};
height: ${dt('chip.remove.icon.size')};
color: ${dt('chip.remove.icon.color')};
border-radius: 50%;
transition: outline-color ${dt('chip.transition.duration')}, box-shadow ${dt('chip.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
});