pdf.less 9.4 KB

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