_variables.scss.tmpl.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. $spacer: 1rem !default;
  16. $spacer-x: $spacer !default;
  17. $spacer-y: $spacer !default;
  18. $spacers: (
  19. 0: (x: 0, y: 0),
  20. 1: (x: $spacer-x, y: $spacer-y),
  21. 2: (x: ($spacer-x * 1.5), y: ($spacer-y * 1.5)),
  22. 3: (x: ($spacer-x * 3), y: ($spacer-y * 3))
  23. )
  24. !default;
  25. $border-width: 1px !default;
  26. // Grid breakpoints
  27. //
  28. // Define the minimum and maximum dimensions at which your layout will change,
  29. // adapting to different screen sizes, for use in media queries.
  30. $grid-breakpoints: (xs: 0, sm: 544px, md: 768px, lg: 992px, xl: 1200px) !default;
  31. // Grid containers
  32. //
  33. // Define the maximum width of .container for different screen sizes.
  34. $container-max-widths: (sm: 576px, md: 720px, lg: 940px, xl: 1080px) !default;
  35. // Grid columns
  36. //
  37. // Set the number of columns and specify the width of the gutters.
  38. $grid-columns: 12 !default;
  39. $grid-gutter-width: 30px !default;
  40. $enable-flex: true;
  41. // Typography
  42. // -------------------------
  43. $font-family-sans-serif: ${theme.typography.fontFamily.sansSerif};
  44. $font-family-serif: ${theme.typography.fontFamily.serif};
  45. $font-family-monospace: ${theme.typography.fontFamily.monospace};
  46. $font-family-base: $font-family-sans-serif !default;
  47. $font-size-root: 14px !default;
  48. $font-size-base: 13px !default;
  49. $font-size-lg: 18px !default;
  50. $font-size-md: 14px !default;
  51. $font-size-sm: 12px !default;
  52. $font-size-xs: 10px !default;
  53. $line-height-base: 1.5 !default;
  54. $font-weight-semi-bold: 500;
  55. $font-size-h1: 2rem !default;
  56. $font-size-h2: 1.75rem !default;
  57. $font-size-h3: 1.5rem !default;
  58. $font-size-h4: 1.3rem !default;
  59. $font-size-h5: 1.2rem !default;
  60. $font-size-h6: 1rem !default;
  61. $display1-size: 6rem !default;
  62. $display2-size: 5.5rem !default;
  63. $display3-size: 4.5rem !default;
  64. $display4-size: 3.5rem !default;
  65. $display1-weight: 400 !default;
  66. $display2-weight: 400 !default;
  67. $display3-weight: 400 !default;
  68. $display4-weight: 400 !default;
  69. $lead-font-size: 1.25rem !default;
  70. $lead-font-weight: 300 !default;
  71. $headings-margin-bottom: ($spacer / 2) !default;
  72. $headings-font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  73. $headings-font-weight: 400 !default;
  74. $headings-line-height: 1.1 !default;
  75. $hr-border-width: $border-width !default;
  76. $dt-font-weight: bold !default;
  77. // Components
  78. //
  79. // Define common padding and border radius sizes and more.
  80. $line-height-lg: (4 / 3) !default;
  81. $line-height-sm: 1.5 !default;
  82. $border-radius: 3px !default;
  83. $border-radius-lg: 5px !default;
  84. $border-radius-sm: 2px!default;
  85. // Page
  86. $page-sidebar-width: 11rem;
  87. $page-sidebar-margin: 4rem;
  88. // Links
  89. // -------------------------
  90. $link-decoration: none !default;
  91. $link-hover-decoration: none !default;
  92. // Tables
  93. //
  94. // Customizes the table component with basic values, each used across all table variations.
  95. $table-cell-padding: 4px 10px !default;
  96. // Forms
  97. $input-padding-x: 10px !default;
  98. $input-padding-y: 8px !default;
  99. $input-line-height: 18px !default;
  100. $input-btn-border-width: 1px;
  101. $input-border-radius: 0 $border-radius $border-radius 0 !default;
  102. $input-border-radius-sm: 0 $border-radius-sm $border-radius-sm 0 !default;
  103. $label-border-radius: $border-radius 0 0 $border-radius !default;
  104. $label-border-radius-sm: $border-radius-sm 0 0 $border-radius-sm !default;
  105. $input-padding-y-sm: 4px !default;
  106. $input-padding-x-lg: 20px !default;
  107. $input-padding-y-lg: 10px !default;
  108. $input-height: 35px !default;
  109. $gf-form-margin: 0.2rem;
  110. $gf-form-input-height: 35px;
  111. $cursor-disabled: not-allowed !default;
  112. // Form validation icons
  113. $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")
  114. !default;
  115. $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")
  116. !default;
  117. $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")
  118. !default;
  119. // Z-index master list
  120. // -------------------------
  121. // Used for a bird's eye view of components dependent on the z-axis
  122. // Try to avoid customizing these :)
  123. $zindex-dropdown: 1000;
  124. $zindex-navbar-fixed: 1020;
  125. $zindex-sidemenu: 1025;
  126. $zindex-tooltip: 1030;
  127. $zindex-modal-backdrop: 1040;
  128. $zindex-modal: 1050;
  129. $zindex-typeahead: 1060;
  130. // Buttons
  131. //
  132. $btn-padding-x: 1rem !default;
  133. $btn-padding-y: 0.7rem !default;
  134. $btn-line-height: 1 !default;
  135. $btn-font-weight: 500 !default;
  136. $btn-padding-x-sm: 0.5rem !default;
  137. $btn-padding-y-sm: 0.25rem !default;
  138. $btn-padding-x-lg: 21px !default;
  139. $btn-padding-y-lg: 11px !default;
  140. $btn-padding-x-xl: 21px !default;
  141. $btn-padding-y-xl: 11px !default;
  142. $btn-border-radius: 2px;
  143. $btn-semi-transparent: rgba(0, 0, 0, 0.2) !default;
  144. // sidemenu
  145. $side-menu-width: 60px;
  146. // dashboard
  147. $panel-margin: 10px;
  148. $dashboard-padding: $panel-margin * 2;
  149. $panel-horizontal-padding: 10;
  150. $panel-vertical-padding: 5;
  151. $panel-padding: 0px $panel-horizontal-padding+0px $panel-vertical-padding+0px $panel-horizontal-padding+0px;
  152. // tabs
  153. $tabs-padding: 10px 15px 9px;
  154. $external-services: (
  155. github: (bgColor: #464646, borderColor: #393939, icon: ''),
  156. gitlab: (bgColor: #fc6d26, borderColor: #e24329, icon: ''),
  157. google: (bgColor: #e84d3c, borderColor: #b83e31, icon: ''),
  158. grafanacom: (bgColor: #262628, borderColor: #393939, icon: ''),
  159. oauth: (bgColor: #262628, borderColor: #393939, icon: '')
  160. )
  161. !default;
  162. :export {
  163. panelhorizontalpadding: $panel-horizontal-padding;
  164. panelverticalpadding: $panel-vertical-padding;
  165. }
  166. `;