Skip to content

Commit 1f0d26d

Browse files
authored
Merge pull request #53 from tilde-lab/fix_19.05.2020
fix_19.05.2020
2 parents 882c8ff + c1d2f02 commit 1f0d26d

File tree

3 files changed

+70
-7
lines changed

3 files changed

+70
-7
lines changed

src/components/JSON/code.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pre[class*='language-'] {
3232
border-radius: $border-radius !important;
3333
line-height: 1.5 !important;
3434
text-shadow: none !important;
35+
overflow-wrap: anywhere !important;
36+
overflow-y: inherit !important;
37+
white-space: pre-wrap !important;
3538
}
3639

3740
pre[class*='language-']::selection,
@@ -191,3 +194,38 @@ code[class*='language-'] ::selection {
191194
color: $gray-color;
192195
}
193196
}
197+
198+
[color-scheme='light'] {
199+
code[class*='language-'],
200+
pre[class*='language-'] {
201+
color: lighten($body-font-color, 10%) !important;
202+
background: $bg-color !important;
203+
}
204+
205+
pre[class*='language-']::selection,
206+
pre[class*='language-'] ::selection,
207+
code[class*='language-']::selection,
208+
code[class*='language-'] ::selection {
209+
background: $highlight-color !important;
210+
}
211+
212+
.token.comment,
213+
.token.prolog,
214+
.token.doctype,
215+
.token.cdata {
216+
color: $gray-color;
217+
}
218+
219+
.token.punctuation {
220+
color: $gray-color;
221+
}
222+
223+
.token.selector,
224+
.token.attr-name,
225+
.token.string,
226+
.token.char,
227+
.token.builtin,
228+
.token.inserted {
229+
color: $gray-color;
230+
}
231+
}

src/components/JSON/jsontree/jsontree.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
@import '../vars.scss';
22

3+
[color-scheme='light'] {
4+
.json-container {
5+
.line {
6+
&.click {
7+
&:hover {
8+
background-color: $secondary-color;
9+
}
10+
}
11+
}
12+
}
13+
}
14+
@media (prefers-color-scheme: dark) {
15+
.json-container {
16+
.line {
17+
&.click {
18+
&:hover {
19+
background-color: $secondary-color;
20+
}
21+
}
22+
}
23+
}
24+
}
25+
326
.json-container {
427
::selection {
528
text-shadow: none;

src/views/Result.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</div>
44
<div class="pt-2">
55
<Grid>
6-
<Col col="6" md="12">
6+
<Col md="12">
77
{#if data}
88
<Input bind:value={filter} placeholder="Field name..." />
99
<small class="form-text text-muted"> Filter data object by field name. </small>
@@ -12,8 +12,8 @@
1212
<JSON.Editor style="width: 100%; height: 400px; margin-top: 0;" on:change={(e) => (code = e.detail)} />
1313
{/if}
1414
</Col>
15-
<Divider text={windowWidth <= 600 ? '' : ''} align={windowWidth <= 600 ? 'horizontal center' : 'vertical'} />
16-
<Col col="5" md="12">
15+
<Divider text={$media.md ? '' : ''} align={$media.md ? 'horizontal center' : 'vertical'} />
16+
<Col md="12">
1717
<ModuleSelect bind:selectedValue={module} />
1818
<br />
1919
<Hero size="sm" bg={$darkTheme ? 'dark' : 'gray'}>
@@ -25,21 +25,20 @@
2525
</Grid>
2626
</div>
2727

28-
<svelte:window bind:innerWidth={windowWidth} />
29-
3028
<script lang="ts" context="module">
3129
import { Col, Divider, Grid, Hero, Input, Steps } from 'svelte-spectre';
3230
import { darkTheme } from '@/stores/theme';
3331
3432
import ModuleSelect from '@/views/ModuleSelect/ModuleSelect.svelte';
3533
import * as JSON from '@/components/JSON';
3634
35+
import { media } from '@/stores/media';
36+
3737
const steps = [{ label: 'Optimade JSON' }, { label: 'Optimade app' }];
3838
</script>
3939

4040
<script lang="ts">
41-
export let data: Record<string, never> | null | undefined = null,
42-
windowWidth = 0;
41+
export let data: Record<string, never> | null | undefined = null;
4342
4443
let code: string;
4544
let module: any;
@@ -77,4 +76,7 @@
7776
top: 0;
7877
width: 100%;
7978
}
79+
:global(.modal-fs .modal-container .modal-body .columns hr) {
80+
font-weight: bold;
81+
}
8082
</style>

0 commit comments

Comments
 (0)