history-react.less 11 KB

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