light.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. import twc from '@/utils/tailwindColor'
  2. import { cbh, cdh, cah, cmh } from './common'
  3. import type { GlobalThemeOverrides } from 'naive-ui'
  4. const light = {
  5. textColorBase: twc.neutral[800],
  6. textColor1: twc.neutral[750],
  7. textColor2: twc.neutral[700],
  8. textColor3: twc.neutral[500],
  9. borderColor: twc.neutral[200],
  10. }
  11. const closeIcon = (primaryColor: string) => {
  12. return {
  13. closeIconColorSuccess: twc.lime[500],
  14. closeIconColorInfo: twc.sky[500],
  15. closeIconColorWarning: twc.amber[500],
  16. closeIconColorError: twc.pink[500],
  17. closeIconColorLoading: primaryColor,
  18. closeColorHoverSuccess: cah(twc.lime[400], 0.14),
  19. closeIconColorHoverSuccess: cdh(twc.lime[500], 0.2),
  20. closeColorPressedSuccess: cah(twc.lime[400], 0.2),
  21. closeIconColorPressedSuccess: cdh(twc.lime[500], 0.6),
  22. closeColorHoverInfo: cah(twc.sky[400], 0.14),
  23. closeIconColorHoverInfo: cdh(twc.sky[500], 0.2),
  24. closeColorPressedInfo: cah(twc.sky[400], 0.2),
  25. closeIconColorPressedInfo: cdh(twc.sky[500], 0.6),
  26. closeColorHoverWarning: cah(twc.amber[400], 0.14),
  27. closeIconColorHoverWarning: cdh(twc.amber[500], 0.2),
  28. closeColorPressedWarning: cah(twc.amber[400], 0.2),
  29. closeIconColorPressedWarning: cdh(twc.amber[500], 0.6),
  30. closeColorHoverError: cah(twc.pink[400], 0.14),
  31. closeIconColorHoverError: cdh(twc.pink[500], 0.2),
  32. closeColorPressedError: cah(twc.pink[400], 0.2),
  33. closeIconColorPressedError: cdh(twc.pink[500], 0.6),
  34. closeColorHoverLoading: cah(primaryColor, 0.14),
  35. closeIconColorHoverLoading: cdh(primaryColor, 0.2),
  36. closeColorPressedLoading: cah(primaryColor, 0.2),
  37. closeIconColorPressedLoading: cdh(primaryColor, 0.6),
  38. } as const
  39. }
  40. export function baseLightThemeOverrides(primaryColor = ''): GlobalThemeOverrides {
  41. return {
  42. common: {
  43. textColorBase: light.textColorBase,
  44. textColor1: light.textColor1,
  45. textColor2: light.textColor2,
  46. textColor3: light.textColor3,
  47. bodyColor: twc.neutral[25],
  48. borderColor: light.borderColor,
  49. cardColor: twc.neutral[25],
  50. hoverColor: twc.neutral[150],
  51. modalColor: twc.neutral[100],
  52. popoverColor: twc.neutral[25],
  53. scrollbarColor: twc.neutral[200],
  54. scrollbarColorHover: twc.neutral[250],
  55. closeIconColor: cbh(twc.neutral[500], 0.2),
  56. closeColorHover: cah(twc.neutral[500], 0.1),
  57. closeIconColorPressed: twc.neutral[500],
  58. closeColorPressed: cah(twc.neutral[500], 0.14),
  59. infoColor: twc.sky[500],
  60. infoColorHover: cdh(twc.sky[500], 0.1),
  61. infoColorPressed: cdh(twc.sky[500], 0.2),
  62. infoColorSuppl: twc.sky[500],
  63. successColor: twc.lime[500],
  64. successColorHover: cdh(twc.lime[500], 0.1),
  65. successColorPressed: cdh(twc.lime[500], 0.2),
  66. successColorSuppl: twc.lime[500],
  67. warningColor: twc.amber[500],
  68. warningColorHover: cdh(twc.amber[500], 0.1),
  69. warningColorPressed: cdh(twc.amber[500], 0.2),
  70. warningColorSuppl: twc.amber[500],
  71. errorColor: twc.pink[500],
  72. errorColorHover: cdh(twc.pink[500], 0.1),
  73. errorColorPressed: cdh(twc.pink[500], 0.2),
  74. errorColorSuppl: twc.pink[500],
  75. },
  76. Alert: {
  77. ...closeIcon(primaryColor),
  78. },
  79. Button: {
  80. textColorSuccess: twc.lime[25],
  81. textColorInfo: twc.sky[25],
  82. textColorWarning: twc.amber[25],
  83. textColorError: twc.pink[25],
  84. },
  85. Card: {
  86. borderColor: light.borderColor,
  87. },
  88. Checkbox: {
  89. colorDisabled: twc.neutral[100],
  90. },
  91. DataTable: {
  92. borderColor: light.borderColor,
  93. tdColor: twc.neutral[25],
  94. tdColorHover: cdh(twc.neutral[100], 0.06),
  95. thColor: twc.neutral[100],
  96. },
  97. Drawer: {
  98. footerBorderTop: `1px solid ${light.borderColor}`,
  99. headerBorderBottom: `1px solid ${light.borderColor}`,
  100. peers: {
  101. Scrollbar: {
  102. color: twc.neutral[300],
  103. colorHover: twc.neutral[350],
  104. },
  105. },
  106. },
  107. Divider: {
  108. color: twc.neutral[150],
  109. },
  110. Message: {
  111. textColorSuccess: twc.lime[500],
  112. textColorInfo: twc.sky[500],
  113. textColorWarning: twc.amber[500],
  114. textColorError: twc.pink[500],
  115. textColorLoading: primaryColor,
  116. colorSuccess: cbh(twc.lime[25], 0.3),
  117. colorInfo: cbh(twc.sky[25], 0.3),
  118. colorWarning: cbh(twc.amber[25], 0.3),
  119. colorError: cbh(twc.pink[25], 0.3),
  120. colorLoading: cmh(twc.neutral[25], primaryColor, 0.01),
  121. ...closeIcon(primaryColor),
  122. },
  123. Modal: {
  124. peers: {
  125. Scrollbar: {
  126. color: twc.neutral[350],
  127. colorHover: twc.neutral[300],
  128. },
  129. },
  130. },
  131. Notification: {
  132. peers: {
  133. Scrollbar: {
  134. color: twc.neutral[350],
  135. colorHover: twc.neutral[400],
  136. },
  137. },
  138. },
  139. Popover: {
  140. color: twc.neutral[25],
  141. textColor: 'rgb(51, 54, 57)',
  142. },
  143. Select: {
  144. peers: {
  145. InternalSelectMenu: {
  146. actionDividerColor: twc.neutral[200],
  147. peers: {
  148. Scrollbar: {
  149. color: twc.neutral[150],
  150. colorHover: twc.neutral[200],
  151. },
  152. },
  153. },
  154. },
  155. },
  156. Upload: {
  157. draggerColor: twc.neutral[100],
  158. },
  159. }
  160. }