history-react.less 11 KB

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