fix(core): update
This commit is contained in:
60
ts/csstools.breakpoints.ts
Normal file
60
ts/csstools.breakpoints.ts
Normal 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}
|
||||
}
|
||||
`;
|
||||
}
|
||||
};
|
14
ts/csstools.elementbasicsetup.ts
Normal file
14
ts/csstools.elementbasicsetup.ts
Normal 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();
|
||||
}
|
||||
};
|
9
ts/csstools.elementbasicstyles.ts
Normal file
9
ts/csstools.elementbasicstyles.ts
Normal 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>
|
||||
`;
|
@ -1,2 +0,0 @@
|
||||
const removeme = {};
|
||||
export { removeme };
|
@ -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
|
||||
};
|
||||
|
Reference in New Issue
Block a user