dees-domtools/ts/domtools.css.theme.ts

37 lines
706 B
TypeScript
Raw Normal View History

2020-09-12 13:14:17 +00:00
import { DomTools } from './domtools.classes.domtools';
2020-09-12 13:11:10 +00:00
2020-09-13 14:58:26 +00:00
/**
* changes scrollbar styles to be consistent across OS borders
*/
2020-09-15 20:24:11 +00:00
export const scrollBarStyles = (() => {
const returnStyles = navigator.userAgent.indexOf("Windows") !== -1 ? `
2020-09-13 14:57:30 +00:00
/* width */
::-webkit-scrollbar {
width: 8px;
}
/* Track */
::-webkit-scrollbar-track {
background: #111;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #666;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #777;
}
2020-09-15 20:24:11 +00:00
` : ``;
})();
2020-09-13 14:57:30 +00:00
2020-09-12 13:11:10 +00:00
export const setupGlobalTheme = (domToolsInstance: DomTools) => {
const styles = `
2020-09-13 14:57:30 +00:00
${scrollBarStyles}
2020-09-12 13:11:10 +00:00
`;
domToolsInstance.setGlobalStyles(styles);
};