history-react.less 10 KB

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