_main.scss 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. body {
  2. color: var(--text-a);
  3. background-color: var(--ui-BG-1) !important;
  4. font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
  5. sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  6. }
  7. /* ==================
  8. 初始化
  9. ==================== */
  10. .ui-link {
  11. cursor: pointer;
  12. }
  13. navigator {
  14. display: inline-flex;
  15. }
  16. navigator.navigator-hover {
  17. background-color: inherit;
  18. transform: translate(1rpx, 1rpx);
  19. // opacity: 1;
  20. }
  21. /* ==================
  22. 辅助类
  23. ==================== */
  24. .none {
  25. display: none !important;
  26. }
  27. .inline {
  28. display: inline !important;
  29. }
  30. .inline-block {
  31. display: inline-block !important;
  32. }
  33. .block {
  34. display: block !important;
  35. }
  36. .touch-none {
  37. pointer-events: none;
  38. }
  39. .touch-all {
  40. pointer-events: all;
  41. }
  42. .flex {
  43. display: flex !important;
  44. }
  45. .inline-flex {
  46. display: inline-flex !important;
  47. }
  48. .w-100 {
  49. width: 100%;
  50. }
  51. /* -- 浮动 -- */
  52. .cf::after,
  53. .cf::before {
  54. content: '';
  55. display: table;
  56. }
  57. .cf::after {
  58. clear: both;
  59. }
  60. .fl {
  61. float: left;
  62. }
  63. .fr {
  64. float: right;
  65. }
  66. .position-center {
  67. @include position-center;
  68. }
  69. .position-relative {
  70. position: relative;
  71. }
  72. /* -- 工具类 -- */
  73. @function negativify-map($map) {
  74. $result: ();
  75. @each $key, $value in $map {
  76. @if $key != 0 {
  77. $result: map-merge($result, ('n' + $key: (-$value)));
  78. }
  79. }
  80. @return $result;
  81. }
  82. $utilities: () !default;
  83. $utilities: map-merge(
  84. (
  85. 'margin': (
  86. responsive: true,
  87. property: margin,
  88. class: m,
  89. values:
  90. map-merge(
  91. $spacers,
  92. (
  93. auto: auto,
  94. )
  95. ),
  96. ),
  97. 'margin-x': (
  98. property: margin-right margin-left,
  99. class: mx,
  100. values:
  101. map-merge(
  102. $spacers,
  103. (
  104. auto: auto,
  105. )
  106. ),
  107. ),
  108. 'margin-y': (
  109. property: margin-top margin-bottom,
  110. class: my,
  111. values:
  112. map-merge(
  113. $spacers,
  114. (
  115. auto: auto,
  116. )
  117. ),
  118. ),
  119. 'margin-top': (
  120. property: margin-top,
  121. class: mt,
  122. values:
  123. map-merge(
  124. $spacers,
  125. (
  126. auto: auto,
  127. )
  128. ),
  129. ),
  130. 'margin-right': (
  131. property: margin-right,
  132. class: mr,
  133. values:
  134. map-merge(
  135. $spacers,
  136. (
  137. auto: auto,
  138. )
  139. ),
  140. ),
  141. 'margin-bottom': (
  142. property: margin-bottom,
  143. class: mb,
  144. values:
  145. map-merge(
  146. $spacers,
  147. (
  148. auto: auto,
  149. )
  150. ),
  151. ),
  152. 'margin-left': (
  153. property: margin-left,
  154. class: ml,
  155. values:
  156. map-merge(
  157. $spacers,
  158. (
  159. auto: auto,
  160. )
  161. ),
  162. ),
  163. 'padding': (
  164. responsive: true,
  165. property: padding,
  166. class: p,
  167. values: $spacers,
  168. ),
  169. 'padding-x': (
  170. property: padding-right padding-left,
  171. class: px,
  172. values: $spacers,
  173. ),
  174. 'padding-y': (
  175. property: padding-top padding-bottom,
  176. class: py,
  177. values: $spacers,
  178. ),
  179. 'padding-top': (
  180. property: padding-top,
  181. class: pt,
  182. values: $spacers,
  183. ),
  184. 'padding-right': (
  185. property: padding-right,
  186. class: pr,
  187. values: $spacers,
  188. ),
  189. 'padding-bottom': (
  190. property: padding-bottom,
  191. class: pb,
  192. values: $spacers,
  193. ),
  194. 'padding-left': (
  195. property: padding-left,
  196. class: pl,
  197. values: $spacers,
  198. ),
  199. 'font-weight': (
  200. property: font-weight,
  201. class: text,
  202. values: (
  203. light: $font-weight-light,
  204. lighter: $font-weight-lighter,
  205. normal: $font-weight-normal,
  206. bold: $font-weight-bold,
  207. bolder: $font-weight-bolder,
  208. ),
  209. ),
  210. 'text-align': (
  211. property: text-align,
  212. class: text,
  213. values: left right center,
  214. ),
  215. 'font-color': (
  216. property: color,
  217. class: text,
  218. values:
  219. map-merge(
  220. $colors,
  221. map-merge(
  222. $grays,
  223. map-merge(
  224. $darks,
  225. (
  226. 'reset': inherit,
  227. )
  228. )
  229. )
  230. ),
  231. ),
  232. 'line-height': (
  233. property: line-height,
  234. class: lh,
  235. values: (
  236. 1: 1,
  237. sm: $line-height-sm,
  238. base: $line-height-base,
  239. lg: $line-height-lg,
  240. ),
  241. ),
  242. 'white-space': (
  243. property: white-space,
  244. class: text,
  245. values: (
  246. nowrap: nowrap,
  247. ),
  248. ),
  249. 'radius': (
  250. property: border-radius,
  251. class: radius,
  252. values: (
  253. null: $radius,
  254. sm: $radius-sm,
  255. lg: $radius-lg,
  256. 0: 0,
  257. ),
  258. ),
  259. 'round': (
  260. property: border-radius,
  261. class: round,
  262. values: (
  263. null: $round-pill,
  264. circle: 50%,
  265. ),
  266. ),
  267. 'radius-top': (
  268. property: border-top-left-radius border-top-right-radius,
  269. class: radius-top,
  270. values: (
  271. null: $radius,
  272. ),
  273. ),
  274. 'radius-right': (
  275. property: border-top-right-radius border-bottom-right-radius,
  276. class: radius-right,
  277. values: (
  278. null: $radius,
  279. ),
  280. ),
  281. 'radius-bottom': (
  282. property: border-bottom-right-radius border-bottom-left-radius,
  283. class: radius-bottom,
  284. values: (
  285. null: $radius,
  286. ),
  287. ),
  288. 'radius-left': (
  289. property: border-bottom-left-radius border-top-left-radius,
  290. class: radius-left,
  291. values: (
  292. null: $radius,
  293. ),
  294. ),
  295. 'radius-lr': (
  296. property: border-top-left-radius border-bottom-right-radius,
  297. class: radius-lr,
  298. values: (
  299. null: $radius,
  300. ),
  301. ),
  302. 'radius-lrs': (
  303. property: border-top-right-radius border-bottom-left-radius,
  304. class: radius-lr,
  305. values: (
  306. null: 0,
  307. ),
  308. ),
  309. 'radius-rl': (
  310. property: border-top-right-radius border-bottom-left-radius,
  311. class: radius-rl,
  312. values: (
  313. null: $radius,
  314. ),
  315. ),
  316. 'radius-rls': (
  317. property: border-top-left-radius border-bottom-right-radius,
  318. class: radius-rl,
  319. values: (
  320. null: 0,
  321. ),
  322. ),
  323. ),
  324. $utilities
  325. );
  326. @each $key, $utility in $utilities {
  327. @if type-of($utility) == 'map' {
  328. $values: map-get($utility, values);
  329. @if type-of($values) == 'string' or type-of(nth($values, 1)) != 'list' {
  330. $values: zip($values, $values);
  331. }
  332. @each $key, $value in $values {
  333. $properties: map-get($utility, property);
  334. @if type-of($properties) == 'string' {
  335. $properties: append((), $properties);
  336. }
  337. $property-class: if(
  338. map-has-key($utility, class),
  339. map-get($utility, class),
  340. nth($properties, 1)
  341. );
  342. $property-class: if($property-class == null, '', $property-class);
  343. $property-class-modifier: if($key, if($property-class == '', '', '-') + $key, '');
  344. .#{$property-class + $property-class-modifier} {
  345. @each $property in $properties {
  346. #{$property}: $value !important;
  347. }
  348. }
  349. }
  350. }
  351. }