Skip to content

Commit 96e3285

Browse files
authored
optimization: remove magic number (marktext#403)
1 parent afd633f commit 96e3285

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

src/renderer/app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138

139139
<style scoped>
140140
.editor-container {
141-
padding-top: 25px;
141+
padding-top: var(--titleBarHeight);
142142
}
143143
.editor-container .hide {
144144
z-index: -1;
@@ -148,7 +148,7 @@
148148
}
149149
.editor-middle {
150150
display: flex;
151-
min-height: calc(100vh - 25px);
151+
min-height: calc(100vh - var(--titleBarHeight));
152152
& > .editor {
153153
flex: 1;
154154
}

src/renderer/components/editorWithTabs/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
flex: 1;
6363
display: flex;
6464
flex-direction: column;
65-
height: calc(100vh - 25px);
65+
height: calc(100vh - var(--titleBarHeight));
6666
overflow: hidden;
6767
& > .container {
6868
flex: 1;

src/renderer/components/editorWithTabs/sourceCode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122

123123
<style>
124124
.source-code {
125-
height: calc(100vh - 25px);
125+
height: calc(100vh - var(--titleBarHeight));
126126
box-sizing: border-box;
127127
overflow: auto;
128128
}

src/renderer/components/sideBar/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<style scoped>
143143
.side-bar {
144144
display: flex;
145-
height: calc(100vh - 25px);
145+
height: calc(100vh - var(--titleBarHeight));
146146
position: relative;
147147
color: var(--secondaryColor);
148148
}

src/renderer/components/titleBar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
-webkit-app-region: drag;
168168
user-select: none;
169169
width: 100%;
170-
height: 25px;
170+
height: var(--titleBarHeight);
171171
box-sizing: border-box;
172172
color: #F2F6FC;
173173
position: fixed;
@@ -189,7 +189,7 @@
189189
.title {
190190
padding: 0 100px;
191191
height: 100%;
192-
line-height: 25px;
192+
line-height: var(--titleBarHeight);
193193
font-size: 14px;
194194
text-align: center;
195195
transition: all .25s ease-in-out;
@@ -266,8 +266,8 @@
266266
.frameless-titlebar-button {
267267
position: relative;
268268
display: block;
269-
width: 25px;
270-
height: 25px;
269+
width: var(--titleBarHeight);
270+
height: var(--titleBarHeight);
271271
}
272272
.frameless-titlebar-button > div {
273273
position: absolute;

src/renderer/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
--darkInputBgColor: rgb(54, 55, 49);
1010
--darkInputColor: rgb(255, 255, 255);
1111
--darkHoverColor: rgb(70, 70, 70);
12+
--titleBarHeight: 25px;
1213
}
1314
.icon {
1415
width: 1em; height: 1em;

0 commit comments

Comments
 (0)