Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
356a756962 | |||
0bb66e8221 | |||
b70077c43f | |||
9c5f024e5f | |||
5eea208924 | |||
f21fdb2eb8 | |||
d6ea74cb71 | |||
10375576a7 | |||
367be854ff | |||
0933c1d83b | |||
af1eb73028 | |||
4bff0091c9 | |||
7bae4585f3 | |||
d9cdff2897 | |||
189060f11d | |||
fc2dfa8018 | |||
be44cb7a78 | |||
de6aba4289 | |||
3babbce2c5 | |||
707956b7ee | |||
c71a6170d5 | |||
3f98f2867c | |||
7c86f5a8f6 | |||
472ec3158e | |||
9a0d09d9de | |||
5975ca7320 | |||
97583c650d |
@ -36,6 +36,7 @@ auditProductionDependencies:
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
3221
package-lock.json
generated
3221
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.100",
|
||||
"version": "1.0.114",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -13,27 +13,27 @@
|
||||
"format": "(gitzone format)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.28",
|
||||
"@gitzone/tsbundle": "^1.0.88",
|
||||
"@gitzone/tsbuild": "^2.1.29",
|
||||
"@gitzone/tsbundle": "^1.0.89",
|
||||
"@gitzone/tstest": "^1.0.60",
|
||||
"@pushrocks/tapbundle": "^3.2.14",
|
||||
"@types/node": "^16.11.9",
|
||||
"@pushrocks/tapbundle": "^4.0.0",
|
||||
"@types/node": "^17.0.13",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.65",
|
||||
"@designestate/dees-comms": "^1.0.11",
|
||||
"@pushrocks/lik": "^5.0.0",
|
||||
"@designestate/dees-comms": "^1.0.16",
|
||||
"@pushrocks/lik": "^5.0.4",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.6",
|
||||
"@pushrocks/smartrouter": "^1.0.11",
|
||||
"@pushrocks/smartrx": "^2.0.19",
|
||||
"@pushrocks/smartstate": "^1.0.21",
|
||||
"@pushrocks/smartrouter": "^1.0.12",
|
||||
"@pushrocks/smartrx": "^2.0.25",
|
||||
"@pushrocks/smartstate": "^1.0.23",
|
||||
"@pushrocks/webrequest": "^2.0.13",
|
||||
"@pushrocks/websetup": "^3.0.15",
|
||||
"@pushrocks/webstore": "^1.0.16",
|
||||
"lit-element": "^3.0.2",
|
||||
"@pushrocks/websetup": "^3.0.16",
|
||||
"@pushrocks/webstore": "^1.0.18",
|
||||
"lit": "^2.1.2",
|
||||
"sweet-scroll": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
|
@ -3,7 +3,7 @@ import * as domtools from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
||||
expect(domtoolsInstance).to.be.instanceof(domtools.DomTools);
|
||||
expect(domtoolsInstance).toBeInstanceOf(domtools.DomTools);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as plugins from './domtools.plugins';
|
||||
import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap';
|
||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
||||
import { TViewport } from './domtools.breakpoints';
|
||||
import { TViewport } from './domtools.css.breakpoints';
|
||||
|
||||
import { Scroller } from './domtools.classes.scroller';
|
||||
import { WebSetup } from '@pushrocks/websetup';
|
||||
@ -9,6 +9,7 @@ import { ThemeManager } from './domtools.classes.thememanager';
|
||||
|
||||
export interface IDomToolsState {
|
||||
virtualViewport: TViewport;
|
||||
jwt: string;
|
||||
}
|
||||
|
||||
export class DomTools {
|
||||
@ -73,6 +74,7 @@ export class DomTools {
|
||||
public smartstate = new plugins.smartstate.Smartstate();
|
||||
public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools', {
|
||||
virtualViewport: 'native',
|
||||
jwt: null
|
||||
});
|
||||
|
||||
public router = new plugins.smartrouter.SmartRouter({
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { LitElement } from 'lit-element';
|
||||
import { DomTools } from './domtools.classes.domtools';
|
||||
import * as plugins from './domtools.plugins';
|
||||
|
||||
@ -29,16 +28,25 @@ export class ThemeManager {
|
||||
this.themeObservable.next(this.goBrightBoolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* set the theme of the website to bright
|
||||
*/
|
||||
public goBright() {
|
||||
this.goBrightBoolean = true;
|
||||
this.updateAllConnectedElements();
|
||||
}
|
||||
|
||||
/**
|
||||
* set the theme of the website to dark
|
||||
*/
|
||||
public goDark() {
|
||||
this.goBrightBoolean = false;
|
||||
this.updateAllConnectedElements();
|
||||
}
|
||||
|
||||
/**
|
||||
* simply toggle between bright and dark
|
||||
*/
|
||||
public toggleDarkBright() {
|
||||
this.goBrightBoolean = !this.goBrightBoolean;
|
||||
this.updateAllConnectedElements();
|
||||
|
59
ts/domtools.css.basestyles.ts
Normal file
59
ts/domtools.css.basestyles.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import { DomTools } from './domtools.classes.domtools';
|
||||
|
||||
import { css, unsafeCSS } from 'lit';
|
||||
|
||||
/**
|
||||
* changes scrollbar styles to be consistent across OS borders
|
||||
*/
|
||||
export const scrollBarStyles: string = (() => {
|
||||
const returnStyles =
|
||||
navigator.userAgent.indexOf('Mac OS X') === -1
|
||||
? css`
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: #111;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #666;
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #777;
|
||||
}
|
||||
`.cssText
|
||||
: ``;
|
||||
return returnStyles;
|
||||
})();
|
||||
|
||||
export const globalBaseStyles: string = css`
|
||||
/* global material font */
|
||||
@font-face {
|
||||
font-family: 'Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2)
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
/* Roboto Font */
|
||||
@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');
|
||||
|
||||
/* global body styles */
|
||||
body {
|
||||
margin: 0px;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* scroll bar styles */
|
||||
${unsafeCSS(scrollBarStyles)}
|
||||
`.cssText;
|
@ -1,6 +1,6 @@
|
||||
import { DomTools } from './domtools.classes.domtools';
|
||||
|
||||
import { CSSResult, unsafeCSS } from 'lit-element';
|
||||
import { CSSResult, unsafeCSS } from 'lit';
|
||||
|
||||
export const desktop = 1240;
|
||||
export const tablet = 1024;
|
||||
@ -11,10 +11,10 @@ export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||
|
||||
export const cssForTablet = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport (min-width: ${tablet}px) {
|
||||
@container wccToolsViewport size(max-width: ${tablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (min-width: ${tablet}px) {
|
||||
@media (max-width: ${tablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
||||
@ -22,10 +22,10 @@ export const cssForTablet = (cssArg: CSSResult) => {
|
||||
|
||||
export const cssForPhablet = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport (min-width: ${phablet}px) {
|
||||
@container wccToolsViewport size(max-width: ${phablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (min-width: ${phablet}px) {
|
||||
@media (max-width: ${phablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
||||
@ -33,10 +33,10 @@ export const cssForPhablet = (cssArg: CSSResult) => {
|
||||
|
||||
export const cssForPhone = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport (min-width: ${phone}px) {
|
||||
@container wccToolsViewport size(max-width: ${phone}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (min-width: ${phone}px) {
|
||||
@media (max-width: ${phone}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
@ -1,31 +0,0 @@
|
||||
import { DomTools } from './domtools.classes.domtools';
|
||||
|
||||
/**
|
||||
* changes scrollbar styles to be consistent across OS borders
|
||||
*/
|
||||
export const scrollBarStyles = (() => {
|
||||
const returnStyles =
|
||||
navigator.userAgent.indexOf('Mac OS X') !== -1
|
||||
? `
|
||||
/* 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;
|
||||
}
|
||||
`
|
||||
: ``;
|
||||
})();
|
@ -1,8 +1,8 @@
|
||||
import * as plugins from './domtools.plugins';
|
||||
import { DomTools } from './domtools.classes.domtools';
|
||||
import { scrollBarStyles } from './domtools.css.theme';
|
||||
import { scrollBarStyles, globalBaseStyles } from './domtools.css.basestyles';
|
||||
|
||||
import { html, LitElement, css, unsafeCSS } from 'lit-element';
|
||||
import { html, LitElement, css, unsafeCSS } from 'lit';
|
||||
|
||||
export const staticStyles = css`
|
||||
* {
|
||||
@ -11,6 +11,7 @@ export const staticStyles = css`
|
||||
}
|
||||
|
||||
:host {
|
||||
box-sizing: border-box;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
@ -49,34 +50,7 @@ export const setup = async (elementArg?: LitElement): Promise<DomTools> => {
|
||||
|
||||
domTools.runOnce('elementBasicSetup', async () => {
|
||||
// bodyStyles
|
||||
domTools.setGlobalStyles(`
|
||||
body {
|
||||
margin: 0px;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
`);
|
||||
|
||||
// material font
|
||||
domTools.setGlobalStyles(`
|
||||
@font-face {
|
||||
font-family: 'Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');
|
||||
}
|
||||
`);
|
||||
|
||||
// Roboto Font
|
||||
domTools.setGlobalStyles(`
|
||||
@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}
|
||||
`);
|
||||
domTools.setGlobalStyles(globalBaseStyles);
|
||||
});
|
||||
return domTools;
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
export * from './domtools.colors';
|
||||
|
||||
import * as elementBasic from './domtools.elementbasic';
|
||||
import * as breakpoints from './domtools.breakpoints';
|
||||
import * as breakpoints from './domtools.css.breakpoints';
|
||||
import * as css from './domtools.css';
|
||||
|
||||
export { css, breakpoints, elementBasic };
|
||||
|
Reference in New Issue
Block a user