pdf.less 8.9 KB

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