2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-scrolltop {
|
|
|
|
position: fixed;
|
|
|
|
bottom: 20px;
|
|
|
|
right: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrolltop-sticky {
|
|
|
|
position: sticky;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrolltop-sticky {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrolltop-enter-from {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrolltop-enter-active {
|
|
|
|
transition: opacity 0.15s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrolltop.p-scrolltop-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrolltop-leave-active {
|
|
|
|
transition: opacity 0.15s;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
2024-05-04 12:12:43 +00:00
|
|
|
root: ({ props }) => ['p-scrolltop', { 'p-scrolltop-sticky': props.target !== 'window' }],
|
2023-10-02 10:46:09 +00:00
|
|
|
icon: 'p-scrolltop-icon'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'scrolltop',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|