toolbar.less 8.6 KB

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