Compare commits

..

14 Commits

Author SHA1 Message Date
bb1ad4e037 1.0.52 2020-09-16 13:57:16 +00:00
eb871161f9 fix(core): update 2020-09-16 13:57:16 +00:00
090e5b4d42 1.0.51 2020-09-16 11:29:27 +00:00
8168dd1a0c fix(core): update 2020-09-16 11:29:26 +00:00
de15bc0d1c 1.0.50 2020-09-16 10:06:23 +00:00
13fa3d655e fix(core): update 2020-09-16 10:06:22 +00:00
18b93b860d 1.0.49 2020-09-15 20:56:34 +00:00
e8e6416b6f fix(core): update 2020-09-15 20:56:33 +00:00
fbe2f381c9 1.0.48 2020-09-15 20:24:12 +00:00
3cb0aceaad fix(core): update 2020-09-15 20:24:11 +00:00
6d6c92eee4 1.0.47 2020-09-13 15:53:31 +00:00
4385909677 fix(core): update 2020-09-13 15:53:30 +00:00
2dc36d8170 1.0.46 2020-09-13 14:58:27 +00:00
ffbde62744 fix(core): update 2020-09-13 14:58:26 +00:00
5 changed files with 18 additions and 19 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.45", "version": "1.0.52",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.45", "version": "1.0.52",
"private": false, "private": false,
"description": "tools to simplify complex css structures", "description": "tools to simplify complex css structures",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -5,7 +5,6 @@ import { TViewport } from './domtools.breakpoints';
import { Scroller } from './domtools.classes.scroller'; import { Scroller } from './domtools.classes.scroller';
import { delayForRandom } from '@pushrocks/smartdelay'; import { delayForRandom } from '@pushrocks/smartdelay';
import { setupGlobalTheme } from './domtools.css.theme';
export interface IDomToolsState { export interface IDomToolsState {
virtualViewport: TViewport; virtualViewport: TViewport;
@ -24,9 +23,6 @@ export class DomTools {
globalThis.deesDomTools = new DomTools(); globalThis.deesDomTools = new DomTools();
domToolsInstance = globalThis.deesDomTools; domToolsInstance = globalThis.deesDomTools;
// lets setup theming
setupGlobalTheme(domToolsInstance);
// lets make sure the dom is ready // lets make sure the dom is ready
const readyStateChangedFunc = () => { const readyStateChangedFunc = () => {
if (document.readyState === 'interactive' || document.readyState === 'complete') { if (document.readyState === 'interactive' || document.readyState === 'complete') {
@ -47,7 +43,7 @@ export class DomTools {
/** /**
* if you can, use the static asysnc .setupDomTools() function instead since it is safer to use. * if you can, use the static asysnc .setupDomTools() function instead since it is safer to use.
*/ */
public static getGlobalDomToolsSync() { public static getGlobalDomToolsSync(): DomTools {
const globalDomTools: DomTools = globalThis.deesDomTools; const globalDomTools: DomTools = globalThis.deesDomTools;
if (!globalDomTools) { if (!globalDomTools) {
throw new Error('You tried to access domtools synchronously too early'); throw new Error('You tried to access domtools synchronously too early');

View File

@ -1,6 +1,10 @@
import { DomTools } from './domtools.classes.domtools'; import { DomTools } from './domtools.classes.domtools';
export const scrollBarStyles = ` /**
* changes scrollbar styles to be consistent across OS borders
*/
export const scrollBarStyles = (() => {
const returnStyles = navigator.userAgent.indexOf("Windows") !== -1 ? `
/* width */ /* width */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
@ -20,12 +24,5 @@ export const scrollBarStyles = `
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #777; background: #777;
} }
`; ` : ``;
})();
export const setupGlobalTheme = (domToolsInstance: DomTools) => {
const styles = `
${scrollBarStyles}
`;
domToolsInstance.setGlobalStyles(styles);
};

View File

@ -7,7 +7,7 @@ import { html } from 'lit-element';
/** /**
* styles to be included in every webcomponent * styles to be included in every webcomponent
*/ */
export const styles = html`; export const styles = html`
<style> <style>
* { * {
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
@ -46,7 +46,13 @@ export const setup = async () => {
// Roboto Font // Roboto Font
domTools.setGlobalStyles(` domTools.setGlobalStyles(`
@import url('https://fonts.googleapis.com/css?family=Roboto'); @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100;300;400');
`);
// scrollbars
domTools.setGlobalStyles(`
${scrollBarStyles}
`); `);
}); });
}; };