toolbar.less 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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. #layout-dropdown {
  148. // override style added by required bsStyle react-bootstrap prop
  149. text-decoration: none !important;
  150. }
  151. .layout-dropdown {
  152. .pdf-detach-survey {
  153. display: flex;
  154. font-size: @font-size-small;
  155. }
  156. .pdf-detach-survey-text {
  157. margin-left: @margin-sm;
  158. white-space: normal;
  159. }
  160. }
  161. #layout-dropdown-list {
  162. a {
  163. i {
  164. margin-right: @margin-xs;
  165. }
  166. }
  167. }
  168. .header-cobranding-logo {
  169. display: block;
  170. width: auto;
  171. max-height: 100%;
  172. }
  173. .toolbar-small-mixin() {
  174. height: @toolbar-small-height;
  175. }
  176. .toolbar-tall-mixin() {
  177. height: @toolbar-tall-height;
  178. padding-top: 10px;
  179. }
  180. .toolbar-alt-mixin() {
  181. background-color: @toolbar-alt-bg-color;
  182. }
  183. .toolbar-label {
  184. display: none;
  185. margin: 0 4px;
  186. font-size: @toolbar-font-size;
  187. font-weight: 600;
  188. margin-bottom: 2px;
  189. vertical-align: middle;
  190. text-align: left;
  191. @media (min-width: @screen-md-min) {
  192. display: inline-block;
  193. }
  194. &.toolbar-label-multiline {
  195. line-height: 1.1;
  196. }
  197. }
  198. .toolbar-header-upgrade-prompt {
  199. @media (max-width: @screen-md-min) {
  200. display: none;
  201. }
  202. }
  203. .editor-dark {
  204. .toolbar-alt {
  205. background-color: darken(@editor-dark-background-color, 0%);
  206. }
  207. .toolbar {
  208. border-color: @editor-dark-toolbar-border-color;
  209. .btn-full-height {
  210. border-color: @editor-dark-toolbar-border-color;
  211. &:hover {
  212. background-color: black;
  213. color: lighten(@link-color, 10%);
  214. }
  215. }
  216. &.toolbar-header {
  217. box-shadow: none;
  218. }
  219. > a:not(.btn) {
  220. color: @gray;
  221. &:hover {
  222. color: @gray-light;
  223. }
  224. }
  225. }
  226. }
  227. /**************************************
  228. Toggle Switch
  229. ***************************************/
  230. .toggle-wrapper {
  231. white-space: nowrap;
  232. height: 24px;
  233. }
  234. .toggle-switch {
  235. display: inline-flex;
  236. align-items: center;
  237. height: 24px;
  238. margin-right: 5px;
  239. border-radius: @btn-border-radius-base;
  240. overflow: hidden;
  241. }
  242. .toggle-switch-label {
  243. display: inline-block;
  244. float: left;
  245. font-weight: normal;
  246. height: 100%;
  247. text-align: center;
  248. margin: 0;
  249. cursor: pointer;
  250. user-select: none;
  251. color: @text-color;
  252. transition: color 0.12s ease-out;
  253. overflow: hidden;
  254. span {
  255. display: flex;
  256. align-items: center;
  257. height: 100%;
  258. line-height: 20px; // parent height minus border
  259. width: 100%;
  260. padding: 0 15px;
  261. background: linear-gradient(
  262. to right,
  263. @toggle-switch-bg 50%,
  264. @toggle-switch-highlight-color 50%
  265. );
  266. background-size: 200% 100%;
  267. background-position: 0 0;
  268. transition: background-position 0.12s ease-out;
  269. }
  270. }
  271. .toggle-switch-input {
  272. position: absolute;
  273. opacity: 0;
  274. }
  275. .toggle-switch-input:checked + .toggle-switch-label {
  276. span {
  277. background-position: -100% 0;
  278. }
  279. color: @white;
  280. font-weight: bold;
  281. }
  282. .toggle-switch-input:checked:nth-child(2) + .toggle-switch-label {
  283. span {
  284. background-position: 100% 0;
  285. }
  286. }
  287. .editor-toggle-switch {
  288. display: flex;
  289. align-items: center;
  290. .toggle-switch {
  291. margin-left: 5px;
  292. }
  293. .toggle-switch-label span {
  294. padding: 1px 6px;
  295. background: none;
  296. transition: background 0.12s ease-out;
  297. border-right: 1px solid @ol-blue-gray-2;
  298. }
  299. .toggle-switch-label:first-of-type span {
  300. padding-left: 8px;
  301. }
  302. .toggle-switch-label:last-of-type span {
  303. padding-right: 8px;
  304. border-right: none;
  305. }
  306. .toggle-switch-input + .toggle-switch-label {
  307. background: @toggle-switch-bg;
  308. }
  309. .toggle-switch-input:checked + .toggle-switch-label {
  310. background: @toggle-switch-highlight-color;
  311. }
  312. }
  313. /**************************************
  314. Formatting buttons
  315. ***************************************/
  316. .formatting-buttons {
  317. width: 100%;
  318. overflow: hidden;
  319. }
  320. .formatting-buttons-wrapper {
  321. display: flex;
  322. }
  323. .formatting-btn {
  324. color: @formatting-btn-color;
  325. background-color: @formatting-btn-bg;
  326. padding: 0;
  327. height: 100%;
  328. display: flex;
  329. align-items: center;
  330. justify-content: center;
  331. box-shadow: none;
  332. border: none;
  333. border-left: 1px solid @formatting-btn-border;
  334. border-radius: 0;
  335. &:hover {
  336. color: @formatting-btn-color;
  337. }
  338. &.active {
  339. color: @toolbar-btn-active-color;
  340. background-color: @toolbar-btn-active-bg-color;
  341. box-shadow: @toolbar-btn-active-shadow;
  342. &:focus {
  343. color: @toolbar-btn-active-color;
  344. &:not(:focus-visible) {
  345. outline: none;
  346. }
  347. }
  348. }
  349. &:focus {
  350. color: @formatting-btn-color;
  351. }
  352. }
  353. .formatting-btn--icon {
  354. min-width: 32px;
  355. width: 32px;
  356. }
  357. .formatting-btn--icon:last-of-type {
  358. border-right: 1px solid @formatting-btn-border;
  359. }
  360. .formatting-btn--more {
  361. padding-left: 9px;
  362. padding-right: 9px;
  363. .caret {
  364. margin-top: 1px;
  365. }
  366. }
  367. .formatting-icon {
  368. font-style: normal;
  369. line-height: 1.5;
  370. }
  371. .formatting-icon--small {
  372. font-size: small;
  373. line-height: 1.9;
  374. }
  375. .formatting-icon--serif {
  376. font-family: @font-family-serif;
  377. }
  378. .formatting-more {
  379. margin-left: auto;
  380. }
  381. .formatting-menu {
  382. min-width: auto;
  383. max-width: 130px;
  384. background-color: @formatting-menu-bg;
  385. }
  386. .formatting-menu-item {
  387. float: left;
  388. }
  389. .formatting-menu-item > .formatting-btn {
  390. border-right: none;
  391. }
  392. // Disable border on left-most icon in menu
  393. .formatting-menu-item:nth-of-type(4n + 1) > .formatting-btn {
  394. border-left: none;
  395. }
  396. .toolbar.toolbar-pdf > a[disabled] {
  397. cursor: not-allowed;
  398. .opacity(0.65);
  399. .box-shadow(none);
  400. }
  401. .menu-item-with-svg {
  402. a {
  403. align-items: center;
  404. display: flex !important;
  405. }
  406. svg {
  407. line,
  408. rect {
  409. stroke: @dropdown-link-color;
  410. }
  411. path {
  412. fill: @dropdown-link-color;
  413. }
  414. }
  415. a:hover,
  416. a:focus {
  417. svg {
  418. line,
  419. rect {
  420. stroke: @dropdown-link-hover-color;
  421. }
  422. path {
  423. fill: @dropdown-link-hover-color;
  424. }
  425. }
  426. }
  427. &.disabled {
  428. .subdued {
  429. color: @dropdown-link-disabled-color;
  430. }
  431. svg {
  432. line,
  433. rect {
  434. stroke: @dropdown-link-disabled-color;
  435. }
  436. path {
  437. fill: @dropdown-link-disabled-color;
  438. }
  439. }
  440. a:hover,
  441. a:focus {
  442. .subdued {
  443. color: @dropdown-link-disabled-color;
  444. }
  445. svg {
  446. line,
  447. rect {
  448. stroke: @dropdown-link-disabled-color;
  449. }
  450. path {
  451. fill: @dropdown-link-disabled-color;
  452. }
  453. }
  454. }
  455. }
  456. }