_mixins.scss 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 apply-navigation-transition() {
  22. transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
  23. transition-duration: 300ms;
  24. }
  25. @mixin border-vertical($beforeOrAfter, $borderLength, $zIndex: initial, $isBtnGroup: false) {
  26. position: relative;
  27. @if $isBtnGroup {
  28. &:not(:first-child) {
  29. margin-left: 0;
  30. border-left: none;
  31. }
  32. &:not(:last-child) {
  33. border-right: none;
  34. }
  35. }
  36. &:not(:first-child) {
  37. &::#{$beforeOrAfter} {
  38. position: absolute;
  39. top: calc((100% - #{$borderLength}) / 2);
  40. left: 0;
  41. z-index: $zIndex;
  42. width: 100%;
  43. height: $borderLength;
  44. margin-left: -0.5px;
  45. content: '';
  46. border-left: 1px solid transparent;
  47. transition: border-color 0.15s ease-in-out;
  48. }
  49. }
  50. }
  51. @keyframes fadeout {
  52. 100% {
  53. opacity: 0;
  54. }
  55. }
  56. @mixin blink-bgcolor($bgcolor) {
  57. position: relative;
  58. z-index: 1;
  59. &::after {
  60. position: absolute;
  61. top: 15%;
  62. left: 0;
  63. z-index: -1;
  64. width: 100%;
  65. height: 70%;
  66. content: '';
  67. background-color: $bgcolor;
  68. border-radius: 2px;
  69. animation: fadeout 1s ease-in 1.5s forwards;
  70. }
  71. }
  72. @mixin grw-skeleton-text($font-size, $line-height) {
  73. height: $line-height;
  74. padding: (($line-height - $font-size) / 2) 0;
  75. }
  76. /*
  77. .example {
  78. @include grw-skeleton-text($font-size:$size, $line-height:$height);
  79. max-width: 100%;
  80. }
  81. */
  82. // values from './bootstrap/override'
  83. @mixin grw-skeleton-h3 {
  84. @include grw-skeleton-text(21px, 30px);
  85. }
  86. @mixin grw-skeleton-h5 {
  87. @include grw-skeleton-text(16px, 18px);
  88. }