Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sponsored NTP logo placement (uplift to 1.20.x) #7694

Merged
merged 1 commit into from
Jan 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion components/brave_new_tab_ui/components/default/page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const StyledPage = styled<PageProps, 'div'>('div')`
--ntp-extra-footer-rows: ${p => p.showBrandedWallpaper ? 1 : 0};
--ntp-space-rows: 0;
--ntp-page-rows: calc(var(--ntp-item-row-count) + var(--ntp-space-rows));
--ntp-page-padding: 12px;
--ntp-item-justify: start;
--blur-amount: calc(var(--ntp-extra-content-effect-multiplier, 0) * 38px);
@media screen and (max-width: ${breakpointLargeBlocks}) {
Expand All @@ -72,7 +73,7 @@ const StyledPage = styled<PageProps, 'div'>('div')`
grid-template-rows: repeat(calc(var(--ntp-page-rows) - 1), min-content) auto;
grid-template-columns: min-content auto min-content;
grid-auto-flow: row dense;
padding: 12px;
padding: var(--ntp-page-padding);
overflow: hidden;
flex: 1;
flex-direction: column;
Expand Down Expand Up @@ -215,6 +216,17 @@ export const GridItemBrandedLogo = styled(GridItemCredits)`
--ntp-grid-item-credits-left-margin-narrow: 0;
--ntp-grid-item-credits-bottom-margin-wide: -8px;
--ntp-grid-item-credits-left-margin-wide: 22px;

@media screen and (min-width: ${breakpointEveryBlock}) {
position: fixed;
bottom: var(--ntp-page-padding);
left: var(--ntp-page-padding);
.${CLASSNAME_PAGE_STUCK} & {
// When page is also position: fixed, then we are relative to that
bottom: 0;
left: 0;
}
}
`

export const GridItemNavigation = styled('section')`
Expand Down