primevue-mirror/components/lib/knob/style/KnobStyle.js

51 lines
1.1 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-knob-range {
fill: none;
transition: stroke 0.1s ease-in;
}
.p-knob-value {
animation-name: p-knob-dash-frame;
animation-fill-mode: forwards;
fill: none;
}
.p-knob-text {
font-size: 1.3rem;
text-align: center;
}
.p-knob svg {
2024-05-25 08:24:38 +00:00
border-radius: 50%;
outline-color: transparent;
2024-05-25 08:24:38 +00:00
transition: background ${dt('knob.transition.duration')}, color ${dt('knob.transition.duration')}, outline-color ${dt('knob.transition.duration')}, box-shadow ${dt('knob.transition.duration')};
}
2024-05-25 08:24:38 +00:00
.p-knob svg:focus-visible {
2024-05-25 08:24:38 +00:00
box-shadow: ${dt('knob.focus.ring.shadow')};
outline: ${dt('knob.focus.ring.width')} ${dt('knob.focus.ring.style')} ${dt('knob.focus.ring.color')};
outline-offset: ${dt('knob.focus.ring.offset')};
}
@keyframes p-knob-dash-frame {
100% {
stroke-dashoffset: 0;
}
}
`;
const classes = {
root: ({ props }) => ['p-knob p-component', { 'p-disabled': props.disabled }],
range: 'p-knob-range',
value: 'p-knob-value',
text: 'p-knob-text'
};
export default BaseStyle.extend({
name: 'knob',
theme,
classes
});