Skip to content

Commit

Permalink
Set bg color of main depending on child page
Browse files Browse the repository at this point in the history
This is more of a workaround to set the background color for the question pages so that the blue background expands to the footer. Expanding the whole page <div> is not easily possible with CSS since the <main> element is child of a flex and does not have a pre-defined height. If one finds a better solution, please feel free to replace this.
  • Loading branch information
mpanne committed Jan 9, 2025
1 parent 0018c5b commit 21d3565
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dito/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export default function App() {
/>
}
>
<main className="grow">
<main className="grow [&:has(.main-bg-blue)]:bg-blue-100">
<Outlet context={{ featureFlags }} />
</main>
</Document>
Expand Down
2 changes: 1 addition & 1 deletion packages/dito/app/routes/vorpruefung.$questionId/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function Index() {
);

return (
<div className="flex bg-blue-100 sm:pt-32">
<div className="flex bg-blue-100 sm:pt-32 main-bg-blue">
<div className="hidden lg:block flex-none pl-32">
<PreCheckNavigation question={question} answers={answers ?? {}} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/dito/app/routes/vorpruefung.hinweise.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
export default function GeneralInfo() {
const { answers } = useLoaderData<typeof loader>();
return (
<div className="flex grow bg-blue-100 sm:pt-32 w-full h-full">
<div className="flex bg-blue-100 sm:pt-32 main-bg-blue">
<div className="hidden lg:block flex-none pl-32">
<PreCheckNavigation answers={answers ?? {}} />
</div>
Expand Down

0 comments on commit 21d3565

Please sign in to comment.