toolbar.less 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. .toolbar {
  2. display: flex;
  3. align-items: center;
  4. height: 40px;
  5. border-bottom: @toolbar-border-bottom;
  6. > a, .toolbar-right > a {
  7. position: relative;
  8. .label {
  9. position: absolute;
  10. top: 0;
  11. right: 0;
  12. padding: .15em .6em .2em;
  13. font-size: 60%;
  14. pointer-events: none; // Labels were capturing button/anchor clicks.
  15. }
  16. }
  17. > a:focus {
  18. outline: none;
  19. }
  20. > a:not(.btn),
  21. .toolbar-left > a:not(.btn),
  22. .toolbar-right > a:not(.btn) {
  23. display: inline-block;
  24. color: @toolbar-icon-btn-color;
  25. padding: 4px 2px;
  26. line-height: 1;
  27. height: 24px;
  28. border-radius: @border-radius-small;
  29. &.toolbar-header-back-projects {
  30. padding: 5px 10px 4px;
  31. margin-bottom: 1px;
  32. }
  33. &:hover {
  34. text-shadow: @toolbar-icon-btn-hover-shadow;
  35. color: @toolbar-icon-btn-hover-color;
  36. text-decoration: none;
  37. }
  38. &.active, &:active {
  39. .label {
  40. display: none;
  41. }
  42. color: white;
  43. background-color: @link-color;
  44. box-shadow: @toolbar-icon-btn-hover-boxshadow;
  45. &:hover {
  46. color: white;
  47. }
  48. }
  49. }
  50. &.toolbar-pdf > a:not(.btn) {
  51. margin-right: 3px;
  52. }
  53. .btn-full-height {
  54. border: none;
  55. border-radius: 0;
  56. border-right: 1px solid @toolbar-border-color;
  57. color: @toolbar-btn-color;
  58. padding: 3px 10px 5px;
  59. font-size: 20px;
  60. &:hover {
  61. text-shadow: @toolbar-btn-hover-text-shadow;
  62. background-color: @toolbar-btn-hover-bg-color;
  63. color: @toolbar-btn-hover-color;
  64. }
  65. &.active, &:active {
  66. color: @toolbar-btn-active-color;
  67. background-color: @toolbar-btn-active-bg-color;
  68. box-shadow: @toolbar-btn-active-shadow;
  69. }
  70. .label {
  71. top: 4px;
  72. right: 4px;
  73. }
  74. }
  75. .btn-full-height-no-border {
  76. border-right: 0;
  77. border-left: 0;
  78. }
  79. .toolbar-left {
  80. display: flex;
  81. float: left;
  82. text-align: center;
  83. align-items: center;
  84. }
  85. .toolbar-right {
  86. display: flex;
  87. align-items: center;
  88. flex-grow: 1;
  89. justify-content: flex-end;
  90. .btn-full-height {
  91. border-right: 0;
  92. border-left: 1px solid @toolbar-border-color;
  93. }
  94. }
  95. .toolbar-center {
  96. width: 300px;
  97. position: absolute;
  98. top: 0;
  99. left: 50%;
  100. margin-left: -150px;
  101. text-align: center;
  102. text-overflow: ellipsis;
  103. overflow: hidden;
  104. }
  105. &.toolbar-header {
  106. background-color: @toolbar-header-bg-color;
  107. box-shadow: @toolbar-header-shadow;
  108. position: absolute;
  109. top: 0;
  110. left: 0;
  111. right: 0;
  112. z-index: 1;
  113. }
  114. &.toolbar-small {
  115. .toolbar-small-mixin;
  116. }
  117. &.toolbar-tall {
  118. .toolbar-small-mixin;
  119. }
  120. &.toolbar-alt {
  121. .toolbar-alt-mixin;
  122. }
  123. }
  124. .toolbar-small-mixin() {
  125. height: @toolbar-small-height;
  126. }
  127. .toolbar-tall-mixin() {
  128. height: @toolbar-tall-height;
  129. padding-top: 10px;
  130. }
  131. .toolbar-alt-mixin() {
  132. background-color: @toolbar-alt-bg-color;
  133. }
  134. .toolbar-label {
  135. display: none;
  136. margin: 0 4px;
  137. font-size: @toolbar-font-size;
  138. font-weight: 600;
  139. margin-bottom: 2px;
  140. vertical-align: middle;
  141. @media (min-width: @screen-sm-min) {
  142. display: inline-block;
  143. }
  144. }
  145. .editor-dark {
  146. .toolbar-alt {
  147. background-color: darken(@editor-dark-background-color, 0%);
  148. }
  149. .toolbar {
  150. border-color: @editor-dark-toolbar-border-color;
  151. .btn-full-height {
  152. border-color: @editor-dark-toolbar-border-color;
  153. &:hover {
  154. background-color: black;
  155. color: lighten(@link-color, 10%);
  156. }
  157. }
  158. &.toolbar-header {
  159. box-shadow: none;
  160. }
  161. > a:not(.btn) {
  162. color: @gray;
  163. &:hover {
  164. color: @gray-light;
  165. }
  166. }
  167. }
  168. }
  169. .toggle-wrapper {
  170. width: 200px;
  171. height: 24px;
  172. }
  173. .toggle-switch {
  174. position: relative;
  175. height: 100%;
  176. width: 100%;
  177. background-color: @toggle-switch-bg;
  178. border-radius: @btn-border-radius-base;
  179. }
  180. .toggle-switch-label {
  181. position: relative;
  182. display: block;
  183. font-weight: normal;
  184. z-index: 2;
  185. float: left;
  186. width: 50%;
  187. height: 100%;
  188. line-height: 24px;
  189. text-align: center;
  190. margin-bottom: 0;
  191. cursor: pointer;
  192. user-select: none;
  193. transition: color 0.12s ease-out;
  194. }
  195. .toggle-switch-input {
  196. position: absolute;
  197. opacity: 0;
  198. }
  199. .toggle-switch-input:checked + .toggle-switch-label {
  200. color: #fff;
  201. font-weight: bold;
  202. }
  203. .toggle-switch-selection {
  204. display: block;
  205. position: absolute;
  206. z-index: 1;
  207. top: 2px;
  208. left: 2px;
  209. right: 2px;
  210. width: calc(~"50% - 2px");
  211. height: calc(~"100% - 4px");
  212. background: @toggle-switch-highlight-color;
  213. border-radius: @btn-border-radius-base 0 0 @btn-border-radius-base;
  214. transition: transform 0.12s ease-out, border-radius 0.12s ease-out;
  215. }
  216. .toggle-switch-input:checked:nth-child(4) ~ .toggle-switch-selection {
  217. transform: translate(100%);
  218. border-radius: 0 @btn-border-radius-base @btn-border-radius-base 0;
  219. }