toolbar.less 8.3 KB

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