_base.scss 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. /* **********
  2. * init 全局样式
  3. * **********/
  4. @use "sass:math";
  5. * {
  6. outline: 0;
  7. margin: 0;
  8. padding: 0;
  9. box-sizing: border-box;
  10. -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
  11. }
  12. html, body {
  13. -webkit-text-size-adjust: 100%;
  14. -ms-text-size-adjust: 100%;
  15. text-size-adjust: none;
  16. font-size: 16px;
  17. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  18. background-color: #f0eff5;
  19. min-height: 100%;// 因为body内部可能有absolute fixed布局,导致没有高度,主要是为了防止 vconsole按钮无法拖动。
  20. }
  21. ol, ul, li {
  22. margin: 0;
  23. padding: 0;
  24. list-style: none
  25. }
  26. i, em {
  27. font-style: normal
  28. }
  29. a {
  30. color: #000;
  31. text-decoration: none
  32. }
  33. input:not([type]) {
  34. // 所有无type的输入框,都需要加入如下属性,否则ios12输入有bug。 有type已经被mui加上了如下属性。
  35. -webkit-user-select: text;
  36. }
  37. #testHomeBtn {
  38. $btnSize: 40px;
  39. position: fixed;
  40. width: $btnSize;
  41. height: $btnSize;
  42. margin-left: math.div(-$btnSize, 2);
  43. margin-top: math.div(-$btnSize, 2);
  44. right: 0;
  45. bottom: 100px;
  46. border-radius: 50%;
  47. z-index: 99999;
  48. background: rgba(0, 0, 0, .5);
  49. background-clip: content-box;
  50. border: math.div($btnSize, 5) solid rgba(0, 0, 0, .3);
  51. box-shadow: 0 0 math.div($btnSize, 2) rgba(0, 0, 0, .4);
  52. transition: opacity linear .22s;
  53. &.fade {
  54. opacity: .4;
  55. }
  56. }
  57. // 去掉更新成功的 Connected to BrowserSync 提示
  58. #__bs_notify__ {
  59. display: none !important;
  60. }
  61. //验证码控件默认样式:居中
  62. .geetest_holder {
  63. margin: auto;
  64. }
  65. /*remModel默认为48px,否则js计算延迟导致页面字体过小*/
  66. .remModel {
  67. font-size: 48px;
  68. }
  69. .clearfix {
  70. *zoom: 1
  71. }
  72. .clearfix:after {
  73. content: "";
  74. display: block;
  75. height: 0;
  76. clear: both;
  77. visibility: hidden
  78. }
  79. .v-middle {
  80. vertical-align: middle;
  81. }
  82. .hidden {
  83. display: none !important
  84. }
  85. .visible-hidden {
  86. visibility: hidden !important;
  87. }
  88. .clear-before:before {
  89. display: none;
  90. }
  91. .clear-after:after {
  92. display: none;
  93. }
  94. .fade-node {
  95. opacity: .6;
  96. }
  97. .noClick {
  98. pointer-events: none;
  99. }
  100. .no-touch {
  101. /*主要是阻止元素的默认行为,如滚动,避免出现滚动穿透:但还是有BUG*/
  102. touch-action: none;
  103. }
  104. .over-hide {
  105. /*解决滚动穿透,当弹窗打开时,body加上该class,IOS和安卓打开键盘时不同,IOS的window大小不变(但好像会触发resize事件),安卓的window会缩小*/
  106. overflow: hidden;
  107. }
  108. .flex {
  109. -webkit-box-flex: 1;
  110. -webkit-flex: 1;
  111. flex: 1;
  112. }
  113. .flexbox {
  114. display: -webkit-box !important;
  115. display: -webkit-flex !important;
  116. display: flex !important;
  117. }
  118. .rotateX {
  119. transform: rotateX(180deg);
  120. display: inline-block;
  121. }
  122. /***一些公共的布局样式*****/
  123. .custom-margin {
  124. margin-top: 1em;
  125. margin-bottom: 1em;
  126. }
  127. .custom-top {
  128. margin-top: 10px;
  129. }
  130. .custom-right {
  131. margin-right: 10px;
  132. }
  133. .custom-bottom {
  134. margin-bottom: 10px;
  135. }
  136. .custom-bottom-s {
  137. margin-bottom: 15px;
  138. }
  139. .autowidth {
  140. width: auto !important;
  141. }
  142. .inline-block {
  143. display: inline-block;
  144. }
  145. .autoheight {
  146. height: auto !important;
  147. }
  148. .text-left {
  149. text-align: left !important
  150. }
  151. .text-right {
  152. text-align: right !important
  153. }
  154. .text-center {
  155. text-align: center !important
  156. }
  157. .text-ellipsis {
  158. overflow: hidden;
  159. white-space: nowrap;
  160. text-overflow: ellipsis
  161. }
  162. .pull-left {
  163. float: left
  164. }
  165. .pull-right {
  166. float: right
  167. }
  168. /********************common box model**************************/
  169. $index: 0;
  170. @while $index <= 40 {
  171. .padding-#{$index} {
  172. padding: #{$index}px !important;
  173. }
  174. .padding-t-#{$index} {
  175. padding-top: #{$index}px !important;
  176. }
  177. .padding-r-#{$index} {
  178. padding-right: #{$index}px !important;
  179. }
  180. .padding-b-#{$index} {
  181. padding-bottom: #{$index}px !important;
  182. }
  183. .padding-l-#{$index} {
  184. padding-left: #{$index}px !important;
  185. }
  186. .padding-t-b-#{$index} {
  187. padding-top: #{$index}px !important;
  188. padding-bottom: #{$index}px !important;
  189. }
  190. .padding-l-r-#{$index} {
  191. padding-left: #{$index}px !important;
  192. padding-right: #{$index}px !important;
  193. }
  194. .margin-#{$index} {
  195. margin: #{$index}px !important;
  196. }
  197. .margin-t-#{$index} {
  198. margin-top: #{$index}px !important;
  199. }
  200. .margin-r-#{$index} {
  201. margin-right: #{$index}px !important;
  202. }
  203. .margin-b-#{$index} {
  204. margin-bottom: #{$index}px !important;
  205. }
  206. .margin-l-#{$index} {
  207. margin-left: #{$index}px !important;
  208. }
  209. .margin-t-b-#{$index} {
  210. margin-top: #{$index}px !important;
  211. margin-bottom: #{$index}px !important;
  212. }
  213. .margin-l-r-#{$index} {
  214. margin-left: #{$index}px !important;
  215. margin-right: #{$index}px !important;
  216. }
  217. $index: $index + 5;
  218. }
  219. /*common color*/
  220. .font-bold {
  221. font-weight: bold;
  222. }
  223. .font-b {
  224. color: #000 !important;
  225. }
  226. $index: 12;
  227. @while $index <= 28 {
  228. .font-#{$index} {
  229. font-size: #{$index}px !important;
  230. }
  231. // font-b-12 到 font-b-28 表示文字字体12px 到 28px,且为纯黑色,和 font-b-0 到 font-b-10 不冲突。
  232. .font-b-#{$index} {
  233. font-size: #{$index}px !important;
  234. color: #000 !important;
  235. }
  236. $index: $index + 1;
  237. }
  238. // font-b-0 到 font-b-10 表示文字颜色由浅到深
  239. $index: 0;
  240. @while $index <= 10 {
  241. .font-b-#{$index} {
  242. color: rgba(0, 0, 0, $index*0.1) !important;
  243. }
  244. $index: $index + 1;
  245. }
  246. // 这个字体样式还是有用,vue中有缺失;但是可以优化,因为这样写会导致 css体积变大,应该在html中,如:font-b-14-8 == font-b-8 font-14
  247. $index: 0;
  248. @while $index <= 10 {
  249. $index2: 12;
  250. @while $index2 <= 24 {
  251. .font-b-#{$index2}-#{$index} {
  252. font-size: #{$index2}px !important;
  253. color: rgba(0, 0, 0, $index*0.1) !important;
  254. }
  255. $index2: $index2 + 2;
  256. }
  257. $index: $index + 2;
  258. }
  259. /***行高***/
  260. $index: 12;
  261. @while $index <= 44 {
  262. .l-h-#{$index} {
  263. line-height: #{$index}px;
  264. }
  265. $index: $index + 1;
  266. }