pdf.less 9.3 KB

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