dees-domtools/ts/domtools.breakpoints.ts

44 lines
980 B
TypeScript
Raw Normal View History

2020-05-27 21:15:38 +00:00
import { DomTools } from './domtools.classes.domtools';
2021-11-21 14:52:49 +00:00
import { CSSResult } from 'lit-element';
2020-05-23 15:00:01 +00:00
export const desktop = 1240;
2020-06-03 09:07:31 +00:00
export const tablet = 1024;
export const phablet = 600;
2020-06-01 12:30:21 +00:00
export const phone = 400;
2020-05-23 15:00:01 +00:00
2020-05-27 21:15:38 +00:00
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
2020-05-23 15:00:01 +00:00
2021-11-21 14:52:49 +00:00
export const cssForTablet = (cssArg: CSSResult) => {
return `
@container wccToolsViewport (min-width: ${tablet}px) {
${cssArg.cssText}
}
@media (min-width: ${tablet}px) {
${cssArg.cssText}
}
`;
2020-05-23 15:00:01 +00:00
};
2021-11-21 14:52:49 +00:00
export const cssForPhablet = (cssArg: CSSResult) => {
return `
@container wccToolsViewport (min-width: ${phablet}px) {
${cssArg.cssText}
}
@media (min-width: ${phablet}px) {
${cssArg.cssText}
}
`;
2020-05-23 15:00:01 +00:00
};
2021-11-21 14:52:49 +00:00
export const cssForPhone = (cssArg: CSSResult) => {
return `
@container wccToolsViewport (min-width: ${phone}px) {
${cssArg.cssText}
}
@media (min-width: ${phone}px) {
${cssArg.cssText}
}
`;
2020-05-23 15:00:01 +00:00
};