history-react.less 11 KB

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