Skip to content

Commit

Permalink
add styles for uniform width of controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Wilson committed Aug 22, 2023
1 parent 8c66e9d commit 15e5706
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 23 deletions.
15 changes: 14 additions & 1 deletion src/lib/SchemaForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,23 @@
</form>

<style>
.jsonschema-form .actions {
margin: 12px 0;
}
.jsonschema-form :global(.jsonschema-form-controls) {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
.jsonschema-form :global(.jsonschema-form-controls > .jsonschema-form-control) {
flex-basis: 325px;
}
.jsonschema-form :global(.jsonschema-form-controls > .control-array),
.jsonschema-form :global(.jsonschema-form-controls > .control-object) {
flex-basis: 100%;
}
</style>

1 change: 1 addition & 0 deletions src/lib/controls/ArrayControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
.control-array-items {
list-style: none;
padding-left: 0;
width: 100%;
}
.control-array-items > li {
Expand Down
17 changes: 0 additions & 17 deletions src/lib/controls/ObjectControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,3 @@
</Accordion>
{/if}
{/if}


<style>
:global(.control-object) {
flex-basis: 100%;
}
:global(.control-object.smui-accordion > .smui-accordion__panel > .smui-paper__content) {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
:global(.control-object.smui-accordion > .smui-accordion__panel > .smui-paper__content > .control-object),
:global(.control-object.smui-accordion > .smui-accordion__panel > .smui-paper__content > .control-array) {
flex-basis: 100%;
}
</style>
6 changes: 1 addition & 5 deletions src/theme/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.control-object,
.control-array {

&.smui-accordion > .smui-accordion__panel {
&.smui-accordion > .smui-paper {

> .smui-accordion__header {
background-color: #E4E4E4;
Expand Down Expand Up @@ -36,9 +36,5 @@
color: #FFFFFF;
}
}

> .smui-paper__content > * {
flex-basis: 325px;
}
}
}

0 comments on commit 15e5706

Please sign in to comment.