Skip to content

Commit 2b9476d

Browse files
committed
increase readability
1 parent f79f873 commit 2b9476d

File tree

3 files changed

+72
-48
lines changed

3 files changed

+72
-48
lines changed

client/modules/IDE/components/show-hint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
}
229229

230230
function displayHint(name, type) {
231-
return `<p>\
231+
return `<p class="${type}-item">\
232232
<span class="${type}-name hint-name">${name}</span>\
233233
<span class="hint-hidden">, </span>\
234234
<span class="hint-type">${type}</span>\
@@ -275,7 +275,7 @@
275275
cur.displayText = displayHint(name, cur.item.type);
276276
}
277277
elt.appendChild(e);
278-
e.outerHTML = cur.displayText || getText(cur);
278+
e.outerHTML = cur.displayText || `<span class="plain-hint-item">${getText(cur)}<span>`;
279279
}
280280
elt.hintId = i;
281281
}

client/styles/abstracts/_variables.scss

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,19 @@ $themes: (
120120

121121
hint-background-color: $white,
122122
hint-text-color: $dark,
123-
hint-item-border-bottom: 1px solid $lighter,
123+
hint-item-border-bottom-color: $white,
124124
hint-fun-text-color: #0B7CA9,
125125
hint-var-text-color: #D52889,
126-
hint-type-text-color: $middle-dark,
126+
hint-type-text-color: $medium-dark,
127127
hint-arrow-color: $lightest,
128-
hint-arrow-background-color: #ed225dcc,
129-
hint-arrow-background-active-color: $p5js-pink,
130-
hint-arrow-focus-outline-color: #cfcfcf,
128+
hint-arrow-background-color: #ed225ddd,
129+
hint-arrow-background-active-color: $p5js-active-pink,
130+
hint-arrow-focus-outline-color: $middle-gray,
131131
hint-item-hover-background-color: #f4f4f4,
132-
hint-item-active-text-color: unset,
133-
hint-item-active-background-color: #cfcfcf,
132+
hint-item-active-text-color: $white,
133+
hint-item-active-background-color: $middle-gray,
134+
hint-fun-active-border-bottom-color: #0B7CA9,
135+
hint-var-active-border-bottom-color: #D52889,
134136
hint-item-active-type-text-color: $white,
135137
hint-item-active-outline: none,
136138
hint-item-active-outline-offset: 0
@@ -216,18 +218,20 @@ $themes: (
216218
form-navigation-options-color: $middle-light,
217219

218220
hint-background-color: $darker,
219-
hint-text-color: #E0D7D1,
220-
hint-item-border-bottom: 1px solid $middle-dark,
221+
hint-text-color: $light,
222+
hint-item-border-bottom-color: $darker,
221223
hint-fun-text-color: #0F9DD7,
222224
hint-var-text-color: #DE4A9B,
223-
hint-type-text-color: #E0D7D1,
224-
hint-arrow-color: #FDFDFD,
225-
hint-arrow-background-color: #ed225dcc,
226-
hint-arrow-background-active-color: $p5js-pink,
225+
hint-type-text-color: $light,
226+
hint-arrow-color: $lightest,
227+
hint-arrow-background-color: #ed225ddd,
228+
hint-arrow-background-active-color: $p5js-active-pink,
227229
hint-arrow-focus-outline-color: #cfcfcf,
228-
hint-item-hover-background-color: $middle-dark,
230+
hint-item-hover-background-color: $medium-dark,
229231
hint-item-active-text-color: $darker,
230232
hint-item-active-background-color: #cfcfcf,
233+
hint-fun-active-border-bottom-color: #0F9DD7,
234+
hint-var-active-border-bottom-color: #DE4A9B,
231235
hint-item-active-type-text-color: $darker,
232236
hint-item-active-outline: none,
233237
hint-item-active-outline-offset: 0
@@ -312,21 +316,23 @@ $themes: (
312316
form-secondary-title-color: $medium-light,
313317
form-navigation-options-color: $middle-light,
314318

315-
hint-background-color: $darker,
316-
hint-text-color: #c1c1c1,
317-
hint-item-border-bottom: 1px solid #333,
319+
hint-background-color: $darkest,
320+
hint-text-color: $medium-light,
321+
hint-item-border-bottom-color: $medium-dark,
318322
hint-fun-text-color: #00FFFF,
319323
hint-var-text-color: #FFA9D9,
320-
hint-type-text-color: #c1c1c1,
321-
hint-arrow-color: #333,
322-
hint-arrow-background-color: #F5DC23CC,
324+
hint-type-text-color: $middle-light,
325+
hint-arrow-color: $darker,
326+
hint-arrow-background-color: #F5DC23DD,
323327
hint-arrow-background-active-color: #F5DC23,
324-
hint-arrow-focus-outline-color: #FDFDFD,
325-
hint-item-hover-background-color: #454545,
326-
hint-item-active-text-color: #FDFDFD,
328+
hint-arrow-focus-outline-color: $lighter,
329+
hint-item-hover-background-color: $dark,
330+
hint-item-active-text-color: $lighter,
327331
hint-item-active-background-color: unset,
328-
hint-item-active-type-text-color: #FDFDFD,
329-
hint-item-active-outline: 2px solid #FDFDFD,
332+
hint-fun-active-border-bottom-color: none,
333+
hint-var-active-border-bottom-color: none,
334+
hint-item-active-type-text-color: $lighter,
335+
hint-item-active-outline: 2px solid $lighter,
330336
hint-item-active-outline-offset: -2px
331337
)
332338
);

client/styles/components/_hints.scss

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
.CodeMirror-hint {
2626
color: getThemifyVariable('hint-text-color');
27-
border-bottom: getThemifyVariable('hint-item-border-bottom');
27+
border-bottom: #{1 / $base-font-size}rem solid getThemifyVariable('hint-item-border-bottom-color');
2828
}
2929

3030
.fun-name {
@@ -43,33 +43,35 @@
4343
color: getThemifyVariable('hint-arrow-color');
4444
background: getThemifyVariable('hint-arrow-background-color');
4545

46-
&:hover, &:active {
46+
&:hover, &:active, &.focused-hint-link {
4747
background: getThemifyVariable('hint-arrow-background-active-color');
4848
}
4949

5050
&.focused-hint-link {
51-
outline: 2px solid getThemifyVariable('hint-arrow-focus-outline-color');
52-
outline-offset: -2px;
51+
outline: #{4 / $base-font-size}rem solid getThemifyVariable('hint-arrow-focus-outline-color');
52+
outline-offset: #{-2 / $base-font-size}rem;
5353
}
5454
}
5555

56-
li.CodeMirror-hint-active {
57-
color: getThemifyVariable('hint-item-active-text-color');
56+
li.CodeMirror-hint-active:not(.unfocused) {
5857
background: getThemifyVariable('hint-item-active-background-color');
5958
outline: getThemifyVariable('hint-item-active-outline');
6059
outline-offset: getThemifyVariable('hint-item-active-outline-offset');
61-
62-
.hint-type {
63-
color: getThemifyVariable('hint-item-active-type-text-color');
60+
61+
.fun-item {
62+
border-bottom: #{2 / $base-font-size}rem solid getThemifyVariable('hint-fun-active-border-bottom-color');
6463
}
6564

66-
&.unfocused {
67-
background: getThemifyVariable('hint-background-color') !important;
68-
outline: unset !important;
65+
.var-item {
66+
border-bottom: #{2 / $base-font-size}rem solid getThemifyVariable('hint-var-active-border-bottom-color');
67+
}
6968

70-
.hint-type {
71-
color: getThemifyVariable('hint-type-text-color') !important;
72-
}
69+
.hint-name {
70+
color: getThemifyVariable('hint-item-active-text-color');
71+
}
72+
73+
.hint-type, .plain-hint-item {
74+
color: getThemifyVariable('hint-item-active-type-text-color');
7375
}
7476
}
7577

@@ -81,20 +83,34 @@
8183
.CodeMirror-hint {
8284
position: relative;
8385
margin: 0;
84-
padding: 0.5rem 0 0.5rem #{5 / $base-font-size}rem;
86+
padding: 0;
8587
height: 2rem;
86-
font-size: inherit;
8788
white-space: pre;
8889
cursor: pointer;
89-
border-bottom: #{1 / $base-font-size}rem solid;
90+
91+
&:only-child, &:last-child {
92+
border-bottom: none !important;
93+
}
94+
95+
p {
96+
display: block;
97+
width: 100%;
98+
height: 100%;
99+
}
90100

91-
.hint-name{
92-
font-weight: bold;
101+
.hint-name, .plain-hint-item {
102+
display: inline-block;
103+
margin: 0.4rem auto 0.4rem 0.4rem;
104+
font-size: 1.2rem;
105+
line-height: 100%;
106+
font-weight: 700;
93107
}
94108

95109
.hint-type {
96110
float: right;
97-
margin: 0 calc(2rem + #{5 / $base-font-size}rem) 0 0;
111+
margin: 0.5rem 2.4rem 0.5rem auto;
112+
font-size: 1rem;
113+
line-height: 100%;
98114
}
99115

100116
.hint-hidden {
@@ -109,6 +125,8 @@
109125
width: calc(2rem - #{1 / $base-font-size}rem);
110126
margin: 0;
111127
padding-top: 0.4rem;
128+
font-size: 1.2rem;
129+
line-height: 100%;
112130
text-align: center;
113131
outline: none;
114132
z-index: 1;

0 commit comments

Comments
 (0)