toolbar.less 8.4 KB

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