toolbar.less 8.5 KB

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