fix(core): update

This commit is contained in:
Philipp Kunz 2020-09-12 13:11:10 +00:00
parent 537902aa53
commit 73552ad80f
2 changed files with 32 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import { TViewport } from './domtools.breakpoints';
import { Scroller } from './domtools.classes.scroller';
import { delayForRandom } from '@pushrocks/smartdelay';
import { setupGlobalTheme } from './domtools.css.theme';
export interface IDomToolsState {
virtualViewport: TViewport;
@ -22,6 +23,10 @@ export class DomTools {
if (!globalThis.deesDomTools) {
globalThis.deesDomTools = new DomTools();
domToolsInstance = globalThis.deesDomTools;
// lets setup theming
setupGlobalTheme(domToolsInstance);
// lets make sure the dom is ready
const readyStateChangedFunc = () => {
if (document.readyState === 'interactive' || document.readyState === 'complete') {

27
ts/domtools.css.theme.ts Normal file
View File

@ -0,0 +1,27 @@
import { DomTools } from "./domtools.classes.domtools";
export const setupGlobalTheme = (domToolsInstance: DomTools) => {
const styles = `
/* 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;
}
`;
domToolsInstance.setGlobalStyles(styles);
};