mixin.scss 3.6 KB

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