_mixins.scss 3.3 KB

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