Improve styling of the modal and select boxes

This commit is contained in:
Jos de Jong 2020-08-19 16:45:12 +02:00
parent 37fcdf85e2
commit 1ad834cf31
6 changed files with 33 additions and 16 deletions

View File

@ -1,13 +1,28 @@
@import '../../styles.scss'; @import '../../styles.scss';
.contents { .jsoneditor-modal {
padding: 20px; // styling for the select box,
// see docs: https://github.com/rob-balfre/svelte-select#styling
--height: 28px;
--clearSelectTop: 2px;
--clearSelectBottom: 2px;
--itemIsActiveBG: #3883fa; // theme-color
.contents {
padding: 20px;
.actions { .actions {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-end; justify-content: flex-end;
padding-top: $padding; padding-top: $padding;
}
} }
} }
// custom styling for the modal.
// FIXME: not neat to override global styles!
:global(.bg .window-wrap) {
margin-top: 10rem;
}

View File

@ -1,7 +1,7 @@
@import '../../styles.scss'; @import '../../styles.scss';
@import './Modal.scss'; @import './Modal.scss';
.sort-modal { .jsoneditor-modal.sort {
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
@ -14,4 +14,4 @@
padding-bottom: $padding; padding-bottom: $padding;
} }
} }
} }

View File

@ -21,11 +21,11 @@
const asc = { const asc = {
value: 1, value: 1,
label: 'asc' label: 'ascending'
} }
const desc = { const desc = {
value: -1, value: -1,
label: 'desc' label: 'descending'
} }
const directions = [ asc, desc ] const directions = [ asc, desc ]
@ -83,7 +83,7 @@
} }
</script> </script>
<div class="sort-modal"> <div class="jsoneditor-modal sort">
<Header title={isArray ? 'Sort array items' : 'Sort object keys'} /> <Header title={isArray ? 'Sort array items' : 'Sort object keys'} />
<div class="contents"> <div class="contents">
@ -115,6 +115,7 @@
<td> <td>
<Select <Select
items={directions} items={directions}
containerClasses='test-class'
bind:selectedValue={selectedDirection} bind:selectedValue={selectedDirection}
isClearable={false} isClearable={false}
/> />

View File

@ -7,7 +7,7 @@
const {close} = getContext('simple-modal') const {close} = getContext('simple-modal')
</script> </script>
<div class="transform-modal"> <div class="jsoneditor-modal transform">
<Header title='Transform' /> <Header title='Transform' />
<div class="contents"> <div class="contents">
TODO... TODO...

View File

@ -17,13 +17,14 @@ export const SIMPLE_MODAL_OPTIONS = {
styleBg: { styleBg: {
top: 0, top: 0,
left: 0, left: 0,
background: 'rgba(0, 0, 0, 0.3)' background: 'rgba(0, 0, 0, 0.3)',
justifyContent: 'normal'
}, },
styleWindow: { styleWindow: {
borderRadius: '2px' borderRadius: '2px'
}, },
styleContent: { styleContent: {
padding: '0px', padding: '0px',
overflow: 'visible' overflow: 'visible', // needed for select box dropdowns which are larger than the modal
} }
} }

View File

@ -64,4 +64,4 @@ button.primary {
&:disabled { &:disabled {
background: $gray; background: $gray;
} }
} }