Skip to content

Commit 59024ee

Browse files
hagaygocoderaiser
andauthored
refactor: css: query: move width consts to css variables (#424)
* Move const panel width from code to css variables * Update css/query.css * Update css/query.css --------- Co-authored-by: coderaiser <[email protected]>
1 parent 62af673 commit 59024ee

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

client/client.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ function CloudCmdProto(DOM) {
5959
this.prefixSocket = '';
6060
this.prefixURL = '';
6161

62-
this.MIN_ONE_PANEL_WIDTH = 1155;
63-
this.MOBILE_ONE_PANEL_WIDTH = 600;
62+
var bodyStyle = getComputedStyle(document.body);
63+
this.MIN_ONE_PANEL_WIDTH = bodyStyle.getPropertyValue("--min-one-panel-width");
64+
this.MOBILE_ONE_PANEL_WIDTH = bodyStyle.getPropertyValue('--mobile-max-width')
65+
6466
this.HOST = location.origin || location.protocol + '//' + location.host;
6567

6668
this.TITLE = 'Cloud Commander';

css/query.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
width: 15%;
2020
}
2121
}
22-
22+
:root {
23+
--mobile-max-width: 600px;
24+
--min-one-panel-width: 1155px;
25+
}
2326
@media only screen and (height <= 900px) and (width <= 600px) {
2427
.fm {
2528
height: 85%;

0 commit comments

Comments
 (0)