toolbar.less 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. @toolbar-height: 40px;
  2. .toolbar {
  3. display: flex;
  4. align-items: center;
  5. height: @toolbar-height;
  6. border-bottom: @toolbar-border-bottom;
  7. > a,
  8. .toolbar-right > a,
  9. button {
  10. position: relative;
  11. .label {
  12. position: absolute;
  13. top: 0;
  14. right: 0;
  15. padding: 0.15em 0.6em 0.2em;
  16. font-size: 60%;
  17. pointer-events: none; // Labels were capturing button/anchor clicks.
  18. }
  19. }
  20. .toolbar-right,
  21. .toolbar-left {
  22. button {
  23. background: transparent;
  24. box-shadow: none;
  25. }
  26. }
  27. > a:focus,
  28. button:focus {
  29. outline: none;
  30. }
  31. > a:not(.btn),
  32. > button,
  33. .toolbar-left > a:not(.btn),
  34. .toolbar-left > button,
  35. .toolbar-right > a:not(.btn),
  36. .toolbar-right > button {
  37. display: inline-block;
  38. color: @toolbar-icon-btn-color;
  39. background-color: transparent;
  40. padding: 4px 2px;
  41. line-height: 1;
  42. height: 24px;
  43. border-radius: @border-radius-small;
  44. &.toolbar-header-back-projects {
  45. padding: 5px 10px 4px;
  46. margin-bottom: 1px;
  47. }
  48. &:hover {
  49. text-shadow: @toolbar-icon-btn-hover-shadow;
  50. color: @toolbar-icon-btn-hover-color;
  51. background-color: transparent;
  52. text-decoration: none;
  53. }
  54. &.active,
  55. &:active {
  56. .label {
  57. display: none;
  58. }
  59. color: white;
  60. background-color: @link-color;
  61. box-shadow: @toolbar-icon-btn-hover-boxshadow;
  62. &:hover {
  63. color: white;
  64. }
  65. }
  66. }
  67. &.toolbar-pdf > a:not(.btn) {
  68. margin-right: 3px;
  69. }
  70. .btn-full-height {
  71. border: none;
  72. border-radius: 0;
  73. border-right: 1px solid @toolbar-header-btn-border-color;
  74. color: @toolbar-btn-color;
  75. padding: 3px 10px 5px;
  76. font-size: 20px;
  77. max-height: 39px;
  78. &:hover {
  79. text-shadow: @toolbar-btn-hover-text-shadow;
  80. background-color: @toolbar-btn-hover-bg-color;
  81. color: @toolbar-btn-hover-color;
  82. }
  83. &.active,
  84. &:active {
  85. color: @toolbar-btn-active-color;
  86. background-color: @toolbar-btn-active-bg-color;
  87. box-shadow: @toolbar-btn-active-shadow;
  88. }
  89. .label {
  90. top: 4px;
  91. right: 4px;
  92. }
  93. &.header-cobranding-logo-container {
  94. height: @toolbar-height - 1;
  95. padding: 8px 10px;
  96. }
  97. }
  98. .btn-full-height-no-border {
  99. border-right: 0;
  100. border-left: 0;
  101. }
  102. .toolbar-left {
  103. display: flex;
  104. float: left;
  105. text-align: center;
  106. align-items: center;
  107. }
  108. .toolbar-right {
  109. display: flex;
  110. align-items: center;
  111. flex-grow: 1;
  112. justify-content: flex-end;
  113. .btn-full-height {
  114. border-right: 0;
  115. border-left: 1px solid @toolbar-header-btn-border-color;
  116. }
  117. }
  118. .toolbar-center {
  119. text-align: center;
  120. text-overflow: ellipsis;
  121. overflow: hidden;
  122. // At small screen sizes, center relative to the left menu and right buttons
  123. width: 100%;
  124. display: flex;
  125. justify-content: center;
  126. }
  127. &.toolbar-header {
  128. background-color: @toolbar-header-bg-color;
  129. box-shadow: @toolbar-header-shadow;
  130. position: absolute;
  131. top: 0;
  132. left: 0;
  133. right: 0;
  134. z-index: 1;
  135. }
  136. &.toolbar-small {
  137. .toolbar-small-mixin;
  138. }
  139. &.toolbar-tall {
  140. .toolbar-small-mixin;
  141. }
  142. &.toolbar-alt {
  143. .toolbar-alt-mixin;
  144. }
  145. }
  146. .header-cobranding-logo {
  147. display: block;
  148. width: auto;
  149. max-height: 100%;
  150. }
  151. .toolbar-small-mixin() {
  152. height: @toolbar-small-height;
  153. }
  154. .toolbar-tall-mixin() {
  155. height: @toolbar-tall-height;
  156. padding-top: 10px;
  157. }
  158. .toolbar-alt-mixin() {
  159. background-color: @toolbar-alt-bg-color;
  160. }
  161. .toolbar-label {
  162. display: none;
  163. margin: 0 4px;
  164. font-size: @toolbar-font-size;
  165. font-weight: 600;
  166. margin-bottom: 2px;
  167. vertical-align: middle;
  168. text-align: left;
  169. @media (min-width: @screen-md-min) {
  170. display: inline-block;
  171. }
  172. &.toolbar-label-multiline {
  173. line-height: 1.1;
  174. }
  175. }
  176. .toolbar-header-upgrade-prompt {
  177. margin-left: 10px;
  178. @media (max-width: @screen-md-min) {
  179. display: none;
  180. }
  181. }
  182. .editor-dark {
  183. .toolbar-alt {
  184. background-color: darken(@editor-dark-background-color, 0%);
  185. }
  186. .toolbar {
  187. border-color: @editor-dark-toolbar-border-color;
  188. .btn-full-height {
  189. border-color: @editor-dark-toolbar-border-color;
  190. &:hover {
  191. background-color: black;
  192. color: lighten(@link-color, 10%);
  193. }
  194. }
  195. &.toolbar-header {
  196. box-shadow: none;
  197. }
  198. > a:not(.btn) {
  199. color: @gray;
  200. &:hover {
  201. color: @gray-light;
  202. }
  203. }
  204. }
  205. }
  206. /**************************************
  207. Toggle Switch
  208. ***************************************/
  209. .toggle-wrapper {
  210. white-space: nowrap;
  211. }
  212. .toggle-switch {
  213. display: flex;
  214. align-items: center;
  215. height: @toolbar-btn-height;
  216. margin-right: 5px;
  217. border-radius: @btn-border-radius-base;
  218. overflow: hidden;
  219. background-color: @toggle-switch-bg;
  220. padding: 2px;
  221. }
  222. .toggle-switch-label {
  223. display: inline-block;
  224. float: left;
  225. font-weight: normal;
  226. height: 100%;
  227. text-align: center;
  228. margin: 0;
  229. cursor: pointer;
  230. user-select: none;
  231. color: @text-color;
  232. transition: color 0.12s ease-out;
  233. overflow: hidden;
  234. span {
  235. display: flex;
  236. align-items: center;
  237. height: 100%;
  238. width: 100%;
  239. padding: 0 8px;
  240. background-size: 200% 100%;
  241. background-position: 0 0;
  242. transition: background-position 0.12s ease-out;
  243. font-size: 14px;
  244. font-weight: bold;
  245. }
  246. }
  247. .toggle-switch-input {
  248. position: absolute;
  249. opacity: 0;
  250. pointer-events: none;
  251. }
  252. .toggle-switch-input:checked + .toggle-switch-label {
  253. span {
  254. background-position: -100% 0;
  255. }
  256. color: @white;
  257. background-color: @toggle-switch-highlight-color;
  258. border-radius: @btn-border-radius-base;
  259. box-shadow: 0px 2px 4px rgba(30, 37, 48, 0.16);
  260. }
  261. .toggle-switch-input:checked:nth-child(2) + .toggle-switch-label {
  262. span {
  263. background-position: 100% 0;
  264. }
  265. }
  266. .editor-toggle-switch {
  267. display: flex;
  268. align-items: center;
  269. .toggle-switch {
  270. margin-left: 5px;
  271. }
  272. .toggle-switch-label span {
  273. background: none;
  274. transition: background 0.12s ease-out;
  275. }
  276. .toggle-switch-label:first-of-type span {
  277. padding-left: 8px;
  278. }
  279. .toggle-switch-label:last-of-type span {
  280. padding-right: 8px;
  281. border-right: none;
  282. }
  283. }
  284. /**************************************
  285. Formatting buttons
  286. ***************************************/
  287. .formatting-buttons {
  288. width: 100%;
  289. overflow: hidden;
  290. }
  291. .formatting-buttons-wrapper {
  292. display: flex;
  293. }
  294. .formatting-btn {
  295. color: @formatting-btn-color;
  296. background-color: @formatting-btn-bg;
  297. padding: 0;
  298. height: 100%;
  299. display: flex;
  300. align-items: center;
  301. justify-content: center;
  302. box-shadow: none;
  303. border: none;
  304. border-left: 1px solid @formatting-btn-border;
  305. border-radius: 0;
  306. &:hover {
  307. color: @formatting-btn-color;
  308. }
  309. &.active {
  310. color: @toolbar-btn-active-color;
  311. background-color: @toolbar-btn-active-bg-color;
  312. box-shadow: @toolbar-btn-active-shadow;
  313. &:focus {
  314. color: @toolbar-btn-active-color;
  315. &:not(:focus-visible) {
  316. outline: none;
  317. }
  318. }
  319. }
  320. &:focus {
  321. color: @formatting-btn-color;
  322. }
  323. }
  324. .formatting-btn--icon {
  325. min-width: 32px;
  326. width: 32px;
  327. }
  328. .formatting-btn--icon:last-of-type {
  329. border-right: 1px solid @formatting-btn-border;
  330. }
  331. .formatting-btn--more {
  332. padding-left: 9px;
  333. padding-right: 9px;
  334. .caret {
  335. margin-top: 1px;
  336. }
  337. }
  338. .formatting-icon {
  339. font-style: normal;
  340. line-height: 1.5;
  341. }
  342. .formatting-icon--small {
  343. font-size: small;
  344. line-height: 1.9;
  345. }
  346. .formatting-icon--serif {
  347. font-family: @font-family-serif;
  348. }
  349. .formatting-more {
  350. margin-left: auto;
  351. }
  352. .formatting-menu {
  353. min-width: auto;
  354. max-width: 130px;
  355. background-color: @formatting-menu-bg;
  356. }
  357. .formatting-menu-item {
  358. float: left;
  359. }
  360. .formatting-menu-item > .formatting-btn {
  361. border-right: none;
  362. }
  363. // Disable border on left-most icon in menu
  364. .formatting-menu-item:nth-of-type(4n + 1) > .formatting-btn {
  365. border-left: none;
  366. }
  367. .toolbar.toolbar-pdf > a[disabled] {
  368. cursor: not-allowed;
  369. .opacity(0.65);
  370. .box-shadow(none);
  371. }
  372. .toolbar-btn-secondary {
  373. height: @toolbar-btn-height;
  374. padding-bottom: 0px;
  375. margin-bottom: 0.5px;
  376. }