_mixins.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @import 'layout_variable';
  2. @mixin variable-font-size($basesize) {
  3. font-size: $basesize * 0.6;
  4. @include media-breakpoint-only(sm) {
  5. font-size: #{$basesize * 0.7};
  6. }
  7. @include media-breakpoint-only(md) {
  8. font-size: #{$basesize * 0.8};
  9. }
  10. @include media-breakpoint-only(lg) {
  11. font-size: #{$basesize * 0.9};
  12. }
  13. @include media-breakpoint-only(xl) {
  14. font-size: $basesize;
  15. }
  16. }
  17. @mixin expand-editor($editor-header-plus-footer) {
  18. $header-plus-footer: $grw-navbar-height + $editor-header-plus-footer + 2px; // add .main padding-top
  19. $editor-margin: $header-plus-footer //
  20. + 25px // add .btn-open-dropzone height
  21. + 30px; // add .navbar-editor height
  22. .main {
  23. width: 100%;
  24. height: calc(100vh - #{$grw-navbar-height});
  25. padding-top: 2px;
  26. margin-top: 0px !important;
  27. &,
  28. .content-main,
  29. .tab-content {
  30. display: flex;
  31. flex: 1;
  32. flex-direction: column;
  33. .tab-pane#edit,
  34. .tab-pane#hackmd {
  35. height: calc(100vh - #{$header-plus-footer});
  36. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  37. }
  38. #page-editor {
  39. // right(preview)
  40. &,
  41. & > .row,
  42. .page-editor-preview-container,
  43. .page-editor-preview-body {
  44. height: calc(100vh - #{$header-plus-footer});
  45. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  46. }
  47. // left(editor)
  48. .page-editor-editor-container {
  49. height: calc(100vh - #{$header-plus-footer});
  50. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  51. .react-codemirror2,
  52. .CodeMirror,
  53. .CodeMirror-scroll,
  54. .textarea-editor {
  55. height: calc(100vh - #{$editor-margin});
  56. }
  57. }
  58. }
  59. #page-editor-with-hackmd {
  60. &,
  61. .hackmd-preinit,
  62. .hackmd-error,
  63. #iframe-hackmd-container > iframe {
  64. width: 100%;
  65. height: calc(100vh - #{$header-plus-footer});
  66. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  67. }
  68. }
  69. }
  70. }
  71. }
  72. @mixin expand-modal-fullscreen($hasModalHeader: true, $hasModalFooter: true) {
  73. // full-screen modal
  74. width: auto;
  75. max-width: unset;
  76. height: calc(100vh - 30px);
  77. margin: 15px;
  78. .modal-content {
  79. height: calc(100vh - 30px);
  80. }
  81. // expand .modal-body (with calculating height)
  82. .modal-body {
  83. $modal-header: 54px;
  84. $modal-footer: 46px;
  85. $margin: 0px;
  86. @if $hasModalHeader {
  87. $margin: $margin + $modal-header;
  88. }
  89. @if $hasModalFooter {
  90. $margin: $margin + $modal-footer;
  91. }
  92. height: calc(100% - #{$margin});
  93. }
  94. }