_mixins.scss 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. @use './bootstrap/init' as bs;
  2. @mixin variable-font-size($basesize) {
  3. font-size: $basesize * 0.6;
  4. @include bs.media-breakpoint-only(sm) {
  5. font-size: #{$basesize * 0.7};
  6. }
  7. @include bs.media-breakpoint-only(md) {
  8. font-size: #{$basesize * 0.8};
  9. }
  10. @include bs.media-breakpoint-only(lg) {
  11. font-size: #{$basesize * 0.9};
  12. }
  13. @include bs.media-breakpoint-up(xl) {
  14. font-size: $basesize;
  15. }
  16. }
  17. @mixin expand-editor($editor-margin-top) {
  18. $header-plus-footer: $editor-margin-top + $grw-editor-navbar-bottom-height;
  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 - #{$editor-margin-top});
  25. margin-top: 0px !important;
  26. .grw-container-convertible {
  27. max-width: unset;
  28. padding: 0;
  29. margin: 0;
  30. }
  31. &,
  32. .content-main,
  33. .tab-content {
  34. display: flex;
  35. flex: 1;
  36. flex-direction: column;
  37. .tab-pane {
  38. height: calc(100vh - #{$header-plus-footer});
  39. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  40. }
  41. #page-editor {
  42. // right(preview)
  43. &,
  44. & > .row,
  45. .page-editor-preview-container,
  46. .page-editor-preview-body {
  47. height: calc(100vh - #{$header-plus-footer});
  48. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  49. }
  50. // left(editor)
  51. .page-editor-editor-container {
  52. height: calc(100vh - #{$header-plus-footer});
  53. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  54. .react-codemirror2,
  55. .CodeMirror,
  56. .CodeMirror-scroll,
  57. .textarea-editor {
  58. height: calc(100vh - #{$editor-margin});
  59. }
  60. }
  61. }
  62. #page-editor-with-hackmd {
  63. &,
  64. .hackmd-preinit,
  65. .hackmd-error,
  66. #iframe-hackmd-container > iframe {
  67. width: 100%;
  68. height: calc(100vh - #{$header-plus-footer});
  69. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  70. }
  71. }
  72. }
  73. }
  74. }
  75. @mixin apply-navigation-transition() {
  76. transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
  77. transition-duration: 300ms;
  78. }
  79. @mixin border-vertical($beforeOrAfter, $borderLength, $zIndex: initial, $isBtnGroup: false) {
  80. position: relative;
  81. @if $isBtnGroup {
  82. &:not(:first-child) {
  83. margin-left: 0;
  84. border-left: none;
  85. }
  86. &:not(:last-child) {
  87. border-right: none;
  88. }
  89. }
  90. &:not(:first-child) {
  91. &::#{$beforeOrAfter} {
  92. position: absolute;
  93. top: calc((100% - #{$borderLength}) / 2);
  94. left: 0;
  95. z-index: $zIndex;
  96. width: 100%;
  97. height: $borderLength;
  98. margin-left: -0.5px;
  99. content: '';
  100. border-left: 1px solid transparent;
  101. transition: border-color 0.15s ease-in-out;
  102. }
  103. }
  104. }
  105. @keyframes fadeout {
  106. 100% {
  107. opacity: 0;
  108. }
  109. }
  110. @mixin blink-bgcolor($bgcolor) {
  111. position: relative;
  112. z-index: 1;
  113. &::after {
  114. position: absolute;
  115. top: 15%;
  116. left: 0;
  117. z-index: -1;
  118. width: 100%;
  119. height: 70%;
  120. content: '';
  121. background-color: $bgcolor;
  122. border-radius: 2px;
  123. animation: fadeout 1s ease-in 1.5s forwards;
  124. }
  125. }
  126. @mixin overlay-processing-style($additionalSelector, $contentFontSize: inherit, $contentPadding: inherit) {
  127. .overlay.#{$additionalSelector} {
  128. background: rgba(255, 255, 255, 0.5);
  129. .overlay-content {
  130. padding: $contentPadding;
  131. font-size: $contentFontSize;
  132. color: bs.$gray-700;
  133. background: rgba(200, 200, 200, 0.5);
  134. }
  135. }
  136. }
  137. @mixin insertSimpleLineIcons($code) {
  138. &:before {
  139. margin-right: 0.2em;
  140. font-family: 'simple-line-icons';
  141. content: $code;
  142. }
  143. }
  144. @mixin grw-skeleton-text($font-size, $line-height) {
  145. height: $line-height;
  146. padding: (($line-height - $font-size) / 2) 0;
  147. }
  148. /*
  149. .example {
  150. @include grw-skeleton-text($font-size:$size, $line-height:$height);
  151. max-width: 100%;
  152. }
  153. */
  154. // values from './bootstrap/override'
  155. @mixin grw-skeleton-h3 {
  156. @include grw-skeleton-text(21px, 30px);
  157. }
  158. @mixin grw-skeleton-h5 {
  159. @include grw-skeleton-text(16px, 18px);
  160. }