toolbar.less 8.1 KB

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