history-react.less 9.5 KB

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