Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

8.3 KB
Raw Blame
/**
 * The builder claims the shell's view rather than lengthening it, so a long chain scrolls *inside*
 * the graph while the header and the inspector stay put. A chain grows 112px per step, so it passes
 * a typical viewport at around five steps - and if the page scrolled instead, clicking a node near
 * the bottom would put the inspector (and Save) off-screen, which is the one interaction this whole
 * layout exists to serve.
 *
 * The shell already makes .portal-shell__view the scroll container, so height here resolves against
 * a definite box; capping the columns is what stops that view scrolling at all.
 */
.portal-builder {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 84rem;
  margin: 0 auto;
  height: 100%;
  min-height: 0;
}

/* The header and any banners keep their own size; only the grid absorbs (or gives up) space. Left
   to the flex default they would all shrink together and squash on a short viewport. */
.portal-builder > *:not(.portal-builder__grid) {
  flex: none;
}

.portal-builder__loading {
  display: flex;
  justify-content: center;
  padding: 4rem 0;
}

/* Two-pane layout */
.portal-builder__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  /* Takes whatever the header leaves, and pins the row to exactly that. `minmax(0, 1fr)` rather
     than the implicit `auto` row is what makes the columns' `max-height: 100%` mean anything: an
     auto row is sized BY its tallest item, so a long settings form would size the row to itself and
     then resolve its own 100% against it - capping nothing, and clipping the form with no scrollbar.
     `align-items: start` still lets a short column hug its content inside the bounded row. */
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  align-items: start;
}

/* Stacked, the inspector sits below the graph, so there is nothing to hold in view - and capping
   here would nest a scroll region inside a scrolling page, which is worse than a long page. Let the
   builder grow and hand scrolling back to the shell. */
@media (max-width: 60rem) {
  .portal-builder {
    height: auto;
  }

  .portal-builder__grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    flex: none;
  }
}

/* The input's source dropdown and its edit affordance, in the inspector. */
.portal-builder__input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.portal-builder__input-field {
  flex: 1 1 11rem;
  min-width: 10rem;
}

/* Tool picker */
/* The picker fills the modal hosting it rather than sitting in a card of its own: same surface,
   same radius, so a bordered box in here would frame nothing. Its rows carry the structure, and
   they run to the panel's edges - which is what lets the search divider span the full width. */
.portal-pipelines__picker-modal .sui-modal__body {
  padding: 0;
}

/* Holds the shared Input, which brings its own border/focus ring; the row just insets it and rules
   it off from the list below. */
.portal-pipelines__picker-search {
  padding: 0.75rem 0.75rem 0.625rem;
  border-bottom: 1px solid var(--c-border-subtle);
}

.portal-pipelines__picker-search .sui-input {
  width: 100%;
}

.portal-pipelines__picker-list {
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.portal-pipelines__picker-group-label {
  padding: 0.5rem 1.125rem 0.25rem;
  font-size: 0.6875rem;
  color: var(--c-text-subtle);
}

.portal-pipelines__picker-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  border: none;
  background: none;
  padding: 0.4375rem 1.125rem;
  text-align: left;
  cursor: pointer;
  color: var(--c-text);
  transition: background var(--motion-fast);
}

.portal-pipelines__picker-item:hover {
  background: var(--c-hover);
}

.portal-pipelines__picker-icon {
  display: inline-flex;
  align-items: center;
  color: var(--c-text-subtle);
  font-size: 1.125rem;
}

/* Tool icons arrive pre-sized from the registry (1.5rem) and brand marks at their own size, so
   the slot sizes whatever it is given to its font-size and the column reads as one set. */
.portal-pipelines__picker-icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

/* Name over its optional note - a two-line item, so the note reads as a sub-line rather than
   running straight on from the name. */
.portal-pipelines__picker-text {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}

.portal-pipelines__picker-name {
  font-size: 0.8125rem;
}

/* Why this tool cannot follow the step before it. Advisory: the item is still pickable, just dimmed
   and captioned so the reason is clear without shouting. */
.portal-pipelines__picker-note {
  font-size: 0.6875rem;
  color: var(--c-text-muted);
  white-space: normal;
  line-height: 1.3;
}

/* Muted via a token, not opacity: opacity on text drops the contrast below the floor. The name
   still reads as de-emphasised, and the icon (not text) can take the opacity. */
.portal-pipelines__picker-item.is-incompatible .portal-pipelines__picker-name {
  color: var(--c-text-muted);
}

.portal-pipelines__picker-item.is-incompatible .portal-pipelines__picker-icon {
  opacity: 0.55;
}

.portal-pipelines__picker-empty {
  padding: 1rem 1.125rem;
  font-size: 0.8125rem;
  color: var(--c-text-subtle);
  margin: 0;
}

/* The tool-picker item is the shared Button carrying bespoke styling, so re-assert its look over
   the design-system base (which otherwise imposes a fixed height, its own padding and an accent
   text colour). */
.portal-pipelines__picker-item.sui-btn {
  height: auto;
  min-height: 0;
  padding: 0.4375rem 1.125rem;
  font-weight: 400;
  color: var(--c-text);
}

.portal-pipelines__picker-item.sui-btn:hover {
  background: var(--c-hover);
}

/* A quiet way into the chosen source's own settings, beside its dropdown. */
.portal-builder__input-row .portal-builder__source-edit {
  color: var(--c-text-subtle);
}

/* A field label that carries an info icon explaining the choice. */
.portal-builder__label-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: help;
}

.portal-builder__label-hint svg {
  color: var(--c-text-subtle);
}

.portal-builder__input-row .portal-builder__source-edit:hover:not(:disabled) {
  color: var(--c-accent-fg, var(--c-primary));
}

/* The input's schedule row, its number field, and a builder-owned muted line. These lived in
   Pipelines.css and only rendered because the router bundles both views together; a code-split (or
   any Storybook story of the builder alone) left them unstyled. Kept here so the builder is
   self-contained. */
.portal-builder__schedule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-builder__schedule-count {
  width: 5rem;
}

.portal-builder__muted {
  font-size: 0.8125rem;
  color: var(--c-text-subtle);
  margin: 0;
}

/* The space-between button row shared by the builder's modal footers. */
.portal-builder__composer-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

/* The graph column IS the card: the test control is its header and the graph its body, so the test
   control reads as the graph's toolbar and - crucially - the card's top lines up with the inspector
   beside it (a toolbar sitting *above* the card pushed the graph down out of alignment). Caps at the
   row height and clips its rounded corners; the body scrolls inside while the header stays put. */
.portal-builder__canvas {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--c-surface-sunken);
}

/* The test control as the card's header, ruled off from the graph below it. */
.portal-builder__canvas > .portal-pipeline-toolbar {
  flex: none;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border-subtle);
}

/* The graph as the card's body: it drops its own frame (the canvas provides it now) and scrolls
   inside while the header stays put. */
.portal-builder__canvas > .portal-graph {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* Stacked (short viewport): the page scrolls, so the column must not cap or nest its own scroll. */
@media (max-width: 60rem) {
  .portal-builder__canvas {
    max-height: none;
  }
}