_tabler.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. // Disable font-ligatures for Chromium based browsers
  2. // Chromium requires `font-variant-ligatures: none` in addition to `font-feature-settings "liga" 0`
  3. * {
  4. font-feature-settings: "liga" 0;
  5. font-variant-ligatures: none;
  6. }
  7. // Restore default foreground & background colors for <pre> blocks
  8. pre {
  9. background-color: transparent;
  10. color: inherit;
  11. }
  12. // Slightly increase alert contrast between bg and text
  13. .alert {
  14. background: var(--#{$prefix}bg-surface);
  15. }
  16. // Permit copying of badge text
  17. .badge {
  18. user-select: text;
  19. }
  20. // Button adjustments
  21. .btn {
  22. // Tabler sets display: flex
  23. display: inline-block;
  24. &:focus {
  25. // Add button focus state
  26. border: 1px solid var(--tblr-primary-fg);
  27. outline: 2px solid var(--tblr-primary) !important;
  28. }
  29. }
  30. .btn-sm {
  31. // $border-radius-sm (2px) is too small
  32. border-radius: $border-radius;
  33. }
  34. // Dropdown items
  35. .dropdown-item {
  36. // Tabler sets display: flex
  37. display: inline-block;
  38. }
  39. // Set footer icon color
  40. .footer .text-primary {
  41. color: $rich-black !important;
  42. }
  43. // Tabs
  44. .nav-tabs {
  45. .nav-link {
  46. // Tabler sets display: flex
  47. display: inline-block;
  48. }
  49. }
  50. // Altering background colors
  51. .page, .page-tabs .nav-tabs .nav-link.active {
  52. background-color: var(--#{$prefix}bg-surface-tertiary) !important;
  53. }
  54. // Navigation bar
  55. .navbar {
  56. // Lighten highlight color of active item
  57. --tblr-navbar-active-bg: rgba(0, 0, 0, 0.06);
  58. }
  59. // Dark mode colors
  60. @if $enable-dark-mode {
  61. @include color-mode(dark, true) {
  62. --#{$prefix}alert-color: darken(var(--#{$prefix}warning),10%);
  63. --#{$prefix}link-color: #{$bright-teal};
  64. --#{$prefix}link-color-rgb: 0,242,212;
  65. --#{$prefix}link-hover-color-rgb: 0,242,212;
  66. --#{$prefix}secondary: #{$gray-400};
  67. --#{$prefix}primary: #{$bright-teal};
  68. --#{$prefix}primary-fg: #{$rich-black};
  69. --#{$prefix}primary-rgb: 0,242,212;
  70. --#{$prefix}btn-active-color: #{$rich-black};
  71. }
  72. }
  73. // Dark mode overrides
  74. body[data-bs-theme=dark] {
  75. // Override background color alpha value
  76. ::selection {
  77. background-color: rgba(var(--tblr-primary-rgb),.48);
  78. }
  79. .btn-primary {
  80. color: $rich-black !important;
  81. }
  82. // Change content color when primary teal changes with theme
  83. .bg-primary {
  84. .card-title,a,i {
  85. color: $rich-black !important;
  86. }
  87. }
  88. .text-bg-primary {
  89. color: $rich-black !important;
  90. }
  91. // Altering background colors
  92. .card {
  93. background: $rich-black !important;
  94. }
  95. // Background colors to match brand colors
  96. background-color: $rich-black;
  97. .navbar, .page-header {
  98. background-color: $rich-black;
  99. }
  100. .page, .page-tabs .nav-tabs .nav-link.active {
  101. background-color: $rich-black-light !important;
  102. }
  103. .page-link.active, .active>.page-link {
  104. color: $rich-black;
  105. }
  106. // Adjusting text colors
  107. .text- {
  108. &bg-primary {
  109. color: $rich-black !important;
  110. }
  111. &muted {
  112. color: var(--#{$prefix}secondary-color) !important;
  113. }
  114. &secondary {
  115. color: $gray-400 !important;
  116. }
  117. }
  118. .footer .text-primary {
  119. color: white !important;
  120. }
  121. .toast {
  122. color: var(--#{$prefix}body-color);
  123. }
  124. .table-primary {
  125. --tblr-table-bg: rgba(var(--tblr-secondary-rgb), 0.48);
  126. --tblr-table-hover-bg: inherit;
  127. --tblr-table-hover-color: inherit;
  128. }
  129. }
  130. // Do not apply padding to <code> elements inside a <pre>
  131. pre code {
  132. padding: unset;
  133. }
  134. // Use an icon instead of Tabler's native "caret" for dropdowns (avoids a Safari bug)
  135. .dropdown-toggle:after{
  136. font-family: "Material Design Icons";
  137. content: '\F0140';
  138. padding-right: 9px;
  139. border-bottom: none;
  140. border-left: none;
  141. transform: none;
  142. vertical-align: .05em;
  143. height: auto;
  144. }
  145. // Theme-based visibility utilities
  146. // Tabler's .hide-theme-* utilities expect data-bs-theme on :root, but NetBox applies
  147. // it to body. These overrides use higher specificity selectors to ensure theme-based
  148. // visibility works correctly. The :root:not(.dummy) pattern provides the additional
  149. // specificity needed to override Tabler's :root:not() rules.
  150. :root:not(.dummy) body[data-bs-theme='light'] .hide-theme-light,
  151. :root:not(.dummy) body[data-bs-theme='dark'] .hide-theme-dark {
  152. display: none !important;
  153. }
  154. :root:not(.dummy) body[data-bs-theme='dark'] .hide-theme-light,
  155. :root:not(.dummy) body[data-bs-theme='light'] .hide-theme-dark {
  156. display: inline-flex !important;
  157. }