styles.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { css } from '@emotion/css';
  2. import { GrafanaTheme2 } from '@grafana/data';
  3. import { stylesFactory } from '@grafana/ui';
  4. export interface InsightsStyles {
  5. tabContent: string;
  6. tabsBar: string;
  7. graphContainer: string;
  8. panelContent: string;
  9. userBoxesContainer: string;
  10. userBox: string;
  11. userName: string;
  12. tableContainer: string;
  13. tableHeader: string;
  14. userIcon: string;
  15. }
  16. export const getInsightsStyles = stylesFactory((theme: GrafanaTheme2): InsightsStyles => {
  17. const containerBg = theme.colors.background.secondary;
  18. return {
  19. tabContent: css`
  20. height: 100%;
  21. `,
  22. tabsBar: css`
  23. padding-left: ${theme.spacing(2)};
  24. margin: ${theme.spacing(3, -1, -3, -3)};
  25. `,
  26. graphContainer: css`
  27. margin-top: ${theme.spacing(2)};
  28. background-color: ${containerBg};
  29. `,
  30. panelContent: css`
  31. contain: none;
  32. `,
  33. userBoxesContainer: css`
  34. display: flex;
  35. margin-top: ${theme.spacing(3)};
  36. > div + div {
  37. margin-left: ${theme.spacing(2)};
  38. }
  39. `,
  40. userBox: css`
  41. padding: ${theme.spacing(2)};
  42. flex: 1;
  43. text-align: center;
  44. background-color: ${containerBg};
  45. border-radius: 3px;
  46. button,
  47. img {
  48. margin: ${theme.spacing(0, 0, 1, 0)};
  49. }
  50. `,
  51. userName: css`
  52. font-weight: ${theme.typography.fontWeightBold};
  53. `,
  54. tableContainer: css`
  55. margin-top: ${theme.spacing(3)};
  56. background-color: ${containerBg};
  57. padding-bottom: ${theme.spacing(1)};
  58. border-radius: 3px;
  59. [role='cell']:first-child > div {
  60. padding: 4px;
  61. }
  62. [role='columnheader']:first-child {
  63. height: 33px;
  64. }
  65. [role='row']:not(:only-child):nth-child(odd) {
  66. background-color: ${theme.colors.background.primary};
  67. }
  68. `,
  69. tableHeader: css`
  70. padding: ${theme.spacing(0, 2, 0.5, 2)};
  71. display: flex;
  72. justify-content: space-between;
  73. align-items: center;
  74. h4 {
  75. margin-bottom: 0px;
  76. padding: ${theme.spacing(3, 0)};
  77. }
  78. `,
  79. userIcon: css`
  80. margin: 0 0;
  81. width: 26px;
  82. height: 26px;
  83. `,
  84. };
  85. });