theme.tsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. import '@emotion/react';
  2. import color from 'color';
  3. import CHART_PALETTE from 'sentry/constants/chartPalette';
  4. import {DataCategory} from 'sentry/types';
  5. /**
  6. * Exporting for use in Storybook only. Do not import this
  7. * anywhere else! Instead, use the theme prop or import useTheme.
  8. */
  9. export const lightColors = {
  10. black: '#1D1127',
  11. white: '#FFFFFF',
  12. surface100: '#FAF9FB',
  13. surface200: '#FFFFFF',
  14. surface300: '#FFFFFF',
  15. surface400: '#F5F3F7',
  16. gray500: '#2B2233',
  17. gray400: '#3E3446',
  18. gray300: '#80708F',
  19. gray200: '#DBD6E1',
  20. gray100: '#EBE6EF',
  21. /**
  22. * Alternative version of gray200 that's translucent.
  23. * Useful for borders on tooltips, popovers, and dialogs.
  24. */
  25. translucentGray200: 'rgba(58, 17, 95, 0.18)',
  26. translucentGray100: 'rgba(45, 0, 85, 0.1)',
  27. purple400: '#584AC0',
  28. purple300: '#6C5FC7',
  29. purple200: 'rgba(108, 95, 199, 0.5)',
  30. purple100: 'rgba(108, 95, 199, 0.1)',
  31. blue400: '#2562D4',
  32. blue300: '#3C74DD',
  33. blue200: 'rgba(60, 116, 221, 0.5)',
  34. blue100: 'rgba(60, 116, 221, 0.09)',
  35. green400: '#268D75',
  36. green300: '#2BA185',
  37. green200: 'rgba(43, 161, 133, 0.55)',
  38. green100: 'rgba(43, 161, 133, 0.13)',
  39. yellow400: '#E5A500',
  40. yellow300: '#F5B000',
  41. yellow200: 'rgba(245, 176, 0, 0.55)',
  42. yellow100: 'rgba(245, 176, 0, 0.08)',
  43. red400: '#F32F35',
  44. red300: '#F55459',
  45. red200: 'rgba(245, 84, 89, 0.5)',
  46. red100: 'rgba(245, 84, 89, 0.09)',
  47. pink400: '#E50675',
  48. pink300: '#F91A8A',
  49. pink200: 'rgba(249, 26, 138, 0.5)',
  50. pink100: 'rgba(249, 26, 138, 0.1)',
  51. };
  52. /**
  53. * Exporting for use in Storybook only. Do not import this
  54. * anywhere else! Instead, use the theme prop or import useTheme.
  55. */
  56. export const darkColors = {
  57. black: '#1D1127',
  58. white: '#FFFFFF',
  59. surface100: '#1A141F',
  60. surface200: '#241D2A',
  61. surface300: '#2C2433',
  62. surface400: '#362E3E',
  63. gray500: '#EBE6EF',
  64. gray400: '#D6D0DC',
  65. gray300: '#998DA5',
  66. gray200: '#43384C',
  67. gray100: '#342B3B',
  68. /**
  69. * Alternative version of gray200 that's translucent.
  70. * Useful for borders on tooltips, popovers, and dialogs.
  71. */
  72. translucentGray200: 'rgba(218, 184, 245, 0.18)',
  73. translucentGray100: 'rgba(208, 168, 240, 0.1)',
  74. purple400: '#6859CF',
  75. purple300: '#7669D3',
  76. purple200: 'rgba(108, 95, 199, 0.6)',
  77. purple100: 'rgba(118, 105, 211, 0.1)',
  78. blue400: '#4284FF',
  79. blue300: '#5C95FF',
  80. blue200: 'rgba(92, 149, 255, 0.4)',
  81. blue100: 'rgba(92, 149, 255, 0.1)',
  82. green400: '#26B593',
  83. green300: '#2AC8A3',
  84. green200: 'rgba(42, 200, 163, 0.4)',
  85. green100: 'rgba(42, 200, 163, 0.1)',
  86. yellow400: '#F5B000',
  87. yellow300: '#FFC227',
  88. yellow200: 'rgba(255, 194, 39, 0.35)',
  89. yellow100: 'rgba(255, 194, 39, 0.07)',
  90. red400: '#FA2E34',
  91. red300: '#FA4F54',
  92. red200: 'rgba(250, 79, 84, 0.4)',
  93. red100: 'rgba(250, 79, 84, 0.1)',
  94. pink400: '#C4317A',
  95. pink300: '#D1478C',
  96. pink200: 'rgba(209, 71, 140, 0.55)',
  97. pink100: 'rgba(209, 71, 140, 0.13)',
  98. };
  99. const lightShadows = {
  100. dropShadowLightest: '0 0 2px rgba(43, 34, 51, 0.04)',
  101. dropShadowLight: '0 1px 4px rgba(43, 34, 51, 0.04)',
  102. dropShadowHeavy: '0 4px 24px rgba(43, 34, 51, 0.12)',
  103. };
  104. const darkShadows = {
  105. dropShadowLightest: '0 0 2px rgba(10, 8, 12, 0.2)',
  106. dropShadowLight: '0 1px 4px rgba(10, 8, 12, 0.2)',
  107. dropShadowHeavy: '0 4px 24px rgba(10, 8, 12, 0.36)',
  108. };
  109. /**
  110. * Background used in the theme-color meta tag
  111. * The colors below are an approximation of the colors used in the sidebar (sidebarGradient).
  112. * Unfortunately the exact colors cannot be used, as the theme-color tag does not support linear-gradient()
  113. */
  114. const sidebarBackground = {
  115. light: '#2f1937',
  116. dark: '#181622',
  117. };
  118. type BaseColors = typeof lightColors;
  119. const generateAliases = (colors: BaseColors) => ({
  120. /**
  121. * Heading text color
  122. */
  123. headingColor: colors.gray500,
  124. /**
  125. * Primary text color
  126. */
  127. textColor: colors.gray400,
  128. /**
  129. * Text that should not have as much emphasis
  130. */
  131. subText: colors.gray300,
  132. /**
  133. * Background for the main content area of a page?
  134. */
  135. bodyBackground: colors.surface100,
  136. /**
  137. * Primary background color
  138. */
  139. background: colors.surface200,
  140. /**
  141. * Elevated background color
  142. */
  143. backgroundElevated: colors.surface300,
  144. /**
  145. * Secondary background color used as a slight contrast against primary background
  146. */
  147. backgroundSecondary: colors.surface100,
  148. /**
  149. * Background for the header of a page
  150. */
  151. headerBackground: colors.surface200,
  152. /**
  153. * Primary border color
  154. */
  155. border: colors.gray200,
  156. translucentBorder: colors.translucentGray200,
  157. /**
  158. * Inner borders, e.g. borders inside of a grid
  159. */
  160. innerBorder: colors.gray100,
  161. translucentInnerBorder: colors.translucentGray100,
  162. /**
  163. * A color that denotes a "success", or something good
  164. */
  165. success: colors.green300,
  166. /**
  167. * A color that denotes an error, or something that is wrong
  168. */
  169. error: colors.red300,
  170. /**
  171. * A color that indicates something is disabled where user can not interact or use
  172. * it in the usual manner (implies that there is an "enabled" state)
  173. */
  174. disabled: colors.gray300,
  175. disabledBorder: colors.gray200,
  176. /**
  177. * Indicates a "hover" state, to suggest that an interactive element is clickable
  178. */
  179. hover: colors.surface400,
  180. /**
  181. * Indicates that something is "active" or "selected"
  182. */
  183. active: colors.purple300,
  184. activeHover: colors.purple400,
  185. /**
  186. * Indicates that something has "focus", which is different than "active" state as it is more temporal
  187. * and should be a bit subtler than active
  188. */
  189. focus: colors.purple200,
  190. focusBorder: colors.purple300,
  191. /**
  192. * Inactive
  193. */
  194. inactive: colors.gray300,
  195. /**
  196. * Link color indicates that something is clickable
  197. */
  198. linkColor: colors.blue300,
  199. linkHoverColor: colors.blue300,
  200. /**
  201. * Form placeholder text color
  202. */
  203. formPlaceholder: colors.gray300,
  204. /**
  205. * Default form text color
  206. */
  207. formText: colors.gray400,
  208. /**
  209. * Form input border
  210. */
  211. formInputBorder: colors.gray200,
  212. /**
  213. *
  214. */
  215. rowBackground: colors.surface300,
  216. /**
  217. * Color of lines that flow across the background of the chart to indicate axes levels
  218. * (This should only be used for yAxis)
  219. */
  220. chartLineColor: colors.gray100,
  221. /**
  222. * Color for chart label text
  223. */
  224. chartLabel: colors.gray300,
  225. /**
  226. * Color for the 'others' series in topEvent charts
  227. */
  228. chartOther: colors.gray200,
  229. /**
  230. * Default Progressbar color
  231. */
  232. progressBar: colors.purple300,
  233. /**
  234. * Default Progressbar color
  235. */
  236. progressBackground: colors.gray100,
  237. /**
  238. * Overlay for partial opacity
  239. */
  240. overlayBackgroundAlpha: color(colors.surface100).alpha(0.7).string(),
  241. /**
  242. * Tag progress bars
  243. */
  244. tagBarHover: colors.purple200,
  245. tagBar: colors.gray200,
  246. /**
  247. * Search filter "token" background
  248. */
  249. searchTokenBackground: {
  250. valid: colors.blue100,
  251. validActive: color(colors.blue100).opaquer(0.2).string(),
  252. invalid: colors.red100,
  253. invalidActive: color(colors.red100).opaquer(0.2).string(),
  254. },
  255. /**
  256. * Search filter "token" border
  257. */
  258. searchTokenBorder: {
  259. valid: colors.blue200,
  260. validActive: color(colors.blue200).opaquer(0.4).string(),
  261. invalid: colors.red200,
  262. invalidActive: color(colors.red200).opaquer(0.4).string(),
  263. },
  264. /**
  265. * Count on button when active
  266. */
  267. buttonCountActive: colors.white,
  268. /**
  269. * Count on button
  270. */
  271. buttonCount: colors.gray500,
  272. /**
  273. * Background of alert banners at the top
  274. */
  275. bannerBackground: colors.gray500,
  276. });
  277. const dataCategory = {
  278. [DataCategory.ERRORS]: CHART_PALETTE[4][3],
  279. [DataCategory.TRANSACTIONS]: CHART_PALETTE[4][2],
  280. [DataCategory.ATTACHMENTS]: CHART_PALETTE[4][1],
  281. [DataCategory.DEFAULT]: CHART_PALETTE[4][0],
  282. };
  283. const generateAlertTheme = (colors: BaseColors, alias: Aliases) => ({
  284. muted: {
  285. background: colors.gray200,
  286. backgroundLight: alias.backgroundSecondary,
  287. border: alias.border,
  288. iconColor: 'inherit',
  289. },
  290. info: {
  291. background: colors.blue300,
  292. backgroundLight: colors.blue100,
  293. border: colors.blue200,
  294. iconColor: colors.blue300,
  295. },
  296. warning: {
  297. background: colors.yellow300,
  298. backgroundLight: colors.yellow100,
  299. border: colors.yellow200,
  300. iconColor: colors.yellow300,
  301. },
  302. success: {
  303. background: colors.green300,
  304. backgroundLight: colors.green100,
  305. border: colors.green200,
  306. iconColor: colors.green300,
  307. },
  308. error: {
  309. background: colors.red300,
  310. backgroundLight: colors.red100,
  311. border: colors.red200,
  312. iconColor: colors.red300,
  313. textLight: colors.red200,
  314. },
  315. });
  316. const generateBadgeTheme = (colors: BaseColors) => ({
  317. default: {
  318. background: colors.gray100,
  319. indicatorColor: colors.gray100,
  320. color: colors.gray500,
  321. },
  322. alpha: {
  323. background: `linear-gradient(90deg, ${colors.pink300}, ${colors.yellow300})`,
  324. indicatorColor: colors.pink300,
  325. color: colors.white,
  326. },
  327. beta: {
  328. background: `linear-gradient(90deg, ${colors.purple300}, ${colors.pink300})`,
  329. indicatorColor: colors.purple300,
  330. color: colors.white,
  331. },
  332. new: {
  333. background: `linear-gradient(90deg, ${colors.blue300}, ${colors.green300})`,
  334. indicatorColor: colors.green300,
  335. color: colors.white,
  336. },
  337. review: {
  338. background: colors.purple300,
  339. indicatorColor: colors.purple300,
  340. color: colors.white,
  341. },
  342. warning: {
  343. background: colors.yellow300,
  344. indicatorColor: colors.yellow300,
  345. color: colors.gray500,
  346. },
  347. });
  348. const generateTagTheme = (colors: BaseColors) => ({
  349. default: {
  350. background: colors.surface400,
  351. border: colors.gray200,
  352. iconColor: colors.gray300,
  353. },
  354. promotion: {
  355. background: colors.pink100,
  356. border: colors.pink200,
  357. iconColor: colors.pink300,
  358. },
  359. highlight: {
  360. background: colors.purple100,
  361. border: colors.purple200,
  362. iconColor: colors.purple300,
  363. },
  364. warning: {
  365. background: colors.yellow100,
  366. border: colors.yellow200,
  367. iconColor: colors.yellow300,
  368. },
  369. success: {
  370. background: colors.green100,
  371. border: colors.green200,
  372. iconColor: colors.green300,
  373. },
  374. error: {
  375. background: colors.red100,
  376. border: colors.red200,
  377. iconColor: colors.red300,
  378. },
  379. info: {
  380. background: colors.purple100,
  381. border: colors.purple200,
  382. iconColor: colors.purple300,
  383. },
  384. white: {
  385. background: colors.white,
  386. border: colors.white,
  387. iconColor: colors.black,
  388. },
  389. black: {
  390. background: colors.black,
  391. border: colors.black,
  392. iconColor: colors.white,
  393. },
  394. });
  395. const generateLevelTheme = (colors: BaseColors) => ({
  396. sample: colors.purple300,
  397. info: colors.blue300,
  398. warning: colors.yellow300,
  399. // Hardcoded legacy color (orange400). We no longer use orange anywhere
  400. // else in the app (except for the chart palette). This needs to be harcoded
  401. // here because existing users may still associate orange with the "error" level.
  402. error: '#FF7738',
  403. fatal: colors.red300,
  404. default: colors.gray300,
  405. });
  406. const generateButtonTheme = (colors: BaseColors, alias: Aliases) => ({
  407. borderRadius: '4px',
  408. default: {
  409. color: alias.textColor,
  410. colorActive: alias.textColor,
  411. background: alias.background,
  412. backgroundActive: alias.backgroundSecondary,
  413. border: alias.border,
  414. borderActive: alias.border,
  415. focusBorder: alias.focusBorder,
  416. focusShadow: alias.focus,
  417. },
  418. primary: {
  419. color: colors.white,
  420. colorActive: colors.white,
  421. background: colors.purple300,
  422. backgroundActive: colors.purple400,
  423. border: colors.purple300,
  424. borderActive: colors.purple300,
  425. focusBorder: alias.focusBorder,
  426. focusShadow: alias.focus,
  427. },
  428. success: {
  429. color: colors.white,
  430. colorActive: colors.white,
  431. background: colors.green300,
  432. backgroundActive: colors.green400,
  433. border: colors.green300,
  434. borderActive: colors.green300,
  435. focusBorder: colors.green300,
  436. focusShadow: colors.green200,
  437. },
  438. danger: {
  439. color: colors.white,
  440. colorActive: colors.white,
  441. background: colors.red300,
  442. backgroundActive: colors.red400,
  443. border: colors.red300,
  444. borderActive: colors.red300,
  445. focusBorder: colors.red300,
  446. focusShadow: colors.red200,
  447. },
  448. link: {
  449. color: colors.blue300,
  450. colorActive: colors.blue300,
  451. background: 'transparent',
  452. backgroundActive: 'transparent',
  453. border: 'transparent',
  454. borderActive: 'transparent',
  455. focusBorder: alias.focusBorder,
  456. focusShadow: alias.focus,
  457. },
  458. disabled: {
  459. color: alias.disabled,
  460. colorActive: alias.disabled,
  461. background: alias.background,
  462. backgroundActive: alias.background,
  463. border: alias.disabledBorder,
  464. borderActive: alias.disabledBorder,
  465. focusBorder: 'transparent',
  466. focusShadow: 'transparent',
  467. },
  468. form: {
  469. color: alias.textColor,
  470. colorActive: alias.textColor,
  471. background: alias.background,
  472. backgroundActive: alias.backgroundSecondary,
  473. border: alias.formInputBorder,
  474. borderActive: alias.formInputBorder,
  475. focusBorder: alias.focusBorder,
  476. focusShadow: alias.focus,
  477. },
  478. });
  479. const iconSizes = {
  480. xs: '12px',
  481. sm: '16px',
  482. md: '20px',
  483. lg: '24px',
  484. xl: '32px',
  485. xxl: '72px',
  486. };
  487. const commonTheme = {
  488. breakpoints: ['800px', '992px', '1200px', '1440px', '2560px'],
  489. ...lightColors,
  490. ...lightShadows,
  491. iconSizes,
  492. iconDirections: {
  493. up: '0',
  494. right: '90',
  495. down: '180',
  496. left: '270',
  497. },
  498. // Try to keep these ordered plz
  499. zIndex: {
  500. // Generic z-index when you hope your component is isolated and
  501. // does not need to battle others for z-index priority
  502. initial: 1,
  503. truncationFullValue: 10,
  504. traceView: {
  505. spanTreeToggler: 900,
  506. dividerLine: 909,
  507. rowInfoMessage: 910,
  508. minimapContainer: 999,
  509. },
  510. header: 1000,
  511. errorMessage: 1000,
  512. dropdown: 1001,
  513. dropdownAutocomplete: {
  514. // needs to be below actor but above other page elements (e.g. pagination)
  515. // (e.g. Issue Details "seen" dots on chart is 2)
  516. // stream header is 1000
  517. menu: 1007,
  518. // needs to be above menu
  519. actor: 1008,
  520. },
  521. globalSelectionHeader: 1009,
  522. settingsSidebarNavMask: 1017,
  523. settingsSidebarNav: 1018,
  524. sidebarPanel: 1019,
  525. sidebar: 1020,
  526. orgAndUserMenu: 1030,
  527. // Sentry user feedback modal
  528. sentryErrorEmbed: 1090,
  529. // If you change modal also update shared-components.less
  530. // as the z-index for bootstrap modals lives there.
  531. modal: 10000,
  532. toast: 10001,
  533. // tooltips and hovercards can be inside modals sometimes.
  534. hovercard: 10002,
  535. tooltip: 10003,
  536. // On mobile views org stats dropdowns overlap
  537. orgStats: {
  538. dataCategory: 2,
  539. timeRange: 1,
  540. },
  541. // On mobile views issue list dropdowns overlap
  542. issuesList: {
  543. stickyHeader: 1,
  544. sortOptions: 2,
  545. displayOptions: 3,
  546. },
  547. },
  548. grid: 8,
  549. borderRadius: '4px',
  550. borderRadiusBottom: '0 0 4px 4px',
  551. borderRadiusTop: '4px 4px 0 0',
  552. borderRadiusLeft: '4px 0 0 4px',
  553. borderRadiusRight: '0 4px 4px 0',
  554. headerSelectorRowHeight: 44,
  555. headerSelectorLabelHeight: 28,
  556. // Relative font sizes
  557. fontSizeRelativeSmall: '0.9em',
  558. fontSizeExtraSmall: '11px',
  559. fontSizeSmall: '12px',
  560. fontSizeMedium: '14px',
  561. fontSizeLarge: '16px',
  562. fontSizeExtraLarge: '18px',
  563. headerFontSize: '22px',
  564. settings: {
  565. // Max-width for settings breadcrumbs
  566. // i.e. organization, project, or team
  567. maxCrumbWidth: '240px',
  568. containerWidth: '1440px',
  569. headerHeight: '69px',
  570. sidebarWidth: '220px',
  571. },
  572. sidebar: {
  573. boxShadow: '0 3px 3px #2f2936',
  574. color: '#9586a5',
  575. divider: '#493e54',
  576. badgeSize: '22px',
  577. smallBadgeSize: '11px',
  578. collapsedWidth: '70px',
  579. expandedWidth: '220px',
  580. mobileHeight: '54px',
  581. menuSpacing: '15px',
  582. },
  583. text: {
  584. family: '"Rubik", "Avenir Next", sans-serif',
  585. familyMono: '"Roboto Mono", Monaco, Consolas, "Courier New", monospace',
  586. lineHeightHeading: 1.2,
  587. lineHeightBody: 1.4,
  588. pageTitle: {
  589. fontSize: '1.625rem',
  590. fontWeight: 600,
  591. letterSpacing: '-0.01em',
  592. lineHeight: 1.2,
  593. },
  594. cardTitle: {
  595. fontSize: '1rem',
  596. fontWeight: 600,
  597. lineHeight: 1.2,
  598. },
  599. },
  600. dataCategory,
  601. tag: generateTagTheme(lightColors),
  602. level: generateLevelTheme(lightColors),
  603. charts: {
  604. colors: CHART_PALETTE[CHART_PALETTE.length - 1],
  605. // We have an array that maps `number + 1` --> list of `number` colors
  606. getColorPalette: (length: number) =>
  607. CHART_PALETTE[Math.min(CHART_PALETTE.length - 1, length + 1)] as string[],
  608. previousPeriod: lightColors.gray200,
  609. symbolSize: 6,
  610. },
  611. diff: {
  612. removedRow: 'hsl(358deg 89% 65% / 15%)',
  613. removed: 'hsl(358deg 89% 65% / 30%)',
  614. addedRow: 'hsl(100deg 100% 87% / 18%)',
  615. added: 'hsl(166deg 58% 47% / 32%)',
  616. },
  617. // Similarity spectrum used in "Similar Issues" in group details
  618. similarity: {
  619. empty: '#e2dee6',
  620. colors: ['#ec5e44', '#f38259', '#f9a66d', '#98b480', '#57be8c'],
  621. },
  622. // used as a gradient,
  623. businessIconColors: ['#EA5BC2', '#6148CE'],
  624. demo: {
  625. headerSize: '70px',
  626. },
  627. };
  628. const lightAliases = generateAliases(lightColors);
  629. const darkAliases = generateAliases(darkColors);
  630. export const lightTheme = {
  631. ...commonTheme,
  632. ...lightColors,
  633. ...lightAliases,
  634. ...lightShadows,
  635. inverted: {
  636. ...darkColors,
  637. ...darkAliases,
  638. },
  639. alert: generateAlertTheme(lightColors, lightAliases),
  640. badge: generateBadgeTheme(lightColors),
  641. button: generateButtonTheme(lightColors, lightAliases),
  642. tag: generateTagTheme(lightColors),
  643. level: generateLevelTheme(lightColors),
  644. sidebar: {
  645. ...commonTheme.sidebar,
  646. background: sidebarBackground.light,
  647. },
  648. sidebarGradient: `linear-gradient(294.17deg,${sidebarBackground.light} 35.57%,#452650 92.42%,#452650 92.42%)`,
  649. sidebarBorder: 'transparent',
  650. };
  651. export const darkTheme: Theme = {
  652. ...commonTheme,
  653. ...darkColors,
  654. ...darkAliases,
  655. ...darkShadows,
  656. inverted: {
  657. ...lightColors,
  658. ...lightAliases,
  659. },
  660. alert: generateAlertTheme(darkColors, darkAliases),
  661. badge: generateBadgeTheme(darkColors),
  662. button: generateButtonTheme(darkColors, darkAliases),
  663. tag: generateTagTheme(darkColors),
  664. level: generateLevelTheme(darkColors),
  665. sidebar: {
  666. ...commonTheme.sidebar,
  667. background: sidebarBackground.dark,
  668. },
  669. sidebarGradient: `linear-gradient(180deg, ${sidebarBackground.dark} 0%, #1B1825 100%)`,
  670. sidebarBorder: darkAliases.border,
  671. };
  672. export type Theme = typeof lightTheme;
  673. export type Aliases = typeof lightAliases;
  674. export type Color = keyof typeof lightColors;
  675. export type IconSize = keyof typeof iconSizes;
  676. export default commonTheme;
  677. type MyTheme = Theme;
  678. /**
  679. * Configure Emotion to use our theme
  680. */
  681. declare module '@emotion/react' {
  682. // eslint-disable-next-line @typescript-eslint/no-shadow
  683. export interface Theme extends MyTheme {}
  684. }
  685. // This should never be used directly (except in storybook)
  686. export {lightAliases as aliases};