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 }) => `
|
2024-05-10 11:16:37 +00:00
|
|
|
.p-scrolltop.p-button {
|
2024-05-01 08:26:48 +00:00
|
|
|
position: fixed;
|
|
|
|
bottom: 20px;
|
|
|
|
right: 20px;
|
|
|
|
}
|
|
|
|
|
2024-05-10 11:16:37 +00:00
|
|
|
.p-scrolltop-sticky.p-button {
|
2024-05-01 08:26:48 +00:00
|
|
|
position: sticky;
|
2024-05-10 11:16:37 +00:00
|
|
|
display: flex;
|
2024-05-01 08:26:48 +00:00
|
|
|
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
|
|
|
|
});
|