_modal.scss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @mixin expand-modal-fullscreen($hasModalHeader: true, $hasModalFooter: true, $margin: 1rem, $css-modules: false) {
  2. // full-screen modal
  3. width: auto;
  4. max-width: unset !important;
  5. height: calc(100vh - $margin * 2);
  6. margin: $margin !important;
  7. // Use :global() for CSS Modules to keep Bootstrap class names unhashed
  8. @if $css-modules {
  9. :global(.modal-content) {
  10. height: calc(100vh - $margin * 2);
  11. }
  12. } @else {
  13. .modal-content {
  14. height: calc(100vh - $margin * 2);
  15. }
  16. }
  17. // expand .modal-body (with calculating height)
  18. $modal-header: 54px;
  19. $modal-footer: 46px;
  20. $margin-body: 0;
  21. @if $hasModalHeader {
  22. $margin-body: $margin-body + $modal-header;
  23. }
  24. @if $hasModalFooter {
  25. $margin-body: $margin-body + $modal-footer;
  26. }
  27. @if $css-modules {
  28. :global(.modal-body) {
  29. height: calc(100% - #{$margin-body});
  30. padding: $margin;
  31. }
  32. } @else {
  33. .modal-body {
  34. height: calc(100% - #{$margin-body});
  35. padding: $margin;
  36. }
  37. }
  38. }
  39. // expanded window layout
  40. .modal-dialog.grw-modal-expanded {
  41. @include expand-modal-fullscreen(true, true);
  42. }
  43. // expanded window layout without modal-header & modal-footer
  44. .modal-dialog.grw-body-only-modal-expanded {
  45. @include expand-modal-fullscreen(false, false);
  46. }