_mixins.scss 3.7 KB

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