Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
2756a3cb68 | |||
acf0ea3874 | |||
284d2be0e3 | |||
dfb9175613 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.22",
|
"version": "1.0.24",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.22",
|
"version": "1.0.24",
|
||||||
"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",
|
||||||
|
@ -7,7 +7,7 @@ export const phone = 340;
|
|||||||
|
|
||||||
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