Theme.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. import type { ThemeConfig } from "./ThemeDefine";
  2. /** 默认主题配置 */
  3. export const DefaultTheme : ThemeConfig = {
  4. varOverrides: {
  5. spaceSize: {
  6. xs: '10rpx',
  7. sm: '15rpx',
  8. md: '20rpx',
  9. lg: '30rpx',
  10. },
  11. fontSize: {
  12. mini: 22,
  13. small: 26,
  14. medium: 30,
  15. large: 38,
  16. larger: 46,
  17. },
  18. shadow: {
  19. default: '0 0 10rpx rgba(0, 0, 0, 0.1)',
  20. light: '0 0 10rpx rgba(0, 0, 0, 0.05)',
  21. dark: '0 0 10rpx rgba(0, 0, 0, 0.2)',
  22. },
  23. },
  24. colorConfigs: {
  25. default: {
  26. default: 'transparent',
  27. button: '#dddddd',
  28. lightButton: '#ffffff',
  29. primary: '#007AFF',
  30. secondary: '#0462C7',
  31. success: '#4CAF50',
  32. info: '#2196F3',
  33. warning: '#FFC107',
  34. danger: '#F44336',
  35. notice: '#ffffff',
  36. light: '#F5F5F5',
  37. dark: '#212121',
  38. white: '#FFFFFF',
  39. black: '#000000',
  40. grey: '#999999',
  41. lightGrey: '#c3c3c3',
  42. darkGrey: '#8e8e8e',
  43. skeleton: 'rgba(46,50,56, 0.05)',
  44. },
  45. pressed: {
  46. default: 'rgba(0,0,0,0.35)',
  47. white: '#e7e7e7',
  48. black: '#666666',
  49. grey: '#aaaaaa',
  50. primary: '#0960ac',
  51. success: '#278950',
  52. warning: '#dd8700',
  53. info: '#0960ac',
  54. notice: '#dddddd',
  55. danger: '#d70920',
  56. },
  57. mask: {
  58. default: 'rgba(0, 0, 0, 0.3)',
  59. white: 'rgba(250, 250, 250, 0.8)',
  60. primary: 'rgba(9, 96, 172, 0.2)',
  61. info: 'rgba(33, 150, 243, 0.2)',
  62. success: 'rgba(39, 137, 80, 0.3)',
  63. warning: 'rgba(221, 135, 0, 0.2)',
  64. danger: 'rgba(215, 9, 32, 0.2)',
  65. },
  66. background: {
  67. page: '#f8f8f8',
  68. primary: '#eff2ff',
  69. success: '#e0f6de',
  70. warning: '#FEECD2',
  71. danger: '#fff0f0',
  72. info: '#eff2ff',
  73. imageBox: '#dfdfdf',
  74. cell: '#ffffff',
  75. bar: '#f8f8f8',
  76. box: '#dadada',
  77. switch: '#dadada',
  78. notify: '#f8f8f8',
  79. toast: 'rgba(0, 0, 0, 0.85)',
  80. mask: 'rgba(0, 0, 0, 0.6)',
  81. },
  82. text: {
  83. title: '#000000',
  84. light: '#ffffff',
  85. content: '#333333',
  86. second: '#999999',
  87. link: '#007AFF',
  88. info: '#007AFF',
  89. primary: '#014D8E',
  90. success: '#2EA200',
  91. warning: '#D87001',
  92. danger: '#BE0405',
  93. },
  94. border: {
  95. input: '#dadada',
  96. default: '#dddddd',
  97. cell: '#efefef',
  98. light: '#eeeeee',
  99. },
  100. },
  101. textConfigs: {
  102. h1: {
  103. color: 'text.title',
  104. fontSize: '50px',
  105. fontWeight: 'bold',
  106. },
  107. h2: {
  108. color: 'text.title',
  109. fontSize: '45rpx',
  110. fontWeight: 'bold',
  111. },
  112. h3: {
  113. color: 'text.title',
  114. fontSize: '40rpx',
  115. fontWeight: 'bold',
  116. },
  117. h4: {
  118. color: 'text.title',
  119. fontSize: '36rpx',
  120. fontWeight: 'bold',
  121. },
  122. h5: {
  123. color: 'text.title',
  124. fontSize: '30rpx',
  125. fontWeight: 'bold',
  126. },
  127. h6: {
  128. color: 'text.title',
  129. fontSize: '26rpx',
  130. fontWeight: 'bold',
  131. },
  132. content: {
  133. color: 'text.content',
  134. fontSize: '24rpx',
  135. },
  136. subText: {
  137. color: 'text.content',
  138. fontSize: '26rpx',
  139. },
  140. footerText: {
  141. color: 'text.second',
  142. fontSize: '24rpx',
  143. },
  144. }
  145. }
  146. /** 默认暗黑主题配置 */
  147. export const DefaultDarkTheme = {
  148. ...DefaultTheme,
  149. colorConfigs: {
  150. ...DefaultTheme.colorConfigs,
  151. default: {
  152. ...DefaultTheme.colorConfigs.default,
  153. button: '#666666',
  154. lightButton: '#333333',
  155. notice: '#000000',
  156. light: '#3e3e3e',
  157. dark: '#eeeeee',
  158. white: '#000000',
  159. black: '#ffffff',
  160. grey: '#666666',
  161. lightGrey: '#3d3d3d',
  162. darkGrey: '#727272',
  163. skeleton: 'rgba(255,255,255,0.1)',
  164. },
  165. pressed: {
  166. ...DefaultTheme.colorConfigs.pressed,
  167. default: 'rgba(255,255,255,0.1)',
  168. white: '#181818',
  169. black: '#999999',
  170. grey: '#555555',
  171. notice: '#222222',
  172. },
  173. mask: {
  174. ...DefaultTheme.colorConfigs.mask,
  175. default: 'rgba(0, 0, 0, 0.5)',
  176. white: 'rgba(250, 250, 250, 0.9)',
  177. primary: 'rgba(9, 96, 172, 0.3)',
  178. info: 'rgba(33, 150, 243, 0.3)',
  179. success: 'rgba(39, 137, 80, 0.4)',
  180. warning: 'rgba(221, 135, 0, 0.3)',
  181. danger: 'rgba(215, 9, 32, 0.3)',
  182. },
  183. background: {
  184. ...DefaultTheme.colorConfigs.background,
  185. page: '#1a1a1a',
  186. imageBox: '#202020',
  187. cell: '#000000',
  188. bar: '#1a1a1a',
  189. box: '#252525',
  190. switch: '#252525',
  191. notify: '#1a1a1a',
  192. toast: 'rgba(0, 0, 0, 0.95)',
  193. mask: 'rgba(0, 0, 0, 0.8)',
  194. primary: 'rgba(0, 122, 255, 0.2)',
  195. success: 'rgba(76, 175, 80, 0.2)',
  196. warning: 'rgba(255, 193, 7, 0.2)',
  197. danger: 'rgba(244, 67, 54, 0.2)',
  198. info: 'rgba(33, 150, 243, 0.2)',
  199. },
  200. text: {
  201. ...DefaultTheme.colorConfigs.text,
  202. title: '#ffffff',
  203. light: '#000000',
  204. content: '#cccccc',
  205. second: '#666666',
  206. },
  207. border: {
  208. ...DefaultTheme.colorConfigs.border,
  209. input: '#252525',
  210. default: '#333333',
  211. cell: '#333333',
  212. light: '#444444',
  213. },
  214. },
  215. }