primevue-mirror/components/lib/scrolltop/style/ScrollTopStyle.js

45 lines
700 B
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
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;
}
`;
const classes = {
2024-05-04 12:12:43 +00:00
root: ({ props }) => ['p-scrolltop', { 'p-scrolltop-sticky': props.target !== 'window' }],
icon: 'p-scrolltop-icon'
};
export default BaseStyle.extend({
name: 'scrolltop',
theme,
classes
});