fix(core): update

This commit is contained in:
2020-05-23 15:00:01 +00:00
parent f7f8074c9b
commit 9782077fb9
8 changed files with 109 additions and 8 deletions

View File

@ -0,0 +1,60 @@
export const desktop = 1240;
export const tablet = 700;
export const phablet = 500;
export const phone = 340;
export type TEnvironment = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
let environment: TEnvironment = 'native';
export const setEnvironment = envArg => {
environment = envArg;
};
export const cssForTablet = (contentArg) => {
if (environment === 'native' || environment === 'desktop') {
return `
@media (max-width: ${tablet}px) {
${contentArg}
}
`;
} else if (environment === 'tablet' || environment === 'phablet' || environment === 'phone') {
return `
@media (min-width: 0px) {
${contentArg}
}
`;
}
};
export const cssForPhablet = (contentArg) => {
if (environment === 'native' || environment === 'desktop') {
return `
@media (max-width: ${phablet}px) {
${contentArg}
}
`;
} else if (environment === 'phablet' || environment === 'phone') {
return `
@media (min-width: 0px) {
${contentArg}
}
`;
}
};
export const cssForPhone = (contentArg) => {
if (environment === 'native' || environment === 'desktop') {
return `
@media (max-width: ${phone}px) {
${contentArg}
}
`;
} else if (environment === 'phone') {
return `
@media (min-width: 0px) {
${contentArg}
}
`;
}
};

View File

@ -0,0 +1,14 @@
import { defer } from '@pushrocks/smartpromise';
/**
* a basic setup for elements
* makes sure everything is in check
*/
export const elementBasicSetup = async () => {
if (globalThis.deesCssToolsReady) {
await globalThis.deesCssToolsReady.promise;
} else {
globalThis.deesCssToolsReady = defer();
globalThis.deesCssToolsReady.resolve();
}
};

View File

@ -0,0 +1,9 @@
import { html } from 'lit-element';
export const elementBasicStyles = html`
<style>
* {
font-family: 'Roboto', sans-serif;
box-sizing: border-box;
}
</style>
`;

View File

@ -1,2 +0,0 @@
const removeme = {};
export { removeme };

View File

@ -1,3 +1,8 @@
import * as plugins from './dees-csstools.plugins';
export * from './csstools.elementbasicsetup';
export * from './csstools.elementbasicstyles';
export let standardExport = 'Hi there! :) This is an exported string';
import * as breakpoints from './csstools.breakpoints';
export {
breakpoints
};