history-react.less 9.7 KB

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