How can I add a new column in css dynamically (e.g. a button is toggled and a new component (I'm working with Svelte) appears in a new column), but without that (if viewport is too small) the new component skips to a new row. The already visible components should just get "squeezed".
my code (html):
<div class="entity-view">
<CorrespondenceNavigation entity = "{$entitiesStore.get(id)}"/>
{#if $entitiesStore.get(id).entityType === "person"}
<PersonView entity="{$entitiesStore.get(id)}" />
{:else}
<div class = "reading-version-view-and-facsimile">
<div class = "reading-version">
{#if $entitiesStore.get(id).showReadingView}
<ReadingVersionView entity="{$entitiesStore.get(id)}" />
{/if}
</div>
{#if $entitiesStore.get(id).showFacsimile}
<FacsimileView entity="{$entitiesStore.get(id)}" />
{/if}
<div class = "marginal">
<MarginalColumnView entity="{$entitiesStore.get(id)}" />
</div>
</div>
{/if}
</div>
my css:
.entity-view {
width: 100%;
height: auto;
overflow: hidden;
padding: 45px;
box-sizing: border-box;
}
.reading-version-view-and-facsimile{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.reading-version {
grid-column: span 1.42;
}
.marginal{
position: relative;
margin-left: 7em;
}
at the moment the .marginal skips to a new row and doesn't stay in place and when toggling the Facsimile-View, die ReadingVersionView doesn't move one bit and it just "overlays".
I hope my question is clear enough. Thanks a lot!