history-react.less 9.4 KB

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