toolbar.less 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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. transition: color 0.12s ease-out;
  229. overflow: hidden;
  230. span {
  231. display: flex;
  232. align-items: center;
  233. height: 100%;
  234. width: 100%;
  235. padding: 0 8px;
  236. background-size: 200% 100%;
  237. background-position: 0 0;
  238. transition: background-position 0.12s ease-out;
  239. font-size: 14px;
  240. font-weight: bold;
  241. }
  242. }
  243. .toggle-switch-input {
  244. position: absolute;
  245. opacity: 0;
  246. pointer-events: none;
  247. }
  248. .toggle-switch-input:disabled + .toggle-switch-label {
  249. cursor: not-allowed;
  250. }
  251. .toggle-switch-input:checked + .toggle-switch-label {
  252. span {
  253. background-position: -100% 0;
  254. }
  255. color: @white;
  256. background-color: @toggle-switch-highlight-color;
  257. border-radius: @btn-border-radius-base;
  258. box-shadow: 0px 2px 4px rgba(30, 37, 48, 0.16);
  259. }
  260. .toggle-switch-input:checked:nth-child(2) + .toggle-switch-label {
  261. span {
  262. background-position: 100% 0;
  263. }
  264. }
  265. .editor-toggle-switch {
  266. display: flex;
  267. align-items: center;
  268. .toggle-switch {
  269. margin-left: 5px;
  270. }
  271. .toggle-switch-label span {
  272. background: none;
  273. transition: background 0.12s ease-out;
  274. }
  275. .toggle-switch-label:first-of-type span {
  276. padding-left: 8px;
  277. }
  278. .toggle-switch-label:last-of-type span {
  279. padding-right: 8px;
  280. border-right: none;
  281. }
  282. }
  283. /**************************************
  284. Formatting buttons
  285. ***************************************/
  286. .formatting-buttons {
  287. width: 100%;
  288. overflow: hidden;
  289. }
  290. .formatting-buttons-wrapper {
  291. display: flex;
  292. }
  293. .formatting-btn {
  294. color: @formatting-btn-color;
  295. background-color: @formatting-btn-bg;
  296. padding: 0;
  297. height: 100%;
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. box-shadow: none;
  302. border: none;
  303. border-left: 1px solid @formatting-btn-border;
  304. border-radius: 0;
  305. &:hover {
  306. color: @formatting-btn-color;
  307. }
  308. &.active {
  309. color: @toolbar-btn-active-color;
  310. background-color: @toolbar-btn-active-bg-color;
  311. box-shadow: @toolbar-btn-active-shadow;
  312. &:focus {
  313. color: @toolbar-btn-active-color;
  314. &:not(:focus-visible) {
  315. outline: none;
  316. }
  317. }
  318. }
  319. &:focus {
  320. color: @formatting-btn-color;
  321. }
  322. }
  323. .formatting-btn--icon {
  324. min-width: 32px;
  325. width: 32px;
  326. }
  327. .formatting-btn--icon:last-of-type {
  328. border-right: 1px solid @formatting-btn-border;
  329. }
  330. .formatting-btn--more {
  331. padding-left: 9px;
  332. padding-right: 9px;
  333. .caret {
  334. margin-top: 1px;
  335. }
  336. }
  337. .formatting-icon {
  338. font-style: normal;
  339. line-height: 1.5;
  340. }
  341. .formatting-icon--small {
  342. font-size: small;
  343. line-height: 1.9;
  344. }
  345. .formatting-icon--serif {
  346. font-family: @font-family-serif;
  347. }
  348. .formatting-more {
  349. margin-left: auto;
  350. }
  351. .formatting-menu {
  352. min-width: auto;
  353. max-width: 130px;
  354. background-color: @formatting-menu-bg;
  355. }
  356. .formatting-menu-item {
  357. float: left;
  358. }
  359. .formatting-menu-item > .formatting-btn {
  360. border-right: none;
  361. }
  362. // Disable border on left-most icon in menu
  363. .formatting-menu-item:nth-of-type(4n + 1) > .formatting-btn {
  364. border-left: none;
  365. }
  366. .toolbar.toolbar-pdf > a[disabled] {
  367. cursor: not-allowed;
  368. .opacity(0.65);
  369. .box-shadow(none);
  370. }
  371. .toolbar-btn-secondary {
  372. height: @toolbar-btn-height;
  373. padding-bottom: 0px;
  374. margin-bottom: 0.5px;
  375. }