Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
bd0b279fc2 | |||
8276a5b09b | |||
a9200859ec | |||
210a0ad8a1 | |||
2756a3cb68 | |||
acf0ea3874 | |||
284d2be0e3 | |||
dfb9175613 |
23
package-lock.json
generated
23
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.22",
|
"version": "1.0.26",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1072,16 +1072,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/lik": {
|
"@pushrocks/lik": {
|
||||||
"version": "4.0.12",
|
"version": "4.0.13",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.12.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.13.tgz",
|
||||||
"integrity": "sha512-ffd3bJL+kMuhXDulO5VC5OqgfhZR3I4HoVN7IBLlN1z6Dco6j4NFrp+/GKDoPssFPNQY4okv+N4Hm2T/7t+4CQ==",
|
"integrity": "sha512-Nde8rq1DjaDCREKlGGY/zS8g+eFu4zSU2jrbO4DdtYD+9oiauBMz2jzao3fr8401XpNW1Ex8T8FPdjUW8lUMow==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartdelay": "^2.0.9",
|
"@pushrocks/smartdelay": "^2.0.9",
|
||||||
"@pushrocks/smartmatch": "^1.0.7",
|
"@pushrocks/smartmatch": "^1.0.7",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartrx": "^2.0.15",
|
"@pushrocks/smartrx": "^2.0.15",
|
||||||
"@pushrocks/smarttime": "^3.0.18",
|
"@pushrocks/smarttime": "^3.0.18",
|
||||||
"@pushrocks/smartunique": "^3.0.3",
|
|
||||||
"@types/minimatch": "^3.0.3",
|
"@types/minimatch": "^3.0.3",
|
||||||
"symbol-tree": "^3.2.4"
|
"symbol-tree": "^3.2.4"
|
||||||
},
|
},
|
||||||
@ -1423,6 +1422,7 @@
|
|||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartunique/-/smartunique-3.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartunique/-/smartunique-3.0.3.tgz",
|
||||||
"integrity": "sha512-f+c3s2WzzjASoRHyYTLU0kHDVWREg4sZVdi5L42bTA3CTUWNrcGUC62h4wP4U4BiPl3bopTr3LPhClZHJ738oA==",
|
"integrity": "sha512-f+c3s2WzzjASoRHyYTLU0kHDVWREg4sZVdi5L42bTA3CTUWNrcGUC62h4wP4U4BiPl3bopTr3LPhClZHJ738oA==",
|
||||||
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/shortid": "0.0.29",
|
"@types/shortid": "0.0.29",
|
||||||
"@types/uuid": "^7.0.0",
|
"@types/uuid": "^7.0.0",
|
||||||
@ -1643,7 +1643,8 @@
|
|||||||
"@types/shortid": {
|
"@types/shortid": {
|
||||||
"version": "0.0.29",
|
"version": "0.0.29",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fshortid/-/shortid-0.0.29.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fshortid/-/shortid-0.0.29.tgz",
|
||||||
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps="
|
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps=",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/through2": {
|
"@types/through2": {
|
||||||
"version": "2.0.36",
|
"version": "2.0.36",
|
||||||
@ -1674,7 +1675,8 @@
|
|||||||
"@types/uuid": {
|
"@types/uuid": {
|
||||||
"version": "7.0.4",
|
"version": "7.0.4",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fuuid/-/uuid-7.0.4.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fuuid/-/uuid-7.0.4.tgz",
|
||||||
"integrity": "sha512-WGZCqBZZ0mXN2RxvLHL6/7RCu+OWs28jgQMP04LWfpyJlQUMTR6YU9CNJAKDgbw+EV/u687INXuLUc7FuML/4g=="
|
"integrity": "sha512-WGZCqBZZ0mXN2RxvLHL6/7RCu+OWs28jgQMP04LWfpyJlQUMTR6YU9CNJAKDgbw+EV/u687INXuLUc7FuML/4g==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/which": {
|
"@types/which": {
|
||||||
"version": "1.3.2",
|
"version": "1.3.2",
|
||||||
@ -2634,7 +2636,8 @@
|
|||||||
"nanoid": {
|
"nanoid": {
|
||||||
"version": "2.1.11",
|
"version": "2.1.11",
|
||||||
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.1.11.tgz",
|
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.1.11.tgz",
|
||||||
"integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA=="
|
"integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"no-case": {
|
"no-case": {
|
||||||
"version": "2.3.2",
|
"version": "2.3.2",
|
||||||
@ -3057,6 +3060,7 @@
|
|||||||
"version": "2.2.15",
|
"version": "2.2.15",
|
||||||
"resolved": "https://verdaccio.lossless.one/shortid/-/shortid-2.2.15.tgz",
|
"resolved": "https://verdaccio.lossless.one/shortid/-/shortid-2.2.15.tgz",
|
||||||
"integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==",
|
"integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==",
|
||||||
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"nanoid": "^2.1.0"
|
"nanoid": "^2.1.0"
|
||||||
}
|
}
|
||||||
@ -3342,7 +3346,8 @@
|
|||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/uuid/-/uuid-7.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/uuid/-/uuid-7.0.3.tgz",
|
||||||
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg=="
|
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"wcwidth": {
|
"wcwidth": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.22",
|
"version": "1.0.26",
|
||||||
"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",
|
||||||
@ -22,7 +22,7 @@
|
|||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^4.0.12",
|
"@pushrocks/lik": "^4.0.13",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartstate": "^1.0.16",
|
"@pushrocks/smartstate": "^1.0.16",
|
||||||
"lit-element": "^2.3.1"
|
"lit-element": "^2.3.1"
|
||||||
|
@ -15,6 +15,8 @@ tools to simplify complex css structures
|
|||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://prettier.io/)
|
[](https://prettier.io/)
|
||||||
|
[](https://prettier.io/)
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ import { DomTools } from './domtools.classes.domtools';
|
|||||||
export const desktop = 1240;
|
export const desktop = 1240;
|
||||||
export const tablet = 700;
|
export const tablet = 700;
|
||||||
export const phablet = 500;
|
export const phablet = 500;
|
||||||
export const phone = 340;
|
export const phone = 400;
|
||||||
|
|
||||||
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||||
|
|
||||||
export const getEnvironment = async (): Promise<TViewport> => {
|
export const getEnvironment = (): TViewport => {
|
||||||
if (globalThis.deesDomTools && globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport) {
|
if (globalThis.deesDomTools && globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport) {
|
||||||
return globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport;
|
return globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport;
|
||||||
} else {
|
} else {
|
||||||
@ -15,7 +15,7 @@ export const getEnvironment = async (): Promise<TViewport> => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cssForTablet = async (contentArg) => {
|
export const cssForTablet = (contentArg) => {
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
||||||
return `
|
return `
|
||||||
@media (max-width: ${tablet}px) {
|
@media (max-width: ${tablet}px) {
|
||||||
@ -35,7 +35,7 @@ export const cssForTablet = async (contentArg) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cssForPhablet = async (contentArg) => {
|
export const cssForPhablet = (contentArg) => {
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
||||||
return `
|
return `
|
||||||
@media (max-width: ${phablet}px) {
|
@media (max-width: ${phablet}px) {
|
||||||
@ -51,7 +51,7 @@ export const cssForPhablet = async (contentArg) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cssForPhone = async (contentArg) => {
|
export const cssForPhone = (contentArg) => {
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
||||||
return `
|
return `
|
||||||
@media (max-width: ${phone}px) {
|
@media (max-width: ${phone}px) {
|
||||||
|
Reference in New Issue
Block a user