Skip to content

Commit 2eec4e6

Browse files
committedNov 8, 2023
fix: #337 some menu styling issues
1 parent 9ede6ea commit 2eec4e6

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed
 

‎src/lib/components/controls/Menu.scss

+19-11
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,35 @@
22

33
.jse-menu {
44
background: var(--jse-theme-color);
5-
border-bottom: 1px solid var(--jse-theme-color);
5+
font-family: var(--jse-font-family);
6+
font-size: var(--jse-font-size-main-menu);
67
color: var(--jse-menu-color);
78
display: flex;
89
flex-wrap: wrap;
9-
align-items: center;
10+
align-items: stretch;
1011
position: relative;
1112

1213
// FIXME: should utilize the generic styling in styles.scss
1314
.jse-button {
14-
width: var(--jse-menu-button-size);
15-
height: var(--jse-menu-button-size);
15+
font-family: inherit;
16+
font-size: inherit;
17+
line-height: 1.5em;
1618
border: none;
1719
background: transparent;
1820
color: inherit;
1921
cursor: pointer;
22+
23+
width: var(--jse-menu-button-size);
24+
height: var(--jse-menu-button-size);
2025
padding: $padding-half;
2126
margin: 0;
2227
border-radius: 0;
2328

29+
display: inline-flex;
30+
align-items: center;
31+
text-align: center;
32+
justify-content: center;
33+
2434
&:hover,
2535
&:focus {
2636
background: var(--jse-theme-color-highlight);
@@ -36,16 +46,16 @@
3646
&.jse-group-button {
3747
$group-button-color: var(--jse-menu-color);
3848

49+
width: auto;
50+
height: calc(var(--jse-menu-button-size) - $padding);
51+
margin: $padding-half 0;
52+
padding: 0 $padding-half 1px; // 1px bottom padding for better center alignment (text baseline)
3953
border: 1px solid $group-button-color;
54+
4055
&:not(.jse-last) {
4156
border-right: none;
4257
}
4358

44-
padding: 0 $padding-half;
45-
margin: $padding-half 0;
46-
height: calc(var(--jse-menu-button-size) - var(--jse-padding));
47-
width: auto;
48-
4959
&.jse-first {
5060
margin-left: $padding-half;
5161
}
@@ -75,9 +85,7 @@
7585

7686
background: var(--jse-menu-color);
7787
opacity: 0.3;
78-
box-sizing: border-box;
7988
width: 1px;
80-
height: calc(var(--jse-menu-button-size) - 2 * $margin);
8189
margin: $margin;
8290
}
8391
}

‎src/lib/components/modes/treemode/JSONNode.scss

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
.jse-json-node {
44
position: relative;
5+
font-family: var(--jse-font-family-mono);
6+
font-size: var(--jse-font-size-mono);
57
color: var(--jse-text-color);
68

79
&.jse-root {

‎src/lib/components/modes/treemode/TreeMode.scss

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
background: var(--jse-background-color);
99
min-width: 0;
1010
min-height: 0;
11-
font-family: var(--jse-font-family-mono);
12-
font-size: var(--jse-font-size-mono);
1311
color: var(--jse-text-color);
1412
line-height: var(--jse-line-height);
1513

‎src/lib/themes/jse-theme-default.css

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
--jse-font-family-mono: consolas, menlo, monaco, 'Ubuntu Mono', 'source-code-pro', monospace;
1010
--jse-font-size-mono: 14px;
1111
--jse-font-size: 16px;
12+
--jse-font-size-main-menu: 14px;
1213
--jse-font-size-text-mode-search: 80%;
1314
--jse-line-height: calc(1em + 4px);
1415
--jse-indent-size: calc(1em + 4px);

0 commit comments

Comments
 (0)
Please sign in to comment.