Skip to content

Commit

Permalink
Merge pull request #28 from unisonweb/workspace-pane-widths
Browse files Browse the repository at this point in the history
Update WorkspacePanes to better handle scroll and overflow
  • Loading branch information
hojberg authored Jan 7, 2025
2 parents b9f1686 + 2a54643 commit b8c3c72
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
20 changes: 18 additions & 2 deletions src/css/ucm/workspace/workspace-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--c-workspace-card_border: var(--u-color_border_subdued);
--c-workspace-card_background: var(--u-color_container_faded);
--c-workspace-card_width: calc(var(--readable-column-width-medium) + 2rem);
--c-width_doc_inner-content: var(--c-workspace-card_width);


display: flex;
flex-direction: column;
Expand Down Expand Up @@ -61,7 +61,7 @@
flex-direction: column;
gap: 0;
padding: 0.75rem;
max-width: min(calc(var(--c-workspace-card_width) - 1.5rem), 100%);
width: 100%;
}

& .workspace-card_loading {
Expand Down Expand Up @@ -91,3 +91,19 @@
background: var(--u-color_container);
}
}

.workspace-card .definition-doc {
--c-width_doc_inner-content: 100%;
--c-width_doc_source: 100%;
}

@container workspace-pane (max-width: 968px) {
/* TODO: these are the styles from ui-core. This container query probably
* belongs there showhow */
.workspace-card aside {
position: relative;
right: auto;
width: auto;
margin: 1.5rem 1.5rem 1.5rem 1.5rem;
}
}
6 changes: 5 additions & 1 deletion src/css/ucm/workspace/workspace-pane.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
gap: 0.75rem;
padding: 0.75rem;
overflow: auto;
width: min(var(--c-workspace-card_width), 100%);
width: 100%;
/*min-width: max-content;*/

container-type: inline-size;
container-name: workspace-pane;

& .error {
display: flex;
Expand Down
16 changes: 14 additions & 2 deletions src/css/ucm/workspace/workspace-panes.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
}

.workspace-panes .workspace-card {
width: 100%;
min-width: max-content;
--c-workspace-card_width: 100%;
}

/* TODO: these are the styles from ui-core. Would be better if it were more
* dynamic somehow */
.workspace-panes .workspace-card aside {
position: relative;
right: auto;
width: auto;
margin: 1.5rem 1.5rem 1.5rem 1.5rem;
}

.workspace-panes .workspace-card_main-content:has(>.rich) {
overflow-x: auto;
}

0 comments on commit b8c3c72

Please sign in to comment.