Skip to content

Commit

Permalink
💄 [#4606] Amend styles for error state
Browse files Browse the repository at this point in the history
* The modal spacing is a cheeky workaround for tab error icons that would
  otherwise be cut off by the overflow: auto due to the desired scroll
  behaviour inside a form modal.
* The react-select styles ensure the border color of the select is consistent
  with other input types in the django admin style (red border if there are
  validation errors)
* The changelist styles ensure that items in a table row with validation
  errors don't break the (vertical) alignment between them - as soon as
  any has a validation error, its content will be pushed down so we need
  to align to the bottom of the table cell (like in the variables table
  styles).
  • Loading branch information
sergei-maertens committed Aug 19, 2024
1 parent 3860bea commit 200bc36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/openforms/scss/components/admin/_ReactModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
}
}

&__header {
&:not(:last-child) {
margin-bottom: 1em;
}
&__header + * {
// leave room for absolute positioned elements that otherwise get cut off by the
// overflow: auto
padding-block-start: 1em;
}

&__close {
Expand Down
4 changes: 4 additions & 0 deletions src/openforms/scss/components/admin/_changelist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
padding-right: 1em;
}
}

tr.has-errors td {
vertical-align: bottom !important;
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/openforms/scss/vendor/_react-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
overflow: visible;
}

@at-root .errors &__control {
--border-color: var(--error-fg);
}

inline-size: clamp(200px, 100%, var(--of-admin-select-max-inline-size));
}

0 comments on commit 200bc36

Please sign in to comment.