Skip to content

Commit c4f6a5a

Browse files
committed
fix: settings put the tabs above the page by the width of the card instead of the viewport, so the open sidebar and agent panel no longer squeeze the page AdminForth/2005
1 parent 084e4aa commit c4f6a5a

5 files changed

Lines changed: 32 additions & 5 deletions

File tree

‎adminforth/spa/package-lock.json‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎adminforth/spa/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
},
4343
"devDependencies": {
4444
"@rushstack/eslint-patch": "^1.8.0",
45+
"@tailwindcss/container-queries": "^0.1.1",
4546
"@tailwindcss/typography": "^0.5.19",
4647
"@tsconfig/node20": "^20.1.4",
4748
"@types/lodash.debounce": "^4.0.9",

‎adminforth/spa/pnpm-lock.yaml‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎adminforth/spa/src/views/SettingsView.vue‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<template>
2-
<div class="h-full w-full px-4 py-6 md:px-10" :class="{ 'hidden': initialTabSet === false }">
2+
<div class="@container h-full w-full px-4 py-6 md:px-10" :class="{ 'hidden': initialTabSet === false }">
33
<div v-if="!visiblePages.length">
44
<p>{{ $t('No setting pages configured or still loading...') }}</p>
55
</div>
6-
<!-- settings are one card: tabs on a tinted pane at the left, the page of the active tab at the right -->
6+
<!-- settings are one card: tabs on a tinted pane at the left, the page of the active tab at the right.
7+
The card stacks them by its own width, not by the viewport, because the sidebar and the agent panel take the width too -->
78
<VerticalTabs
89
v-else
910
ref="VerticalTabsRef"
1011
v-model:active-tab="activeTab"
11-
class="md:min-h-[40rem] overflow-hidden rounded-xl border border-lightCardBorder bg-lightCardBackground dark:border-darkCardBorder dark:bg-darkCardBackground"
12-
tabsClass="m-0 md:m-0 md:w-64 md:shrink-0 px-3 py-4 md:py-5 border-b md:border-b-0 md:border-e border-lightCardBorder dark:border-darkCardBorder bg-lightVerticalTabsBackground dark:bg-darkVerticalTabsBackground"
13-
contentClass="min-w-0 overflow-x-auto p-5 md:py-6 md:ps-7 md:pe-7 md:border-s-0"
12+
class="flex flex-col @4xl:flex-row @4xl:min-h-[40rem] overflow-hidden rounded-xl border border-lightCardBorder bg-lightCardBackground dark:border-darkCardBorder dark:bg-darkCardBackground"
13+
tabsClass="m-0 md:m-0 @4xl:w-64 shrink-0 px-3 py-4 @4xl:py-5 border-b @4xl:border-b-0 @4xl:border-e border-lightCardBorder dark:border-darkCardBorder bg-lightVerticalTabsBackground dark:bg-darkVerticalTabsBackground"
14+
contentClass="min-w-0 overflow-x-auto p-6 md:border-s-0"
1415
@update:active-tab="setURL({slug: $event, pageLabel: ''})"
1516
>
1617
<template #tabs-header>

‎adminforth/spa/tailwind.config.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ export default {
1616
darkMode: 'class',
1717
plugins: [
1818
require('@tailwindcss/typography'),
19+
// `@container` on a parent, `@4xl:flex-row` on children: layouts which follow the width of their parent, not of the viewport
20+
require('@tailwindcss/container-queries'),
1921
],
2022
}

0 commit comments

Comments
 (0)