pdf.less 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. @stripe-width: 20px;
  2. @keyframes pdf-toolbar-stripes {
  3. from {
  4. background-position: 0 0;
  5. }
  6. to {
  7. background-position: @stripe-width 0;
  8. }
  9. }
  10. .pdf .toolbar.toolbar-pdf {
  11. .toolbar-small-mixin;
  12. .toolbar-alt-mixin;
  13. padding-right: 5px;
  14. &.changes-to-autocompile {
  15. // prettier-ignore
  16. #gradient > .striped(@color: rgba(255, 255, 255, 0.1), @angle: -45deg);
  17. background-size: @stripe-width @stripe-width;
  18. .animation(pdf-toolbar-stripes 2s linear infinite);
  19. }
  20. .auto-compile-status {
  21. color: white;
  22. margin-right: (@line-height-computed / 2);
  23. i {
  24. color: @brand-danger;
  25. }
  26. }
  27. .auto-compile-status when (@is-overleaf-light = true) {
  28. color: @ol-blue-gray-3;
  29. }
  30. }
  31. .pdf .toolbar.toolbar-pdf when (@is-overleaf-light = false) {
  32. border-bottom: 0;
  33. }
  34. .toolbar-pdf-left,
  35. .toolbar-pdf-right {
  36. display: flex;
  37. align-items: center;
  38. align-self: stretch;
  39. flex: 1 1 100%;
  40. }
  41. .toolbar-pdf-right {
  42. flex: 1 0 auto;
  43. }
  44. .btn-toggle-logs {
  45. &:focus,
  46. &:active:focus {
  47. outline: none;
  48. }
  49. }
  50. .btn-toggle-logs-label {
  51. padding-left: @line-height-computed / 4;
  52. }
  53. .pdf {
  54. background-color: @pdf-bg;
  55. }
  56. .pdf-viewer,
  57. .pdf-logs,
  58. .pdf-errors,
  59. .pdf-uncompiled {
  60. .full-size;
  61. top: @pdf-top-offset;
  62. }
  63. .pdf-logs,
  64. .pdf-errors,
  65. .pdf-uncompiled,
  66. .pdf-validation-problems {
  67. padding: @line-height-computed / 2;
  68. }
  69. .pdf-uncompiled {
  70. .fa {
  71. color: @blue;
  72. }
  73. }
  74. .btn-recompile-group {
  75. align-self: stretch;
  76. margin-right: 6px;
  77. border-radius: 0 @btn-border-radius-base @btn-border-radius-base 0;
  78. background-color: @btn-primary-bg;
  79. &.btn-recompile-group-has-changes {
  80. // prettier-ignore
  81. #gradient > .striped(@color: rgba(255, 255, 255, 0.2), @angle: -45deg);
  82. background-size: @stripe-width @stripe-width;
  83. .animation(pdf-toolbar-stripes 2s linear infinite);
  84. }
  85. }
  86. .btn-recompile {
  87. height: 100%;
  88. // .btn-primary;
  89. color: #fff;
  90. background-color: transparent;
  91. padding-top: 3px;
  92. padding-bottom: 3px;
  93. &:first-child {
  94. border-top-left-radius: 0;
  95. border-bottom-left-radius: 0;
  96. }
  97. &[disabled] {
  98. background-color: mix(@btn-primary-bg, @toolbar-alt-bg-color, 65%);
  99. .opacity(1);
  100. }
  101. }
  102. .btn-recompile-label {
  103. margin-left: @line-height-computed / 4;
  104. }
  105. .toolbar-text {
  106. padding-left: @padding-xs;
  107. }
  108. .pdf-viewer {
  109. iframe {
  110. width: 100%;
  111. height: 100%;
  112. border: none;
  113. }
  114. .pdfjs-viewer {
  115. .full-size;
  116. background-color: @pdfjs-bg;
  117. overflow: scroll;
  118. canvas,
  119. div.pdf-canvas {
  120. background: white;
  121. box-shadow: @pdf-page-shadow-color 0px 0px 10px;
  122. }
  123. div.pdf-canvas.pdfng-empty {
  124. background-color: white;
  125. }
  126. div.pdf-canvas.pdfng-loading {
  127. background-color: white;
  128. }
  129. .page-container {
  130. margin: 10px auto;
  131. padding: 0 10px;
  132. box-sizing: content-box;
  133. user-select: none;
  134. }
  135. .page {
  136. box-sizing: content-box;
  137. margin-left: auto;
  138. margin-right: auto;
  139. }
  140. .pdfjs-viewer-inner {
  141. position: absolute;
  142. overflow: auto;
  143. width: 100%;
  144. height: 100%;
  145. }
  146. &:focus-within {
  147. outline: none;
  148. }
  149. }
  150. .progress-thin {
  151. position: absolute;
  152. top: -2px;
  153. height: 3px;
  154. left: 0;
  155. right: 0;
  156. .progress-bar {
  157. height: 100%;
  158. background-color: @link-color;
  159. }
  160. }
  161. .pdfjs-controls {
  162. position: absolute;
  163. padding: @line-height-computed / 2;
  164. top: 0;
  165. left: 0;
  166. display: inline-block;
  167. .btn-group {
  168. transition: opacity 0.5s ease, visibility 0 linear 0.5s;
  169. visibility: hidden;
  170. opacity: 0;
  171. }
  172. &:hover,
  173. &.flash {
  174. .btn-group {
  175. transition: none;
  176. visibility: visible;
  177. opacity: 1;
  178. }
  179. }
  180. i.fa-arrows-h {
  181. border-right: 2px solid white;
  182. border-left: 2px solid white;
  183. }
  184. i.fa-arrows-v {
  185. border-top: 2px solid white;
  186. border-bottom: 2px solid white;
  187. }
  188. }
  189. .pdfjs-error {
  190. position: absolute;
  191. top: 10px;
  192. left: 10px;
  193. right: 10px;
  194. }
  195. }
  196. .pdf-logs {
  197. overflow: auto;
  198. .alert {
  199. font-size: 0.9rem;
  200. margin-bottom: @line-height-computed / 2;
  201. cursor: pointer;
  202. .line-no {
  203. float: right;
  204. color: @log-line-no-color;
  205. font-weight: 700;
  206. .fa {
  207. opacity: 0;
  208. }
  209. }
  210. .entry-message {
  211. font-weight: 700;
  212. //font-family: @font-family-monospace;
  213. }
  214. .entry-content {
  215. white-space: pre-wrap;
  216. font-size: 0.8rem;
  217. //font-family: @font-family-monospace;
  218. }
  219. &:hover .line-no {
  220. color: inherit;
  221. .fa {
  222. opacity: 1;
  223. }
  224. }
  225. &.alert-danger {
  226. background-color: tint(@alert-danger-bg, 15%);
  227. &:hover {
  228. background-color: @alert-danger-bg;
  229. }
  230. }
  231. &.alert-warning {
  232. background-color: tint(@alert-warning-bg, 15%);
  233. &:hover {
  234. background-color: @alert-warning-bg;
  235. }
  236. }
  237. &.alert-info {
  238. background-color: tint(@alert-info-bg, 15%);
  239. &:hover {
  240. background-color: @alert-info-bg;
  241. }
  242. }
  243. }
  244. pre {
  245. font-size: 12px;
  246. white-space: pre-wrap;
  247. }
  248. .dropdown {
  249. position: relative;
  250. }
  251. .force-recompile {
  252. margin-top: 10px;
  253. text-align: right;
  254. }
  255. }
  256. .synctex-controls {
  257. margin-right: -8px;
  258. position: absolute;
  259. z-index: @synctex-controls-z-index;
  260. padding: @synctex-controls-padding;
  261. top: 68px;
  262. }
  263. .synctex-control {
  264. @ol-synctex-control-size: 24px;
  265. align-items: center;
  266. display: flex;
  267. justify-content: center;
  268. font-size: 1em;
  269. margin-bottom: @ol-synctex-control-size / 2;
  270. width: @ol-synctex-control-size;
  271. height: @ol-synctex-control-size;
  272. border-radius: @ol-synctex-control-size / 2;
  273. padding: 0 0 2px;
  274. background-color: fade(@btn-default-bg, 80%);
  275. transition: background 0.15s ease;
  276. &[disabled] {
  277. opacity: 1;
  278. background-color: fade(@btn-default-bg, 60%);
  279. }
  280. > .synctex-control-icon {
  281. display: inline-block;
  282. font: normal normal normal 14px/1 FontAwesome;
  283. font-size: inherit;
  284. text-rendering: auto;
  285. -webkit-font-smoothing: antialiased;
  286. -moz-osx-font-smoothing: grayscale;
  287. }
  288. > .synctex-spin-icon {
  289. margin-top: 2px;
  290. }
  291. }
  292. .synctex-control-goto-pdf > .synctex-control-icon {
  293. text-indent: 1px; // "Optical" adjustment.
  294. &::before {
  295. content: '\f061';
  296. }
  297. }
  298. .synctex-control-goto-code > .synctex-control-icon {
  299. text-indent: -1px; // "Optical" adjustment.
  300. &::before {
  301. content: '\f060';
  302. }
  303. }
  304. .editor-dark {
  305. .pdf-logs {
  306. background-color: lighten(@editor-dark-background-color, 10%);
  307. }
  308. .pdfjs-viewer {
  309. background-color: lighten(@editor-dark-background-color, 10%);
  310. }
  311. .pdf .toolbar {
  312. .toolbar-right a {
  313. i {
  314. border-color: @gray;
  315. }
  316. &:hover {
  317. i {
  318. border-color: @gray-light;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. .keyboard-tooltip {
  325. .tooltip-inner {
  326. max-width: none;
  327. }
  328. }
  329. .keyboard-shortcut {
  330. white-space: nowrap;
  331. }
  332. @keyframes expand-feedback-area {
  333. from {
  334. max-height: 0;
  335. }
  336. to {
  337. max-height: 500px;
  338. }
  339. }
  340. .card-hint:extend(.card-thin) {
  341. margin-top: 10px;
  342. padding-bottom: 7px;
  343. cursor: default;
  344. &-icon-container {
  345. background: currentColor;
  346. width: 2.5rem;
  347. height: 2.5rem;
  348. font-size: 1.5rem;
  349. text-align: center;
  350. border-radius: 50%;
  351. float: left;
  352. margin-right: 10px;
  353. .fa {
  354. color: #fff;
  355. }
  356. .alert-danger & {
  357. color: @state-danger-border;
  358. }
  359. .alert-warning & {
  360. color: @state-warning-border;
  361. }
  362. .alert-info & {
  363. color: @state-info-border;
  364. }
  365. }
  366. &-text,
  367. &-feedback-label {
  368. color: @log-hints-color;
  369. font-size: 0.9rem;
  370. margin-bottom: 20px;
  371. }
  372. &-text {
  373. min-height: 35px;
  374. }
  375. &-feedback-label {
  376. font-size: inherit;
  377. margin-right: 0.5em;
  378. margin-bottom: 0;
  379. font-weight: normal;
  380. }
  381. &-ext-link,
  382. &-feedback {
  383. display: inline-block;
  384. font-size: 0.8rem;
  385. }
  386. &-footer a,
  387. &-text a {
  388. .alert-danger & {
  389. color: @state-danger-text;
  390. }
  391. .alert-warning & {
  392. color: @state-warning-text;
  393. }
  394. .alert-info & {
  395. color: @state-info-text;
  396. }
  397. }
  398. &-feedback {
  399. color: @log-hints-color;
  400. float: right;
  401. }
  402. &-extra-feedback {
  403. color: @log-hints-color;
  404. font-size: 0.8rem;
  405. margin-top: 10px;
  406. padding-bottom: 5px;
  407. animation: 0.5s ease-out expand-feedback-area;
  408. overflow: hidden;
  409. &-label {
  410. margin: 5px 0 10px;
  411. padding-top: 5px;
  412. border-top: solid 1px @gray-lighter;
  413. }
  414. .radio {
  415. margin: 5px;
  416. }
  417. textarea {
  418. font-size: 0.8rem;
  419. margin-bottom: 10px;
  420. padding: 5px;
  421. }
  422. input[type='radio'] {
  423. margin-top: 2px;
  424. }
  425. }
  426. & + p {
  427. margin-top: 20px;
  428. }
  429. }
  430. .files-dropdown-container {
  431. .pull-right();
  432. position: relative;
  433. }
  434. .files-dropdown {
  435. display: inline-block;
  436. }
  437. .plv-text-layer {
  438. display: none;
  439. user-select: text;
  440. .pdf-page-container:hover &,
  441. .pdfjs-viewer-show-text & {
  442. display: block;
  443. }
  444. }
  445. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  446. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  447. @line-height-small);
  448. #download-dropdown-list,
  449. #dropdown-files-logs-pane-list {
  450. overflow-y: auto;
  451. .dropdown-header {
  452. white-space: nowrap;
  453. }
  454. }
  455. #download-dropdown-list {
  456. max-height: calc(
  457. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @margin-md
  458. );
  459. }
  460. #dropdown-files-logs-pane-list {
  461. max-height: calc(
  462. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  463. @margin-md
  464. );
  465. }
  466. .toolbar-pdf-expand-btn {
  467. .btn-inline-link;
  468. margin-left: @margin-xs;
  469. color: @toolbar-icon-btn-color;
  470. border-radius: @border-radius-small;
  471. &:hover {
  472. color: @toolbar-icon-btn-hover-color;
  473. }
  474. &:active {
  475. background-color: @link-color;
  476. color: #fff;
  477. }
  478. &:focus {
  479. outline: 0;
  480. color: #fff;
  481. }
  482. }
  483. .pdf-error-alert {
  484. position: absolute;
  485. width: 100%;
  486. height: 100%;
  487. background-color: @pdf-bg;
  488. padding: @line-height-computed / 2;
  489. }
  490. .pdf-loading-spinner-container {
  491. width: 100%;
  492. height: 100%;
  493. display: flex;
  494. align-items: center;
  495. justify-content: center;
  496. }