Skip to content

Commit

Permalink
Merge pull request #46811 from nextcloud/backport/46784/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(styles): Make sure footer with legal links is shown correctly
  • Loading branch information
susnux authored Jul 30, 2024
2 parents b827d12 + 2ce9eb3 commit 239ea11
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 26 deletions.
2 changes: 1 addition & 1 deletion apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function getShortFooter() {
}
}
if ($legalLinks !== '') {
$footer .= '<br/>' . $legalLinks;
$footer .= '<br/><span class="footer__legal-links">' . $legalLinks . '</span>';
}

return $footer;
Expand Down
6 changes: 3 additions & 3 deletions apps/theming/tests/ThemingDefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function testGetShortFooterImprint() {
->method('t')
->willReturnArgument(0);

$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan<br/><a href="https://example.com/imprint" class="legal" target="_blank" rel="noreferrer noopener">Legal notice</a>', $this->template->getShortFooter());
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan<br/><span class="footer__legal-links"><a href="https://example.com/imprint" class="legal" target="_blank" rel="noreferrer noopener">Legal notice</a></span>', $this->template->getShortFooter());
}

public function testGetShortFooterPrivacy() {
Expand All @@ -351,7 +351,7 @@ public function testGetShortFooterPrivacy() {
->method('t')
->willReturnArgument(0);

$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan<br/><a href="https://example.com/privacy" class="legal" target="_blank" rel="noreferrer noopener">Privacy policy</a>', $this->template->getShortFooter());
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan<br/><span class="footer__legal-links"><a href="https://example.com/privacy" class="legal" target="_blank" rel="noreferrer noopener">Privacy policy</a></span>', $this->template->getShortFooter());
}

public function testGetShortFooterAllLegalLinks() {
Expand All @@ -372,7 +372,7 @@ public function testGetShortFooterAllLegalLinks() {
->method('t')
->willReturnArgument(0);

$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan<br/><a href="https://example.com/imprint" class="legal" target="_blank" rel="noreferrer noopener">Legal notice</a> · <a href="https://example.com/privacy" class="legal" target="_blank" rel="noreferrer noopener">Privacy policy</a>', $this->template->getShortFooter());
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan<br/><span class="footer__legal-links"><a href="https://example.com/imprint" class="legal" target="_blank" rel="noreferrer noopener">Legal notice</a> · <a href="https://example.com/privacy" class="legal" target="_blank" rel="noreferrer noopener">Privacy policy</a></span>', $this->template->getShortFooter());
}

public function invalidLegalUrlProvider() {
Expand Down
2 changes: 1 addition & 1 deletion core/css/public.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/css/public.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 40 additions & 17 deletions core/css/public.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
$footer-height: 65px;

#body-public {
--footer-height: calc(var(--default-line-height) + 2 * var(--default-grid-baseline));;

&:has(.footer__legal-links),
&:has(.footer__simple-sign-up) {
--footer-height: calc(2 * var(--default-line-height) + 3 * var(--default-grid-baseline));;
}

&:has(.footer__legal-links):has(.footer__simple-sign-up) {
--footer-height: calc(3 * var(--default-line-height) + 3 * var(--default-grid-baseline));
}

.header-right {

#header-primary-action a {
Expand Down Expand Up @@ -37,9 +46,11 @@ $footer-height: 65px;
}

#content {
// 100% - footer
min-height: calc(100% - #{$footer-height});
min-height: var(--body-height, calc(100% - var(--footer-height)));
}

#app-content-vue {
padding-block-end: var(--footer-height);
}

/** don't apply content header padding on the base layout */
Expand All @@ -64,27 +75,39 @@ $footer-height: 65px;
/* public footer */
footer {
position: fixed;
bottom: var(--body-container-margin);;
background-color: var(--color-main-background);
border-radius: var(--body-container-radius);
box-sizing: border-box;

display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: $footer-height;
flex-direction: column;
bottom: 0;
width: calc(100% - 16px);
margin: 8px;
background-color: var(--color-main-background);
border-radius: var(--border-radius-large);

height: var(--footer-height);
width: calc(100% - 2 * var(--body-container-margin));
margin-inline: var(--body-container-margin);
padding-block: var(--default-grid-baseline);

.footer__legal-links {
margin-block-end: var(--default-grid-baseline);
}

p {
text-align: center;
color: var(--color-text-lighter);
color: var(--color-text-maxcontrast);
margin-block: 0 var(--default-grid-baseline);
width: 100%;

a {
color: var(--color-text-lighter);
display: inline-block;
font-size: var(--default-font-size);
font-weight: bold;
line-height: var(--default-line-height);
height: var(--default-line-height);
color: var(--color-text-maxcontrast);
white-space: nowrap;
/* increasing clickability to more than the text height */
padding: 10px;
margin: -10px;
line-height: 200%;
}
}
}
Expand Down
Loading

0 comments on commit 239ea11

Please sign in to comment.