pdf.less 9.3 KB

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