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

fix(layout): prevent layout shift with sidebars #1705

Merged
merged 2 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/Helpers/render/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function RenderToolbar(): void

],
];
echo "<ul class='flex-1'>";
echo "<ul>";
echo "<li><a href='#'>Games</a>";
echo "<div>";
foreach ($menuSystemsList as $column) {
Expand Down
13 changes: 0 additions & 13 deletions resources/css/legacy.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@
border: 2px solid var(--embed-color);
border-radius: 4px;
align-self: start;
grid-column: span 2;
flex-grow: 1;
background: var(--box-bg-color);
background: linear-gradient(180deg, var(--box-bg-color) 0%, var(--bg-color) 100%);
overflow: auto; /* 1 */
grid-column: 1 / -1;
}

/*
Expand All @@ -41,7 +38,6 @@
display: block;
border: 2px solid var(--embed-color);
border-radius: 4px;
align-self: start;
background: var(--box-bg-color);
background: linear-gradient(180deg, var(--box-bg-color) 0%, var(--bg-color) 100%);
overflow: auto; /* 1 */
Expand All @@ -56,15 +52,6 @@
background: var(--box-bg-color);
background: linear-gradient(0deg, var(--box-bg-color) 0%, var(--bg-color) 100%);
overflow: auto; /* 1 */
width: 100%;
}

@media only screen and (min-width: 1024px) {
#rightcontainer, aside {
width: 340px;
max-width: 340px;
min-width: 340px;
}
}

/* TODO replace with sections */
Expand Down
1 change: 0 additions & 1 deletion resources/css/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
.searchbox-top {
background-color: var(--embed-color);
border-radius: 4px;
width: 340px;
}

.searchbox-top .searchboxinput {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/menu/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<x-nav-item :link="route('tool.index')">{{ __('Tools') }}</x-nav-item>
@endif
</ul>--}}
<div class="lg:flex gap-4 justify-between items-center" id="innermenu">
<div class="lg:grid grid-cols-[1fr_340px] gap-4" id="innermenu">
<?php RenderToolbar() ?>
</div>
2 changes: 1 addition & 1 deletion resources/views/components/user/top-card.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/** @var ?User $user */
$user = request()->user();
?>
<div class="bg-embedded rounded lg:w-[340px] lg:my-4 p-[1.125rem]">
<div class="bg-embedded rounded lg:my-4 p-[1.125rem]">
@guest
<form class="flex gap-[1.125rem]" action="/request/auth/login.php" method="post">
@csrf
Expand Down
4 changes: 2 additions & 2 deletions resources/views/layouts/components/brand-top.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-section class="brand-top">
<x-container>
{{--<div class="hidden lg:flex gap-4 justify-between items-center">--}}
<div class="lg:flex gap-4 justify-between items-center">
<div class="lg:grid grid-cols-[1fr_340px] gap-4 items-center">
{{-- TODO re-build settings page for logo --}}
{{--@if(request()->cookie('logo') === 'retro')
<div class="logo-container lg:flex justify-start items-center pr-4 pt-4">
Expand Down Expand Up @@ -30,7 +30,7 @@
</a>
</div>
@endif--}}
<div class="p-4 flex-1 text-center">
<div class="p-4 text-center">
<a href="{{ route('home') }}"><img style="max-width:550px;width:100%" src="{{ asset('assets/images/ra-logo-sm.webp') }}" alt="RetroAchievements logo"></a>
</div>
<x-user.top-card/>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/layouts/components/main.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<x-container :fluid="$fluid ?? false">
<main class="{{ $class ?? 'mb-5' }}" data-scroll-target>
@if(trim($sidebar ?? false))
<div class="lg:grid grid-flow-col gap-4">
<aside class="lg:col-span-1 {{ $sidebarPosition === 'right' ? 'order-2' : 'order-1'}}">
{{ $sidebar }}
</aside>
<article class="lg:col-span-2 mb-3 {{ $sidebarPosition === 'right' ? 'order-1' : 'order-2'}}">
<div class="lg:grid grid-cols-[1fr_340px] gap-4">
<article class="{{ $sidebarPosition === 'right' ? 'order-2' : 'order-1'}}">
{{ $slot }}
</article>
<aside class="{{ $sidebarPosition === 'right' ? 'order-2' : 'order-1'}}">
{{ $sidebar }}
</aside>
</div>
@else
<article>
Expand Down
Loading