pdf.less 9.3 KB

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