history-react.less 11 KB

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