history-react.less 11 KB

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