Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/components/JSON/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ pre[class*='language-'] {
border-radius: $border-radius !important;
line-height: 1.5 !important;
text-shadow: none !important;
overflow-wrap: anywhere !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important should not be used
Line should be indented 2 spaces, but was indented 4 spaces

overflow-y: inherit !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important should not be used
Line should be indented 2 spaces, but was indented 4 spaces

white-space: pre-wrap !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important should not be used
Line contains trailing whitespace
Line should be indented 2 spaces, but was indented 4 spaces

}

pre[class*='language-']::selection,
Expand Down Expand Up @@ -191,3 +194,38 @@ code[class*='language-'] ::selection {
color: $gray-color;
}
}

[color-scheme='light'] {
code[class*='language-'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying attribute selectors with an element.
Line should be indented 2 spaces, but was indented 4 spaces

pre[class*='language-'] {
color: lighten($body-font-color, 10%) !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important should not be used
Properties should be ordered background, color

background: $bg-color !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important should not be used

}

pre[class*='language-']::selection,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying attribute selectors with an element.
Line should be indented 2 spaces, but was indented 4 spaces
Selector should have depth of applicability no greater than 2, but was 3

pre[class*='language-'] ::selection,
code[class*='language-']::selection,
code[class*='language-'] ::selection {
background: $highlight-color !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important should not be used

}

.token.comment,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

.token.prolog,
.token.doctype,
.token.cdata {
color: $gray-color;
}

.token.punctuation {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

color: $gray-color;
}

.token.selector,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: $gray-color;
}
}
23 changes: 23 additions & 0 deletions src/components/JSON/jsontree/jsontree.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
@import '../vars.scss';

[color-scheme='light'] {
.json-container {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

.line {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains trailing whitespace
Selector should have depth of applicability no greater than 2, but was 3

&.click {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains trailing whitespace
Selector should have depth of applicability no greater than 2, but was 3

&:hover {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nesting should be no greater than 4, but was 5
Selector should have depth of applicability no greater than 2, but was 3

background-color: $secondary-color;
}
}
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule declaration should be followed by an empty line

@media (prefers-color-scheme: dark) {
.json-container {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

.line {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains trailing whitespace

&.click {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains trailing whitespace

&:hover {
background-color: $secondary-color;
}
}
}
}
}

.json-container {
::selection {
text-shadow: none;
Expand Down
16 changes: 9 additions & 7 deletions src/views/Result.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</div>
<div class="pt-2">
<Grid>
<Col col="6" md="12">
<Col md="12">
{#if data}
<Input bind:value={filter} placeholder="Field name..." />
<small class="form-text text-muted"> Filter data object by field name. </small>
Expand All @@ -12,8 +12,8 @@
<JSON.Editor style="width: 100%; height: 400px; margin-top: 0;" on:change={(e) => (code = e.detail)} />
{/if}
</Col>
<Divider text={windowWidth <= 600 ? '↓' : '→'} align={windowWidth <= 600 ? 'horizontal center' : 'vertical'} />
<Col col="5" md="12">
<Divider text={$media.md ? '↓' : '→'} align={$media.md ? 'horizontal center' : 'vertical'} />
<Col md="12">
<ModuleSelect bind:selectedValue={module} />
<br />
<Hero size="sm" bg={$darkTheme ? 'dark' : 'gray'}>
Expand All @@ -25,21 +25,20 @@
</Grid>
</div>

<svelte:window bind:innerWidth={windowWidth} />

<script lang="ts" context="module">
import { Col, Divider, Grid, Hero, Input, Steps } from 'svelte-spectre';
import { darkTheme } from '@/stores/theme';

import ModuleSelect from '@/views/ModuleSelect/ModuleSelect.svelte';
import * as JSON from '@/components/JSON';

import { media } from '@/stores/media';

const steps = [{ label: 'Optimade JSON' }, { label: 'Optimade app' }];
</script>

<script lang="ts">
export let data: Record<string, never> | null | undefined = null,
windowWidth = 0;
export let data: Record<string, never> | null | undefined = null;

let code: string;
let module: any;
Expand Down Expand Up @@ -77,4 +76,7 @@
top: 0;
width: 100%;
}
:global(.modal-fs .modal-container .modal-body .columns hr) {
font-weight: bold;
}
</style>