_mixins.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. @mixin variable-font-size($basesize) {
  2. font-size: $basesize * 0.6;
  3. @include media-breakpoint-only(sm) {
  4. font-size: #{$basesize * 0.7};
  5. }
  6. @include media-breakpoint-only(md) {
  7. font-size: #{$basesize * 0.8};
  8. }
  9. @include media-breakpoint-only(lg) {
  10. font-size: #{$basesize * 0.9};
  11. }
  12. @include media-breakpoint-up(xl) {
  13. font-size: $basesize;
  14. }
  15. }
  16. @mixin expand-editor($editor-margin-top) {
  17. $header-plus-footer: $editor-margin-top + $grw-editor-navbar-bottom-height;
  18. $editor-margin: $header-plus-footer //
  19. + 25px // add .btn-open-dropzone height
  20. + 30px; // add .navbar-editor height
  21. .main {
  22. width: 100%;
  23. height: calc(100vh - #{$editor-margin-top});
  24. margin-top: 0px !important;
  25. .grw-container-convertible {
  26. max-width: unset;
  27. padding: 0;
  28. margin: 0;
  29. }
  30. &,
  31. .content-main,
  32. .tab-content {
  33. display: flex;
  34. flex: 1;
  35. flex-direction: column;
  36. .tab-pane {
  37. height: calc(100vh - #{$header-plus-footer});
  38. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  39. }
  40. #page-editor {
  41. // right(preview)
  42. &,
  43. & > .row,
  44. .page-editor-preview-container,
  45. .page-editor-preview-body {
  46. height: calc(100vh - #{$header-plus-footer});
  47. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  48. }
  49. // left(editor)
  50. .page-editor-editor-container {
  51. height: calc(100vh - #{$header-plus-footer});
  52. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  53. .react-codemirror2,
  54. .CodeMirror,
  55. .CodeMirror-scroll,
  56. .textarea-editor {
  57. height: calc(100vh - #{$editor-margin});
  58. }
  59. }
  60. }
  61. #page-editor-with-hackmd {
  62. &,
  63. .hackmd-preinit,
  64. .hackmd-error,
  65. #iframe-hackmd-container > iframe {
  66. width: 100%;
  67. height: calc(100vh - #{$header-plus-footer});
  68. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  69. }
  70. }
  71. }
  72. }
  73. }
  74. @mixin expand-modal-fullscreen($hasModalHeader: true, $hasModalFooter: true) {
  75. // full-screen modal
  76. width: auto;
  77. max-width: unset !important;
  78. height: calc(100vh - 30px);
  79. margin: 15px !important;
  80. .modal-content {
  81. height: calc(100vh - 30px);
  82. }
  83. // expand .modal-body (with calculating height)
  84. .modal-body {
  85. $modal-header: 54px;
  86. $modal-footer: 46px;
  87. $margin: 0px;
  88. @if $hasModalHeader {
  89. $margin: $margin + $modal-header;
  90. }
  91. @if $hasModalFooter {
  92. $margin: $margin + $modal-footer;
  93. }
  94. height: calc(100% - #{$margin});
  95. }
  96. }
  97. @mixin apply-navigation-transition() {
  98. transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
  99. transition-duration: 300ms;
  100. }
  101. @mixin border-vertical($beforeOrAfter, $borderLength, $zIndex: initial, $isBtnGroup: false) {
  102. position: relative;
  103. @if $isBtnGroup {
  104. &:not(:first-child) {
  105. margin-left: 0;
  106. border-left: none;
  107. }
  108. &:not(:last-child) {
  109. border-right: none;
  110. }
  111. }
  112. &:not(:first-child) {
  113. &::#{$beforeOrAfter} {
  114. position: absolute;
  115. top: calc((100% - #{$borderLength}) / 2);
  116. left: 0;
  117. z-index: $zIndex;
  118. width: 100%;
  119. height: $borderLength;
  120. margin-left: -0.5px;
  121. content: '';
  122. border-left: 1px solid transparent;
  123. transition: border-color 0.15s ease-in-out;
  124. }
  125. }
  126. }
  127. @mixin blink-bgcolor($bgcolor) {
  128. @keyframes fadeout {
  129. 100% {
  130. opacity: 0;
  131. }
  132. }
  133. position: relative;
  134. z-index: 1;
  135. &::after {
  136. position: absolute;
  137. top: 15%;
  138. left: 0;
  139. z-index: -1;
  140. width: 100%;
  141. height: 70%;
  142. content: '';
  143. background-color: $bgcolor;
  144. border-radius: 2px;
  145. animation: fadeout 1s ease-in 1.5s forwards;
  146. }
  147. }