Revert "ts: Convert css_variables.js to TypeScript."

This reverts commit 5f4bdfe6bc (#24630).

This was causing Webpack to trigger type checking with the TypeScript
compiler, which is very expensive.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-04-04 00:19:27 -07:00 committed by Tim Abbott
parent e9c1d72771
commit 620b1aa1bd
3 changed files with 40 additions and 34 deletions

View File

@ -73,7 +73,7 @@ EXEMPT_FILES = make_set(
"web/src/confirm_dialog.js",
"web/src/copy_and_paste.js",
"web/src/csrf.ts",
"web/src/css_variables.ts",
"web/src/css_variables.js",
"web/src/dark_theme.js",
"web/src/debug.ts",
"web/src/deprecated_feature_notice.js",

39
web/src/css_variables.js Normal file
View File

@ -0,0 +1,39 @@
/* eslint-env commonjs */
"use strict";
// Media query breakpoints according to Bootstrap 4.5
const xs = 0;
const sm = 576;
const md = 768;
const lg = 992;
const xl = 1200;
// Breakpoints for mobile devices used by Google Chrome as of Version 86
const ml = 425; // Mobile large
const mm = 375; // Mobile medium
const ms = 320; // Mobile small
module.exports = {
media_breakpoints: {
xs_min: xs + "px",
sm_min: sm + "px",
md_min: md + "px",
lg_min: lg + "px",
xl_min: xl + "px",
ml_min: ml + "px",
mm_min: mm + "px",
ms_min: ms + "px",
},
media_breakpoints_num: {
xs,
sm,
md,
lg,
xl,
ml,
mm,
ms,
},
};

View File

@ -1,33 +0,0 @@
// Media query breakpoints according to Bootstrap 4.5
const xs = 0;
const sm = 576;
const md = 768;
const lg = 992;
const xl = 1200;
// Breakpoints for mobile devices used by Google Chrome as of Version 86
const ml = 425; // Mobile large
const mm = 375; // Mobile medium
const ms = 320; // Mobile small
export const media_breakpoints = {
xs_min: `${xs}px`,
sm_min: `${sm}px`,
md_min: `${md}px`,
lg_min: `${lg}px`,
xl_min: `${xl}px`,
ml_min: `${ml}px`,
mm_min: `${mm}px`,
ms_min: `${ms}px`,
};
export const media_breakpoints_num = {
xs,
sm,
md,
lg,
xl,
ml,
mm,
ms,
};