_variables.scss.tmpl.ts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /* tslint:disable:max-line-length */
  2. import { GrafanaThemeCommons } from '../types';
  3. import { renderGeneratedFileBanner } from '../utils/generatedFileBanner';
  4. export const commonThemeVarsTemplate = (theme: GrafanaThemeCommons) =>
  5. `${renderGeneratedFileBanner('grafana-ui/src/themes/default.ts', 'grafana-ui/src/themes/_variables.scss.tmpl.ts')}
  6. // Options
  7. //
  8. // Quickly modify global styling by enabling or disabling optional features.
  9. $enable-flex: true !default;
  10. $enable-hover-media-query: false !default;
  11. // Spacing
  12. //
  13. // Control the default styling of most Bootstrap elements by modifying these
  14. // variables. Mostly focused on spacing.
  15. $space-xxs: ${theme.spacing.xxs} !default;
  16. $space-xs: ${theme.spacing.xs} !default;
  17. $space-sm: ${theme.spacing.sm} !default;
  18. $space-md: ${theme.spacing.md} !default;
  19. $space-lg: ${theme.spacing.lg} !default;
  20. $space-xl: ${theme.spacing.xl} !default;
  21. $spacer: ${theme.spacing.d} !default;
  22. $spacer-x: $spacer !default;
  23. $spacer-y: $spacer !default;
  24. $spacers: (
  25. 0: (
  26. x: 0,
  27. y: 0,
  28. ),
  29. 1: (
  30. x: $spacer-x,
  31. y: $spacer-y,
  32. ),
  33. 2: (
  34. x: (
  35. $spacer-x * 1.5,
  36. ),
  37. y: (
  38. $spacer-y * 1.5,
  39. ),
  40. ),
  41. 3: (
  42. x: (
  43. $spacer-x * 3,
  44. ),
  45. y: (
  46. $spacer-y * 3,
  47. ),
  48. ),
  49. ) !default;
  50. // Grid breakpoints
  51. //
  52. // Define the minimum and maximum dimensions at which your layout will change,
  53. // adapting to different screen sizes, for use in media queries.
  54. $grid-breakpoints: (
  55. xs: ${theme.breakpoints.xs},
  56. sm: ${theme.breakpoints.sm},
  57. md: ${theme.breakpoints.md},
  58. lg: ${theme.breakpoints.lg},
  59. xl: ${theme.breakpoints.xl},
  60. ) !default;
  61. // Grid containers
  62. //
  63. // Define the maximum width of \`.container\` for different screen sizes.
  64. $container-max-widths: (
  65. sm: 576px,
  66. md: 720px,
  67. lg: 940px,
  68. xl: 1080px,
  69. ) !default;
  70. // Grid columns
  71. //
  72. // Set the number of columns and specify the width of the gutters.
  73. $grid-columns: 12 !default;
  74. $grid-gutter-width: ${theme.spacing.gutter} !default;
  75. // Typography
  76. // -------------------------
  77. $font-family-sans-serif: ${theme.typography.fontFamily.sansSerif};
  78. $font-family-monospace: ${theme.typography.fontFamily.monospace};
  79. $font-size-root: ${theme.typography.size.root} !default;
  80. $font-size-base: ${theme.typography.size.base} !default;
  81. $font-size-lg: ${theme.typography.size.lg} !default;
  82. $font-size-md: ${theme.typography.size.md} !default;
  83. $font-size-sm: ${theme.typography.size.sm} !default;
  84. $font-size-xs: ${theme.typography.size.xs} !default;
  85. $line-height-base: ${theme.typography.lineHeight.lg} !default;
  86. $font-weight-regular: ${theme.typography.weight.regular} !default;
  87. $font-weight-semi-bold: ${theme.typography.weight.semibold} !default;
  88. $font-size-h1: ${theme.typography.heading.h1} !default;
  89. $font-size-h2: ${theme.typography.heading.h2} !default;
  90. $font-size-h3: ${theme.typography.heading.h3} !default;
  91. $font-size-h4: ${theme.typography.heading.h4} !default;
  92. $font-size-h5: ${theme.typography.heading.h5} !default;
  93. $font-size-h6: ${theme.typography.heading.h6} !default;
  94. $headings-line-height: ${theme.typography.lineHeight.sm} !default;
  95. // Components
  96. //
  97. // Define common padding and border radius sizes and more.
  98. $border-width: ${theme.border.width.sm} !default;
  99. $border-radius: ${theme.border.radius.md} !default;
  100. $border-radius-lg: ${theme.border.radius.lg} !default;
  101. $border-radius-sm: ${theme.border.radius.sm} !default;
  102. // Page
  103. $page-sidebar-width: 154px;
  104. $page-sidebar-margin: 56px;
  105. // Links
  106. // -------------------------
  107. $link-decoration: ${theme.typography.link.decoration} !default;
  108. $link-hover-decoration: ${theme.typography.link.hoverDecoration} !default;
  109. // Tables
  110. //
  111. // Customizes the \`.table\` component with basic values, each used across all table variations.
  112. $table-cell-padding: 4px 10px !default;
  113. // Forms
  114. $input-padding-x: 10px !default;
  115. $input-padding-y: 8px !default;
  116. $input-line-height: 18px !default;
  117. $input-border-radius: 0 $border-radius $border-radius 0 !default;
  118. $input-border-radius-sm: 0 $border-radius-sm $border-radius-sm 0 !default;
  119. $label-border-radius: $border-radius 0 0 $border-radius !default;
  120. $label-border-radius-sm: $border-radius-sm 0 0 $border-radius-sm !default;
  121. $input-padding-x-lg: 20px !default;
  122. $input-padding-y-lg: 10px !default;
  123. $input-height: 35px !default;
  124. $cursor-disabled: not-allowed !default;
  125. // Form validation icons
  126. $form-icon-success: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%235cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E") !default;
  127. $form-icon-warning: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E") !default;
  128. $form-icon-danger: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E") !default;
  129. // Z-index master list
  130. // -------------------------
  131. // Used for a bird's eye view of components dependent on the z-axis
  132. // Try to avoid customizing these :)
  133. $zindex-dropdown: ${theme.zIndex.dropdown};
  134. $zindex-navbar-fixed: ${theme.zIndex.navbarFixed};
  135. $zindex-sidemenu: ${theme.zIndex.sidemenu};
  136. $zindex-tooltip: ${theme.zIndex.tooltip};
  137. $zindex-modal-backdrop: ${theme.zIndex.modalBackdrop};
  138. $zindex-modal: ${theme.zIndex.modal};
  139. $zindex-typeahead: ${theme.zIndex.typeahead};
  140. // Buttons
  141. //
  142. $btn-padding-x: 14px !default;
  143. $btn-padding-y: 10px !default;
  144. $btn-line-height: 1 !default;
  145. $btn-font-weight: ${theme.typography.weight.semibold} !default;
  146. $btn-padding-x-sm: 7px !default;
  147. $btn-padding-y-sm: 4px !default;
  148. $btn-padding-x-lg: 21px !default;
  149. $btn-padding-y-lg: 11px !default;
  150. $btn-padding-x-xl: 21px !default;
  151. $btn-padding-y-xl: 11px !default;
  152. $btn-semi-transparent: rgba(0, 0, 0, 0.2) !default;
  153. // sidemenu
  154. $side-menu-width: 60px;
  155. // dashboard
  156. $dashboard-padding: $space-md $space-md 0 $space-md;
  157. $panel-padding: 0 $space-md $space-sm $space-md;
  158. // tabs
  159. $tabs-padding: 10px 15px 9px;
  160. $external-services: (
  161. github: (
  162. bgColor: #464646,
  163. borderColor: #393939,
  164. icon: '',
  165. ),
  166. gitlab: (
  167. bgColor: #fc6d26,
  168. borderColor: #e24329,
  169. icon: '',
  170. ),
  171. google: (
  172. bgColor: #e84d3c,
  173. borderColor: #b83e31,
  174. icon: '',
  175. ),
  176. grafanacom: (
  177. bgColor: #262628,
  178. borderColor: #393939,
  179. icon: '',
  180. ),
  181. oauth: (
  182. bgColor: #262628,
  183. borderColor: #393939,
  184. icon: '',
  185. ),
  186. ) !default;
  187. `;