mixin.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. @use './variables.scss' as *;
  2. // 富文本样式
  3. @mixin rich-text($font-size: 16pt) {
  4. font-family: 'Arial', 'Helvetica', sans-serif;
  5. font-size: $font-size;
  6. :deep ul {
  7. padding-inline-start: 40px;
  8. li {
  9. list-style: disc;
  10. }
  11. }
  12. }
  13. // 设置基础样式
  14. @mixin setting-base {
  15. .serial-number {
  16. :deep .el-form-item__content {
  17. display: flex;
  18. align-items: center;
  19. justify-content: space-between;
  20. }
  21. .svg-icon {
  22. cursor: pointer;
  23. }
  24. }
  25. .el-input {
  26. margin-right: 16px;
  27. }
  28. .el-divider {
  29. margin: 16px 0;
  30. }
  31. }
  32. // 预览基础样式
  33. @mixin preview-base {
  34. display: grid;
  35. gap: 6px;
  36. :deep .rich-text {
  37. @include rich-text;
  38. &.mce-content-body {
  39. padding-top: 4px;
  40. }
  41. &:not(.mce-edit-focus) {
  42. p {
  43. margin: 0;
  44. }
  45. }
  46. &.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {
  47. top: 6px;
  48. }
  49. }
  50. .main {
  51. grid-area: main;
  52. width: 100%;
  53. .lang {
  54. grid-area: lang;
  55. }
  56. }
  57. }
  58. // 序号样式
  59. @mixin serial-number($height: 36px) {
  60. width: 40px;
  61. height: $height;
  62. padding: 4px 8px;
  63. font-size: 14px;
  64. color: $text-color;
  65. background-color: $fill-color;
  66. border-radius: 2px;
  67. }
  68. // 页面基础样式
  69. @mixin page-base {
  70. display: flex;
  71. flex-direction: column;
  72. row-gap: 5px;
  73. min-width: 1100px;
  74. min-height: 100%;
  75. padding: 5px;
  76. margin: 0 5px;
  77. background-color: #fff;
  78. border-radius: 4px;
  79. box-shadow: 0 2px 4px rgba(0, 0, 0, 10%);
  80. }
  81. // 列表样式
  82. @mixin table-list {
  83. &-list {
  84. display: flex;
  85. flex: 1;
  86. flex-direction: column;
  87. padding-bottom: 10px;
  88. .el-table {
  89. display: flex;
  90. flex-direction: column;
  91. :deep &__body-wrapper {
  92. flex: 1;
  93. }
  94. }
  95. }
  96. }
  97. @mixin page-content($isMenu: false) {
  98. display: flex;
  99. flex-direction: column;
  100. min-width: 1100px;
  101. min-height: calc(100% - 5px);
  102. > .menu {
  103. position: sticky;
  104. top: 5px;
  105. left: 0;
  106. margin: 5px 10px;
  107. }
  108. &__header {
  109. position: sticky;
  110. top: if($isMenu, 56px, 5px);
  111. left: 0;
  112. z-index: 9;
  113. display: flex;
  114. align-items: center;
  115. height: 40px;
  116. padding: 6px 4px;
  117. margin-bottom: 5px;
  118. background-color: #fff;
  119. border-top: $border;
  120. border-bottom: $border;
  121. > .menu-container {
  122. display: flex;
  123. justify-content: space-between;
  124. width: 360px;
  125. padding: 4px 8px;
  126. border-right: $border;
  127. }
  128. > .courseware {
  129. display: flex;
  130. flex-grow: 1;
  131. column-gap: 16px;
  132. align-items: center;
  133. justify-content: space-between;
  134. height: 40px;
  135. .name-path {
  136. flex: 1;
  137. height: 40px;
  138. padding: 4px 8px;
  139. font-size: 14px;
  140. line-height: 32px;
  141. border-right: $border;
  142. }
  143. .operator {
  144. display: flex;
  145. column-gap: 8px;
  146. align-items: center;
  147. .link {
  148. + .link {
  149. margin-left: 0;
  150. &::before {
  151. margin-right: 8px;
  152. color: #999;
  153. content: '|';
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. > main {
  161. display: flex;
  162. flex: 1;
  163. flex-direction: column;
  164. row-gap: 5px;
  165. min-width: 1100px;
  166. min-height: if($isMenu, calc(100% - 57px), 100%);
  167. padding: 5px;
  168. margin: 0 5px;
  169. background-color: #fff;
  170. border-radius: 4px;
  171. box-shadow: 0 2px 4px rgba(0, 0, 0, 10%);
  172. }
  173. }
  174. // 旋转动画
  175. @mixin spin($second: 3s) {
  176. animation: spin $second linear infinite;
  177. @keyframes spin {
  178. 0% {
  179. transform: rotate(0deg);
  180. }
  181. 100% {
  182. transform: rotate(360deg);
  183. }
  184. }
  185. }