history-react.less 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. @versions-list-width: 320px;
  2. @history-toolbar-height: 40px;
  3. @history-change-list-padding: 16px;
  4. history-root {
  5. height: 100%;
  6. display: block;
  7. }
  8. .history-react {
  9. display: flex;
  10. height: 100%;
  11. background-color: @history-main-bg;
  12. .history-header {
  13. height: @history-toolbar-height;
  14. background-color: @history-react-header-bg;
  15. color: @history-react-header-color;
  16. font-size: @font-size-small;
  17. display: flex;
  18. flex-direction: column;
  19. justify-content: center;
  20. box-sizing: border-box;
  21. }
  22. .doc-panel {
  23. flex: 1;
  24. display: flex;
  25. flex-direction: column;
  26. .toolbar-container {
  27. border-bottom: 1px solid @history-react-separator-color;
  28. padding: 0 8px;
  29. }
  30. .doc-container {
  31. flex: 1;
  32. overflow-y: auto;
  33. }
  34. }
  35. .change-list {
  36. display: flex;
  37. flex-direction: column;
  38. width: @versions-list-width;
  39. font-size: @font-size-small;
  40. border-left: 1px solid @history-react-separator-color;
  41. box-sizing: content-box;
  42. }
  43. .toggle-switch-label {
  44. flex: 1;
  45. span {
  46. display: block;
  47. }
  48. }
  49. .history-version-list-container {
  50. flex: 1;
  51. overflow-y: auto;
  52. }
  53. .history-all-versions-scroller {
  54. overflow-y: auto;
  55. height: 100%;
  56. }
  57. .history-all-versions-container {
  58. position: relative;
  59. }
  60. .history-versions-bottom {
  61. position: absolute;
  62. height: 8em;
  63. bottom: 0;
  64. }
  65. .history-toggle-switch-container,
  66. .history-version-day,
  67. .history-version-details {
  68. padding: 0 @history-change-list-padding;
  69. }
  70. .history-version-day {
  71. position: sticky;
  72. z-index: 1;
  73. top: 0;
  74. display: block;
  75. padding-top: 12px;
  76. padding-bottom: 4px;
  77. line-height: 20px;
  78. background-color: @white;
  79. }
  80. .history-version-details {
  81. display: flex;
  82. align-items: flex-start;
  83. padding-top: 8px;
  84. padding-bottom: 8px;
  85. &.history-version-selectable:hover {
  86. cursor: pointer;
  87. background-color: @neutral-10;
  88. }
  89. }
  90. .history-version-selected {
  91. background-color: @green-10;
  92. }
  93. .history-version-metadata-time {
  94. display: block;
  95. margin-bottom: 4px;
  96. color: @neutral-90;
  97. &:last-child {
  98. margin-bottom: initial;
  99. }
  100. }
  101. .history-version-metadata-users,
  102. .history-version-changes {
  103. margin: 0;
  104. padding: 0;
  105. list-style: none;
  106. }
  107. .history-version-metadata-users {
  108. display: inline;
  109. > li {
  110. display: inline-flex;
  111. align-items: center;
  112. margin-right: 8px;
  113. }
  114. }
  115. .history-version-changes {
  116. > li {
  117. margin-bottom: 4px;
  118. }
  119. }
  120. .history-version-user-badge-color {
  121. @size: 8px;
  122. display: inline-block;
  123. width: @size;
  124. height: @size;
  125. margin-right: 4px;
  126. border-radius: 2px;
  127. }
  128. .history-version-day,
  129. .history-version-change-action,
  130. .history-version-metadata-users,
  131. .history-version-origin,
  132. .history-version-saved-by {
  133. color: @neutral-70;
  134. }
  135. .history-version-change-doc {
  136. color: @neutral-90;
  137. }
  138. .history-version-divider {
  139. margin: 6px 8px;
  140. border-color: @neutral-20;
  141. }
  142. .history-version-badge {
  143. margin-bottom: 4px;
  144. margin-right: 10px;
  145. }
  146. .history-version-label {
  147. margin-bottom: 4px;
  148. &:last-child {
  149. margin-bottom: initial;
  150. }
  151. }
  152. .loading {
  153. padding-top: 10rem;
  154. font-family: @font-family-serif;
  155. text-align: center;
  156. }
  157. & > .loading {
  158. flex: 1;
  159. }
  160. .history-all-versions-scroller .loading {
  161. position: sticky;
  162. bottom: 0;
  163. padding: @line-height-computed / 2 0;
  164. background-color: @gray-lightest;
  165. }
  166. .history-version-saved-by {
  167. &-label {
  168. margin-right: 8px;
  169. }
  170. }
  171. .dropdown.open {
  172. .history-version-dropdown-menu-btn {
  173. background-color: rgba(@neutral-90, 0.08);
  174. box-shadow: initial;
  175. }
  176. }
  177. .history-version-dropdown-menu-btn {
  178. @size: 30px;
  179. padding: 0;
  180. width: @size;
  181. height: @size;
  182. font-size: @font-size-small;
  183. color: @neutral-90;
  184. background-color: transparent;
  185. &:hover,
  186. &:active {
  187. z-index: initial;
  188. background-color: rgba(@neutral-90, 0.08);
  189. box-shadow: initial;
  190. }
  191. }
  192. .history-version-main-details {
  193. flex: 1;
  194. }
  195. .history-loading-panel {
  196. padding-top: 10rem;
  197. font-family: @font-family-serif;
  198. text-align: center;
  199. }
  200. .history-file-entity-operation-badge {
  201. flex: 0 0 auto;
  202. text-transform: lowercase;
  203. margin-left: 0.5em;
  204. font-size: 0.7em;
  205. background: @history-file-badge-bg;
  206. color: @history-file-badge-color;
  207. border-radius: 8px;
  208. line-height: 1;
  209. padding: 2px 4px 3px;
  210. margin-top: 2px;
  211. }
  212. .history-react-toolbar {
  213. display: flex;
  214. align-items: center;
  215. .history-react-toolbar-file-info {
  216. flex: 1;
  217. text-align: right;
  218. }
  219. .history-react-toolbar-time {
  220. font-weight: 700;
  221. }
  222. .history-react-toolbar-restore-file-button {
  223. margin-left: 5px;
  224. }
  225. }
  226. .history-paywall-prompt {
  227. padding: @history-change-list-padding;
  228. .history-feature-list {
  229. list-style: none;
  230. padding-left: 8px;
  231. li {
  232. margin-bottom: 16px;
  233. }
  234. }
  235. button {
  236. width: 100%;
  237. }
  238. }
  239. .history-version-faded .history-version-details {
  240. max-height: 6em;
  241. .mask-image(linear-gradient(black 35%, transparent));
  242. overflow: hidden;
  243. }
  244. .history-paywall-heading {
  245. .premium-text;
  246. font-family: inherit;
  247. font-size: 20px;
  248. font-weight: 700;
  249. }
  250. }
  251. .history-version-label-tooltip {
  252. padding: 6px;
  253. text-align: initial;
  254. &-row {
  255. margin-bottom: 6.25px;
  256. &:last-child {
  257. margin-bottom: initial;
  258. }
  259. }
  260. }
  261. .history-version-dropdown-menu {
  262. [role='menuitem'] {
  263. padding: 10px 12px;
  264. color: @neutral-90;
  265. &:hover,
  266. &:focus {
  267. color: @neutral-90;
  268. background-color: @neutral-10;
  269. }
  270. }
  271. }
  272. .document-diff-container {
  273. height: 100%;
  274. display: flex;
  275. flex-direction: column;
  276. position: relative;
  277. .cm-viewer-container,
  278. .cm-editor {
  279. height: 100%;
  280. }
  281. .previous-highlight-button,
  282. .next-highlight-button {
  283. position: absolute;
  284. right: 16px;
  285. }
  286. .previous-highlight-button {
  287. top: 16px;
  288. }
  289. .next-highlight-button {
  290. bottom: 16px;
  291. }
  292. }
  293. .history-file-tree {
  294. display: flex !important; // To work around jQuery layout's inline styles
  295. flex-direction: column;
  296. flex-grow: 1;
  297. max-height: 100%;
  298. ul.history-file-tree-list {
  299. margin: 0;
  300. overflow-x: hidden;
  301. height: 100%;
  302. flex-grow: 1;
  303. position: relative;
  304. overflow-y: auto;
  305. .history-file-tree-item > ul,
  306. ul[role='tree'] {
  307. margin-left: 22px;
  308. }
  309. li.bottom-buffer {
  310. min-height: @line-height-computed;
  311. }
  312. li {
  313. line-height: @file-tree-line-height;
  314. position: relative;
  315. &:focus {
  316. outline: none;
  317. }
  318. .history-file-tree-item {
  319. color: @file-tree-item-color;
  320. cursor: pointer;
  321. white-space: nowrap;
  322. overflow: hidden;
  323. text-overflow: clip;
  324. user-select: none;
  325. &:focus {
  326. outline: none;
  327. }
  328. &:hover {
  329. background-color: @file-tree-item-hover-bg;
  330. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  331. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  332. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  333. // the empty space.
  334. .fake-full-width-bg(@file-tree-item-hover-bg);
  335. }
  336. .history-file-tree-folder-button,
  337. .history-file-tree-item-button {
  338. .reset-button;
  339. &:focus {
  340. outline: none;
  341. }
  342. }
  343. .history-file-tree-item-button {
  344. width: 100%;
  345. overflow: hidden;
  346. text-overflow: ellipsis;
  347. text-align: left;
  348. padding-right: 40px;
  349. font-weight: normal;
  350. display: inline-flex;
  351. flex-direction: row;
  352. align-items: center;
  353. justify-content: space-between;
  354. .history-file-tree-item-button-text {
  355. display: inline-flex;
  356. margin-right: 5px;
  357. &.strikethrough {
  358. text-decoration: line-through;
  359. }
  360. }
  361. .history-file-tree-item-button-badge {
  362. text-transform: capitalize;
  363. &:hover {
  364. background-color: @neutral-20;
  365. }
  366. }
  367. }
  368. }
  369. i.fa {
  370. color: @file-tree-item-icon-color;
  371. font-size: 14px;
  372. &.file-tree-icon {
  373. margin-right: 4px;
  374. margin-left: 8px;
  375. }
  376. &.file-tree-folder-icon {
  377. margin-right: 4px;
  378. }
  379. &.file-tree-expand-icon {
  380. margin-left: 8px;
  381. }
  382. }
  383. i.fa-folder-open,
  384. i.fa-folder {
  385. color: @file-tree-item-folder-color;
  386. font-size: 14px;
  387. }
  388. }
  389. li.selected > .history-file-tree-item {
  390. color: @file-tree-item-selected-color;
  391. background-color: @file-tree-item-selected-bg;
  392. font-weight: bold;
  393. > div > i.fa,
  394. > button > i.fa,
  395. > i.fa {
  396. color: @file-tree-item-selected-color;
  397. }
  398. .fake-full-width-bg(@file-tree-item-selected-bg);
  399. }
  400. }
  401. }
  402. .history-error {
  403. padding: 16px;
  404. }