history-react.less 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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. .history-content {
  251. padding: @line-height-computed / 2;
  252. }
  253. }
  254. .history-version-label-tooltip {
  255. padding: 6px;
  256. text-align: initial;
  257. &-row {
  258. margin-bottom: 6.25px;
  259. &:last-child {
  260. margin-bottom: initial;
  261. }
  262. }
  263. }
  264. .history-version-dropdown-menu {
  265. [role='menuitem'] {
  266. padding: 10px 12px;
  267. color: @neutral-90;
  268. &:hover,
  269. &:focus {
  270. color: @neutral-90;
  271. background-color: @neutral-10;
  272. }
  273. }
  274. }
  275. .document-diff-container {
  276. height: 100%;
  277. display: flex;
  278. flex-direction: column;
  279. position: relative;
  280. .cm-viewer-container,
  281. .cm-editor {
  282. height: 100%;
  283. }
  284. .previous-highlight-button,
  285. .next-highlight-button {
  286. position: absolute;
  287. right: 16px;
  288. }
  289. .previous-highlight-button {
  290. top: 16px;
  291. }
  292. .next-highlight-button {
  293. bottom: 16px;
  294. }
  295. }
  296. .history-file-tree {
  297. display: flex !important; // To work around jQuery layout's inline styles
  298. flex-direction: column;
  299. flex-grow: 1;
  300. max-height: 100%;
  301. ul.history-file-tree-list {
  302. margin: 0;
  303. overflow-x: hidden;
  304. height: 100%;
  305. flex-grow: 1;
  306. position: relative;
  307. overflow-y: auto;
  308. .history-file-tree-item > ul,
  309. ul[role='tree'] {
  310. margin-left: 22px;
  311. }
  312. li.bottom-buffer {
  313. min-height: @line-height-computed;
  314. }
  315. li {
  316. line-height: @file-tree-line-height;
  317. position: relative;
  318. margin-left: 8px;
  319. &:focus {
  320. outline: none;
  321. }
  322. .history-file-tree-item {
  323. color: @file-tree-item-color;
  324. cursor: pointer;
  325. white-space: nowrap;
  326. user-select: none;
  327. display: flex;
  328. align-items: center;
  329. &:focus {
  330. outline: none;
  331. }
  332. &:hover {
  333. background-color: @file-tree-item-hover-bg;
  334. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  335. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  336. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  337. // the empty space.
  338. .fake-full-width-bg(@file-tree-item-hover-bg);
  339. }
  340. .history-file-tree-folder-button,
  341. .history-file-tree-item-button {
  342. .reset-button;
  343. &:focus {
  344. outline: none;
  345. }
  346. }
  347. .history-file-tree-item-name-wrapper {
  348. display: flex;
  349. align-items: center;
  350. width: 100%;
  351. overflow: hidden;
  352. .history-file-tree-item-name {
  353. margin-right: @margin-xs;
  354. overflow: hidden;
  355. text-overflow: ellipsis;
  356. text-align: left;
  357. font-weight: normal;
  358. flex-grow: 1;
  359. &.strikethrough {
  360. text-decoration: line-through;
  361. }
  362. }
  363. .history-file-tree-item-badge {
  364. text-transform: capitalize;
  365. font-weight: normal;
  366. margin-right: @margin-sm;
  367. flex-shrink: 0;
  368. &:hover {
  369. background-color: @neutral-20;
  370. }
  371. }
  372. }
  373. }
  374. i.fa {
  375. color: @file-tree-item-icon-color;
  376. font-size: 14px;
  377. display: inline-flex;
  378. flex-shrink: 0;
  379. &.file-tree-icon {
  380. margin-right: 4px;
  381. margin-left: 8px;
  382. }
  383. &.file-tree-folder-icon {
  384. margin-right: 4px;
  385. }
  386. &.file-tree-expand-icon {
  387. margin-left: 8px;
  388. }
  389. }
  390. i.fa-folder-open,
  391. i.fa-folder {
  392. color: @file-tree-item-folder-color;
  393. font-size: 14px;
  394. }
  395. }
  396. li.selected > .history-file-tree-item {
  397. color: @file-tree-item-selected-color;
  398. background-color: @file-tree-item-selected-bg;
  399. font-weight: bold;
  400. > div > i.fa,
  401. > button > i.fa,
  402. > i.fa {
  403. color: @file-tree-item-selected-color;
  404. }
  405. .fake-full-width-bg(@file-tree-item-selected-bg);
  406. }
  407. }
  408. }
  409. .history-error {
  410. padding: 16px;
  411. }