toolbar.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. @import '../../abstracts/variables';
  2. :root {
  3. --toolbar-border-color: var(--neutral-80);
  4. --toolbar-header-bg-color: var(--neutral-90);
  5. --toolbar-header-btn-border-color: var(--neutral-80);
  6. --toolbar-btn-color: var(--white);
  7. --toolbar-btn-hover-bg-color: var(--neutral-80);
  8. --toolbar-btn-hover-color: var(--white);
  9. --toolbar-btn-active-color: var(--white);
  10. --toolbar-btn-active-bg-color: var(--green-50);
  11. --toolbar-height: #{$toolbar-height};
  12. --toolbar-small-height: #{$toolbar-small-height};
  13. --toolbar-alt-bg-color: var(--neutral-80);
  14. --formatting-btn-color: var(--white);
  15. --formatting-btn-bg: var(--neutral-80);
  16. --formatting-btn-border: var(--neutral-70);
  17. --project-name-color: var(--neutral-40);
  18. --toolbar-filetree-bg-color: var(--neutral-80);
  19. --project-rename-link-color: var(--neutral-40);
  20. --project-rename-link-color-hover: var(--neutral-20);
  21. --editor-header-logo-background: url(../../../../../public/img/ol-brand/overleaf-o-white.svg)
  22. center / contain no-repeat;
  23. --editor-toolbar-bg: var(--neutral-80);
  24. --toolbar-dropdown-divider-color: var(--border-dark-divider);
  25. }
  26. .ide-redesign-main {
  27. --toolbar-alt-bg-color: var(--bg-dark-secondary);
  28. --toolbar-btn-color: var(--content-primary-dark);
  29. --toolbar-btn-hover-bg-color: var(--neutral-80);
  30. --toolbar-btn-hover-color: var(--white);
  31. --editor-toolbar-bg: var(--bg-dark-primary);
  32. --toolbar-filetree-bg-color: var(--neutral-80);
  33. .ol-cm-toolbar-portal {
  34. display: flex;
  35. align-items: center;
  36. background-color: var(--editor-toolbar-bg);
  37. .review-panel-header {
  38. align-self: flex-start;
  39. }
  40. }
  41. .ol-cm-toolbar-wrapper {
  42. flex: 1;
  43. width: 100%;
  44. }
  45. .ol-cm-toolbar-wrapper-indented {
  46. width: calc(100% - var(--review-panel-width));
  47. }
  48. }
  49. @include theme('light') {
  50. --toolbar-border-color: var(--neutral-20);
  51. --toolbar-header-bg-color: var(--white);
  52. --toolbar-header-btn-border-color: var(--neutral-20);
  53. --toolbar-btn-color: var(--neutral-70);
  54. --toolbar-btn-hover-bg-color: var(--neutral-10);
  55. --toolbar-btn-hover-color: var(--neutral-70);
  56. --toolbar-btn-active-bg-color: var(--green-50);
  57. --toolbar-alt-bg-color: var(--white);
  58. --formatting-btn-color: var(--neutral-70);
  59. --formatting-btn-bg: transparent;
  60. --formatting-btn-border: var(--neutral-20);
  61. --project-name-color: var(--neutral-70);
  62. --toolbar-filetree-bg-color: var(--white);
  63. --project-rename-link-color: var(--neutral-70);
  64. --project-rename-link-color-hover: var(--neutral-70);
  65. --editor-header-logo-background: url(../../../../../public/img/ol-brand/overleaf-o.svg)
  66. center / contain no-repeat;
  67. --editor-toolbar-bg: var(--white);
  68. --toolbar-dropdown-divider-color: var(--border-divider);
  69. .ide-redesign-main {
  70. --toolbar-alt-bg-color: var(--bg-light-secondary);
  71. --toolbar-btn-color: var(--content-primary);
  72. --toolbar-btn-hover-bg-color: var(--neutral-80);
  73. --toolbar-btn-hover-color: var(--white);
  74. --editor-toolbar-bg: var(--white);
  75. --toolbar-filetree-bg-color: var(--white);
  76. }
  77. }
  78. .toolbar {
  79. display: flex;
  80. align-items: center;
  81. height: var(--toolbar-height);
  82. border-bottom: 1px solid var(--toolbar-border-color);
  83. button {
  84. position: relative;
  85. .badge {
  86. position: absolute;
  87. top: 0;
  88. right: 0;
  89. pointer-events: none; // Labels were capturing button/anchor clicks.
  90. .badge-content {
  91. padding: 0;
  92. }
  93. }
  94. }
  95. .toolbar-right,
  96. .toolbar-left {
  97. button:not(.back-to-editor-btn, .toolbar-experiment-button) {
  98. background: transparent;
  99. box-shadow: none;
  100. }
  101. }
  102. .toolbar-right .back-to-editor-btn {
  103. margin-right: var(--spacing-09);
  104. display: flex;
  105. align-items: center;
  106. .toolbar-label {
  107. margin-bottom: 0;
  108. }
  109. }
  110. > a:focus,
  111. button:focus {
  112. outline: none;
  113. }
  114. > a:not(.btn),
  115. > button,
  116. .toolbar-left > a:not(.btn),
  117. .toolbar-left > button,
  118. .toolbar-right > a:not(.btn),
  119. .toolbar-right > button:not(.back-to-editor-btn, .toolbar-experiment-button) {
  120. display: inline-block;
  121. color: var(--toolbar-btn-color);
  122. background-color: transparent;
  123. padding: var(--spacing-01);
  124. line-height: 1;
  125. height: 24px;
  126. border-radius: var(--border-radius-base);
  127. &.toolbar-header-back-projects {
  128. padding: var(--spacing-02) var(--spacing-04) var(--spacing-02);
  129. margin-bottom: var(--spacing-01);
  130. }
  131. &:hover {
  132. text-shadow: none;
  133. color: var(--toolbar-btn-hover-color);
  134. background-color: transparent;
  135. text-decoration: none;
  136. }
  137. &.active,
  138. &:active {
  139. .label {
  140. display: none;
  141. }
  142. color: white;
  143. background-color: var(--bg-info-01);
  144. box-shadow: none;
  145. &:hover {
  146. color: white;
  147. }
  148. }
  149. }
  150. a.btn-full-height,
  151. button.btn-full-height {
  152. border: none;
  153. border-radius: 0;
  154. border-right: 1px solid var(--toolbar-header-btn-border-color);
  155. color: var(--toolbar-btn-color);
  156. padding: var(--spacing-02) var(--spacing-05) var(--spacing-03);
  157. font-size: var(--font-size-05);
  158. max-height: 39px;
  159. &:hover {
  160. text-shadow: none;
  161. background-color: var(--toolbar-btn-hover-bg-color);
  162. color: var(--toolbar-btn-color);
  163. }
  164. &.active,
  165. &:active {
  166. color: var(--white);
  167. background-color: $bg-accent-01;
  168. box-shadow: none;
  169. }
  170. .badge {
  171. top: var(--spacing-01);
  172. right: var(--spacing-02);
  173. }
  174. &.header-cobranding-logo-container {
  175. height: calc(var(--toolbar-height) - 1px);
  176. padding: var(--spacing-04) var(--spacing-05);
  177. }
  178. .spinner-border {
  179. vertical-align: middle;
  180. font-size: var(--font-size-02);
  181. }
  182. &.dropdown-toggle {
  183. line-height: 1;
  184. &::after {
  185. vertical-align: middle;
  186. font-size: var(--font-size-02);
  187. }
  188. }
  189. }
  190. .toolbar-left {
  191. display: flex;
  192. align-items: stretch;
  193. float: left;
  194. text-align: center;
  195. }
  196. .toolbar-right {
  197. display: flex;
  198. align-items: stretch;
  199. flex-grow: 1;
  200. justify-content: flex-end;
  201. a.btn-full-height,
  202. button.btn-full-height {
  203. border-right: 0;
  204. border-left: 1px solid var(--toolbar-header-btn-border-color);
  205. }
  206. }
  207. .toolbar-center {
  208. text-align: center;
  209. text-overflow: ellipsis;
  210. overflow: hidden;
  211. // At small screen sizes, center relative to the left menu and right buttons
  212. width: 100%;
  213. display: flex;
  214. justify-content: center;
  215. }
  216. &.toolbar-header {
  217. align-items: stretch;
  218. background-color: var(--toolbar-header-bg-color);
  219. position: absolute;
  220. top: 0;
  221. left: 0;
  222. right: 0;
  223. z-index: 1;
  224. }
  225. .toolbar-item {
  226. display: flex;
  227. justify-content: center;
  228. }
  229. .toolbar-cio-tooltip {
  230. position: absolute;
  231. top: var(--toolbar-height);
  232. width: 391px;
  233. }
  234. #toolbar-cio-history {
  235. @include media-breakpoint-down(lg) {
  236. right: 10px;
  237. /* The iframe a message renders in isn't aware of the page width, so we
  238. make it 1px narrower to enable max-width media queries */
  239. width: 390px;
  240. }
  241. }
  242. }
  243. .layout-dropdown .dropdown-item {
  244. align-items: center;
  245. }
  246. .header-cobranding-logo {
  247. display: block;
  248. width: auto;
  249. max-height: 100%;
  250. }
  251. .toolbar-label {
  252. display: none;
  253. margin: 0 var(--spacing-02);
  254. font-size: var(--font-size-02);
  255. font-weight: 600;
  256. vertical-align: middle;
  257. text-align: left;
  258. @include media-breakpoint-up(lg) {
  259. display: inline-block;
  260. }
  261. &.toolbar-label-multiline {
  262. line-height: 1.1;
  263. }
  264. }
  265. .toolbar-header-upgrade-prompt {
  266. margin-left: var(--spacing-05);
  267. @include media-breakpoint-down(lg) {
  268. display: none !important;
  269. }
  270. }
  271. .toolbar-filetree {
  272. @include toolbar-sm-height;
  273. background-color: var(--toolbar-filetree-bg-color);
  274. padding: 0 var(--spacing-03);
  275. flex-shrink: 0;
  276. }
  277. .editor-menu-icon {
  278. &.material-symbols {
  279. width: 1em;
  280. text-indent: -9999px;
  281. background: var(--editor-header-logo-background);
  282. }
  283. }
  284. .project-name {
  285. .name {
  286. display: inline-block;
  287. @include text-truncate;
  288. padding: var(--spacing-03);
  289. vertical-align: top;
  290. color: var(--project-name-color);
  291. font-weight: 700;
  292. }
  293. input {
  294. height: 30px;
  295. margin-top: var(--spacing-02);
  296. padding: var(--spacing-03);
  297. max-width: 500px;
  298. text-align: center;
  299. font-weight: 700;
  300. }
  301. a.rename {
  302. visibility: hidden;
  303. display: inline-block;
  304. color: var(--project-rename-link-color);
  305. padding: var(--spacing-03);
  306. border-radius: var(--border-radius-base);
  307. cursor: pointer;
  308. &:hover {
  309. text-shadow: 0 1px 0 rgb(0 0 0 / 25%);
  310. color: var(--project-rename-link-color-hover);
  311. text-decoration: none;
  312. }
  313. }
  314. &:hover {
  315. a.rename {
  316. visibility: visible;
  317. }
  318. }
  319. }
  320. .toolbar-editor {
  321. height: var(--toolbar-small-height);
  322. background-color: var(--editor-toolbar-bg);
  323. padding: 0 5px;
  324. overflow: hidden;
  325. position: relative;
  326. z-index: 10; // Prevent track changes showing over toolbar
  327. }
  328. /**************************************
  329. Toggle Switch
  330. ***************************************/
  331. .toggle-switch {
  332. --toggle-switch-height: 26px;
  333. --toggle-switch-padding: var(--spacing-01);
  334. display: inline-flex;
  335. align-items: center;
  336. height: var(--toggle-switch-height);
  337. margin-right: var(--spacing-03);
  338. border-radius: var(--border-radius-full);
  339. background-color: var(--neutral-20);
  340. padding: var(--toggle-switch-padding);
  341. }
  342. .toggle-switch-label {
  343. display: inline-block;
  344. float: left;
  345. font-weight: normal;
  346. // It seems we need to set the height explicitly rather than using 100% to get the button to display correctly in Blink
  347. height: calc(var(--toggle-switch-height) - 2 * var(--toggle-switch-padding));
  348. text-align: center;
  349. margin: 0;
  350. cursor: pointer;
  351. user-select: none;
  352. color: var(--content-secondary);
  353. border-radius: var(--border-radius-full);
  354. transition:
  355. color 0.12s ease-out,
  356. background-color 0.12s ease-out,
  357. box-shadow 0.12s ease-out;
  358. overflow: hidden;
  359. span {
  360. display: flex;
  361. align-items: center;
  362. height: 100%;
  363. width: 100%;
  364. padding: 0 var(--spacing-08);
  365. background-size: 200% 100%;
  366. background-position: 0 0;
  367. transition: background-position 0.12s ease-out;
  368. font-size: var(--font-size-02);
  369. font-weight: bold;
  370. }
  371. }
  372. .toggle-switch-input {
  373. @include visually-hidden;
  374. }
  375. .toggle-switch-input:disabled + .toggle-switch-label {
  376. cursor: not-allowed;
  377. }
  378. .toggle-switch-input:checked + .toggle-switch-label {
  379. span {
  380. background-position: -100% 0;
  381. }
  382. color: var(--white);
  383. background-color: var(--bg-accent-01);
  384. border-radius: var(--border-radius-full);
  385. box-shadow: 0 2px 4px rgb(30 37 48 / 16%);
  386. }
  387. .toggle-switch-input:checked:nth-child(2) + .toggle-switch-label {
  388. span {
  389. background-position: 100% 0;
  390. }
  391. }
  392. .editor-toggle-switch {
  393. display: flex;
  394. align-items: center;
  395. white-space: nowrap;
  396. .toggle-switch {
  397. margin-left: var(--spacing-03);
  398. }
  399. .toggle-switch-label span {
  400. background: none;
  401. transition: background 0.12s ease-out;
  402. }
  403. .toggle-switch-label:first-of-type span {
  404. padding-left: var(--spacing-04);
  405. }
  406. .toggle-switch-label:last-of-type span {
  407. padding-right: var(--spacing-04);
  408. border-right: none;
  409. }
  410. }
  411. /**************************************
  412. Formatting buttons
  413. ***************************************/
  414. .formatting-btn {
  415. color: var(--formatting-btn-color);
  416. background-color: var(--formatting-btn-bg);
  417. padding: 0;
  418. height: 100%;
  419. display: flex;
  420. align-items: center;
  421. justify-content: center;
  422. box-shadow: none;
  423. border: none;
  424. border-left: 1px solid var(--formatting-btn-border);
  425. border-radius: 0;
  426. &:hover {
  427. color: var(--formatting-btn-color);
  428. }
  429. &.active {
  430. color: var(--white);
  431. background-color: var(--toolbar-btn-active-bg-color);
  432. box-shadow: none;
  433. &:focus {
  434. color: var(--toolbar-btn-active-color);
  435. &:not(:focus-visible) {
  436. outline: none;
  437. }
  438. }
  439. }
  440. &:focus {
  441. color: var(--formatting-btn-color);
  442. }
  443. }
  444. .formatting-btn-icon {
  445. min-width: 32px;
  446. width: 32px;
  447. }
  448. .formatting-btn-icon:last-of-type {
  449. border-right: 1px solid var(--formatting-btn-border);
  450. }
  451. // Override a secondary button to ensure that the border is visible because
  452. // overriding a borderless button will not add a border.
  453. .toolbar-experiment-button.btn-secondary {
  454. @include labs-button;
  455. max-height: 39px;
  456. font-size: var(--font-size-01);
  457. line-height: var(--line-height-01);
  458. margin-right: var(--spacing-04);
  459. }