footer.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. @use 'sass:map';
  2. // Max width of the sidebar
  3. $footer-width-delta: 320px;
  4. @mixin cookie-banner-light {
  5. --cookie-banner-background: var(--bg-light-primary);
  6. --cookie-banner-content: var(--content-primary);
  7. --cookie-banner-link: var(--link-ui);
  8. }
  9. @mixin cookie-banner-dark {
  10. --cookie-banner-background: var(--bg-dark-secondary);
  11. --cookie-banner-content: var(--content-primary-dark);
  12. --cookie-banner-link: var(--link-ui-dark);
  13. }
  14. @mixin footer-pre-redesign {
  15. --footer-background: var(--bg-dark-primary);
  16. --footer-content: var(--content-secondary-dark);
  17. --footer-link: var(--content-secondary-dark);
  18. --footer-logo-url: url('../../../frontend/js/shared/svgs/overleaf-green.svg');
  19. }
  20. @mixin footer-light {
  21. --footer-background: var(--bg-light-secondary);
  22. --footer-content: var(--content-primary);
  23. --footer-link: var(--content-primary);
  24. --footer-logo-url: url('../../../frontend/js/shared/svgs/overleaf-green.svg');
  25. }
  26. @mixin footer-dark {
  27. --footer-background: var(--bg-dark-primary);
  28. --footer-content: var(--content-primary-dark);
  29. --footer-link: var(--content-placeholder-dark);
  30. --footer-logo-url: url('../../../frontend/js/shared/svgs/overleaf-white.svg');
  31. }
  32. @mixin socials-light {
  33. --facebook-logo-background: #0866ff;
  34. --facebook-logo-path: transparent;
  35. --x-logo-path: #000;
  36. --linkedin-logo-background: #2867b2;
  37. --linkedin-logo-path: #fff;
  38. }
  39. @mixin socials-dark {
  40. --facebook-logo-background: #fff;
  41. --facebook-logo-path: transparent;
  42. --x-logo-path: #fff;
  43. --linkedin-logo-background: #fff;
  44. --linkedin-logo-path: #000;
  45. }
  46. :root {
  47. .fat-footer {
  48. @include footer-pre-redesign;
  49. }
  50. .cookie-banner {
  51. @include cookie-banner-light;
  52. }
  53. .website-redesign-fat-footer,
  54. .website-redesign .fat-footer {
  55. @include footer-light;
  56. @include socials-light;
  57. }
  58. @include theme('default') {
  59. .ide-redesign-main,
  60. .project-ds-nav-page {
  61. .cookie-banner {
  62. @include cookie-banner-dark;
  63. }
  64. .fat-footer {
  65. @include footer-dark;
  66. @include socials-dark;
  67. }
  68. }
  69. }
  70. }
  71. @mixin footer-container-up($bp) {
  72. $size: map.get($grid-breakpoints, $bp);
  73. @supports (container-type: inline-size) {
  74. @container fatfooter (width >= #{$size}) {
  75. @content;
  76. }
  77. }
  78. @supports not (container-type: inline-size) {
  79. @at-root {
  80. .project-ds-nav-page & {
  81. @media (min-width: #{$size + $footer-width-delta}) {
  82. @content;
  83. }
  84. }
  85. :not(.project-ds-nav-page *) & {
  86. @media (min-width: #{$size}) {
  87. @content;
  88. }
  89. }
  90. }
  91. }
  92. }
  93. @mixin footer-container-down($bp) {
  94. $size: map.get($grid-breakpoints, $bp);
  95. @supports (container-type: inline-size) {
  96. @container fatfooter (width < #{$size}) {
  97. @content;
  98. }
  99. }
  100. @supports not (container-type: inline-size) {
  101. @at-root {
  102. .project-ds-nav-page & {
  103. @media (max-width: #{$size + $footer-width-delta}) {
  104. @content;
  105. }
  106. }
  107. :not(.project-ds-nav-page *) & {
  108. @media (max-width: #{$size}) {
  109. @content;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. footer.site-footer {
  116. --link-color: var(--link-web);
  117. --link-hover-color: var(--link-web-hover);
  118. --link-visited-color: var(--link-web-visited);
  119. --link-text-decoration: none;
  120. --link-hover-text-decoration: underline;
  121. background-color: var(--bg-light-primary);
  122. border-top: 1px solid var(--border-primary-dark);
  123. @include body-sm;
  124. min-height: $thin-footer-height;
  125. line-height: $thin-footer-height - 1; // Hack — in Chrome, using the full $footer-height would generate vertical scrolling
  126. ul.site-footer-items {
  127. list-style: none;
  128. margin: 0;
  129. > li {
  130. display: inline-block;
  131. margin: 0 var(--spacing-04);
  132. }
  133. i {
  134. font-size: var(--font-size-05);
  135. }
  136. }
  137. }
  138. .site-footer-content {
  139. @extend .container-fluid;
  140. }
  141. .sprite-icon-lang {
  142. display: inline-block;
  143. vertical-align: middle;
  144. }
  145. #language-picker-toggle {
  146. text-decoration: none;
  147. cursor: pointer;
  148. &::after {
  149. display: none;
  150. }
  151. &:hover {
  152. .language-picker-text {
  153. text-decoration: var(--link-hover-text-decoration);
  154. }
  155. }
  156. .material-symbols {
  157. vertical-align: -0.1875rem;
  158. }
  159. }
  160. .language-picker .dropdown-menu {
  161. .dropdown-item {
  162. &.active {
  163. color: var(--green-70);
  164. }
  165. &:hover {
  166. text-decoration: none;
  167. }
  168. }
  169. }
  170. .fat-footer {
  171. --footer-text-color: var(--footer-content);
  172. --footer-background-color: var(--footer-background);
  173. --link-color: var(--footer-link);
  174. --link-hover-color: var(--footer-link);
  175. --link-visited-color: var(--footer-link);
  176. --link-text-decoration: none;
  177. --link-hover-text-decoration: underline;
  178. container-name: fatfooter;
  179. container-type: inline-size;
  180. background: var(--footer-background-color);
  181. color: var(--footer-text-color);
  182. display: flex;
  183. flex-direction: column;
  184. .fat-footer-container {
  185. margin: var(--spacing-11) auto;
  186. @include footer-container-down(sm) {
  187. margin: var(--spacing-11) 0;
  188. }
  189. }
  190. .footer-brand-container {
  191. flex: 1;
  192. }
  193. .fat-footer-sections {
  194. display: grid;
  195. column-gap: var(--spacing-07);
  196. padding: 0 var(--spacing-07) var(--spacing-07);
  197. }
  198. .footer-brand {
  199. display: block;
  200. height: 37px;
  201. width: 130px;
  202. background-image: url('../../../public/img/ol-brand/overleaf-white.svg');
  203. background-size: contain;
  204. background-repeat: no-repeat;
  205. background-position: left center;
  206. }
  207. .footer-section-heading {
  208. color: var(--footer-text-color);
  209. @include heading-sm;
  210. margin-bottom: var(--spacing-07);
  211. margin-top: var(--spacing-07);
  212. }
  213. .footer-section ul {
  214. @include body-sm;
  215. }
  216. .footer-section li {
  217. padding-bottom: var(--spacing-04);
  218. }
  219. #footer-brand {
  220. grid-column: 1/-1;
  221. margin-top: var(--spacing-07);
  222. }
  223. .fat-footer-base {
  224. color: var(--content-disabled);
  225. @include body-sm;
  226. #language-picker-toggle {
  227. color: var(--footer-text-color);
  228. }
  229. .fat-footer-base-meta a:not(.dropdown-toggle, .dropdown-item) {
  230. color: inherit;
  231. }
  232. .language-picker .dropdown-menu {
  233. .dropdown-header {
  234. display: none; /* hiding rather than removing as still needed in the thin footer */
  235. }
  236. }
  237. }
  238. .fat-footer-base-item {
  239. display: flex;
  240. white-space: nowrap;
  241. }
  242. .fat-footer-social {
  243. &.x-logo svg path {
  244. fill: var(--footer-text-color);
  245. }
  246. &.facebook-logo svg,
  247. &.linkedin-logo svg {
  248. path.background {
  249. fill: var(--footer-text-color);
  250. }
  251. }
  252. &.facebook-logo svg {
  253. path.text {
  254. fill: transparent;
  255. }
  256. }
  257. &.linkedin-logo svg {
  258. path.text {
  259. fill: var(--footer-background-color);
  260. }
  261. }
  262. }
  263. @include footer-container-down(md) {
  264. .fat-footer-sections {
  265. grid-template-columns: repeat(2, 1fr);
  266. grid-template-rows: repeat(4, auto);
  267. }
  268. .fat-footer-base {
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. .fat-footer-base-section {
  273. display: flex;
  274. align-items: center;
  275. }
  276. .fat-footer-base-social {
  277. order: 1;
  278. }
  279. .fat-footer-base-meta {
  280. display: flex;
  281. flex-direction: column-reverse;
  282. align-items: center;
  283. order: 2;
  284. }
  285. .fat-footer-base-item {
  286. flex-wrap: wrap;
  287. padding: var(--spacing-02);
  288. margin: var(--spacing-06);
  289. }
  290. .fat-footer-base-meta .fat-footer-base-item {
  291. gap: var(--spacing-09);
  292. justify-content: center;
  293. @include footer-container-down(sm) {
  294. gap: var(--spacing-06);
  295. }
  296. }
  297. .fat-footer-base-social .fat-footer-base-item {
  298. gap: var(--spacing-07);
  299. margin-top: var(--spacing-00);
  300. }
  301. .fat-footer-base-copyright {
  302. order: 2;
  303. }
  304. }
  305. }
  306. @include footer-container-up(md) {
  307. .fat-footer-container {
  308. width: (map.get($grid-breakpoints, 'md') - ($spacing-04 * 2));
  309. }
  310. #footer-brand {
  311. grid-column: auto;
  312. grid-row: 1/-1;
  313. }
  314. .fat-footer-sections {
  315. grid-template-columns: repeat(4, 1fr);
  316. grid-template-rows: repeat(2, auto);
  317. }
  318. .footer-section:last-of-type {
  319. grid-column: 4;
  320. }
  321. .fat-footer-base {
  322. display: flex;
  323. justify-content: space-between;
  324. margin: var(--spacing-07) auto;
  325. .fat-footer-base-section {
  326. display: flex;
  327. align-items: center;
  328. }
  329. .fat-footer-base-item {
  330. padding: var(--spacing-02);
  331. margin: var(--spacing-02);
  332. }
  333. .fat-footer-base-meta .fat-footer-base-item {
  334. gap: var(--spacing-07);
  335. }
  336. .fat-footer-social {
  337. margin: var(--spacing-07) var(--spacing-03);
  338. }
  339. }
  340. }
  341. @include footer-container-up(lg) {
  342. .fat-footer-container {
  343. width: (map.get($grid-breakpoints, 'lg') - $spacing-07);
  344. }
  345. .fat-footer-sections {
  346. grid-template-columns: repeat(4, 1fr);
  347. }
  348. }
  349. @include footer-container-up(xl) {
  350. .fat-footer-container {
  351. width: (map.get($grid-breakpoints, 'xl') - $spacing-09);
  352. }
  353. .fat-footer-sections {
  354. grid-template-columns: repeat(7, 1fr);
  355. grid-template-rows: auto;
  356. }
  357. .footer-section:last-of-type {
  358. grid-column: 7;
  359. }
  360. }
  361. }
  362. .cookie-banner {
  363. @include body-sm;
  364. padding: var(--spacing-05) var(--spacing-07);
  365. position: fixed;
  366. bottom: 0;
  367. left: 0;
  368. right: 0;
  369. z-index: 100;
  370. background: var(--bg-light-secondary);
  371. box-shadow: 0 -5px 8px 0 #0000001a;
  372. background-color: var(--cookie-banner-background);
  373. color: var(--cookie-banner-content);
  374. .cookie-banner-actions {
  375. padding-top: var(--spacing-04);
  376. }
  377. @include media-breakpoint-up(md) {
  378. align-items: center;
  379. display: flex;
  380. flex-wrap: wrap;
  381. .cookie-banner-content {
  382. flex: 1;
  383. }
  384. .cookie-banner-actions {
  385. flex-shrink: 0;
  386. white-space: nowrap;
  387. padding-top: var(--spacing-00);
  388. }
  389. .cookie-banner-content a,
  390. .cookie-banner-actions .btn-link {
  391. color: var(--cookie-banner-link);
  392. }
  393. }
  394. }
  395. .website-redesign-fat-footer,
  396. .website-redesign .fat-footer {
  397. --footer-text-color: var(--footer-content);
  398. .fat-footer-container {
  399. @include footer-container-down(sm) {
  400. margin: var(--spacing-11) 0;
  401. }
  402. }
  403. &.fat-footer {
  404. background: var(--footer-background);
  405. h2 {
  406. font-weight: 400;
  407. }
  408. .fat-footer-base {
  409. color: var(--footer-content);
  410. #language-picker-toggle {
  411. color: inherit;
  412. }
  413. }
  414. // This is duplication of fill colours in the SVGs themselves. This could be fixed by using :has() but that's not
  415. // supported in older versions of browsers and these logos need to be correct.
  416. .fat-footer-social {
  417. &.x-logo svg path {
  418. fill: var(--x-logo-path);
  419. }
  420. &.facebook-logo svg {
  421. path.text {
  422. fill: var(--facebook-logo-path);
  423. }
  424. path.background {
  425. fill: var(--facebook-logo-background);
  426. }
  427. }
  428. &.linkedin-logo svg {
  429. path.text {
  430. fill: var(--linkedin-logo-path);
  431. }
  432. path.background {
  433. fill: var(--linkedin-logo-background);
  434. }
  435. }
  436. }
  437. }
  438. .footer-brand {
  439. background-image: var(--footer-logo-url);
  440. }
  441. @include footer-container-down(sm) {
  442. .fat-footer-sections {
  443. grid-template-columns: repeat(1, 1fr);
  444. grid-template-rows: repeat(6, auto);
  445. }
  446. }
  447. }