dees-domtools/ts/domtools.css.breakpoints.ts

44 lines
1016 B
TypeScript
Raw Normal View History

2020-05-27 21:15:38 +00:00
import { DomTools } from './domtools.classes.domtools';
2021-11-26 15:21:11 +00:00
import { CSSResult, unsafeCSS } from 'lit';
2021-11-21 14:52:49 +00:00
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) => {
2021-11-21 15:08:27 +00:00
return unsafeCSS(`
2022-03-02 18:00:52 +00:00
@container wccToolsViewport (max-width: ${tablet}px) {
2021-11-21 14:52:49 +00:00
${cssArg.cssText}
}
2021-11-26 16:36:00 +00:00
@media (max-width: ${tablet}px) {
2021-11-21 14:52:49 +00:00
${cssArg.cssText}
}
2021-11-21 15:08:27 +00:00
`);
2020-05-23 15:00:01 +00:00
};
2021-11-21 14:52:49 +00:00
export const cssForPhablet = (cssArg: CSSResult) => {
2021-11-21 15:08:27 +00:00
return unsafeCSS(`
2022-03-02 18:00:52 +00:00
@container wccToolsViewport (max-width: ${phablet}px) {
2021-11-21 14:52:49 +00:00
${cssArg.cssText}
}
2021-11-26 16:36:00 +00:00
@media (max-width: ${phablet}px) {
2021-11-21 14:52:49 +00:00
${cssArg.cssText}
}
2021-11-21 15:08:27 +00:00
`);
2020-05-23 15:00:01 +00:00
};
2021-11-21 14:52:49 +00:00
export const cssForPhone = (cssArg: CSSResult) => {
2021-11-21 15:08:27 +00:00
return unsafeCSS(`
2022-03-02 18:00:52 +00:00
@container wccToolsViewport (max-width: ${phone}px) {
2021-11-21 14:52:49 +00:00
${cssArg.cssText}
}
2021-11-26 16:36:00 +00:00
@media (max-width: ${phone}px) {
2021-11-21 14:52:49 +00:00
${cssArg.cssText}
}
2021-11-21 15:08:27 +00:00
`);
2020-05-23 15:00:01 +00:00
};