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

Adjust content spec page height to prevent 2 scrolls #1113

Merged
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
5 changes: 5 additions & 0 deletions .changeset/swift-cheetahs-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/core": patch
---

fix(core): fixed issue with double scroll bars on spec pages
4 changes: 2 additions & 2 deletions eventcatalog/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const logo = {

<nav
id="eventcatalog-header"
class="fixed top-0 left-0 right-0 bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
class="fixed top-0 left-0 right-0 h-header bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
>
<div class="px-4 sm:px-4 lg:px-4">
<div class="flex justify-between items-center">
Expand Down Expand Up @@ -76,7 +76,7 @@ const logo = {
</div>
</nav>

<div id="eventcatalog-header-spacer" class="h-16"></div>
<div id="eventcatalog-header-spacer" class="h-header"></div>
<!-- Spacer to prevent content from being hidden under the fixed header -->

<script>
Expand Down
7 changes: 5 additions & 2 deletions eventcatalog/src/layouts/VerticalSideBarLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,15 @@ const showSideBarOnLoad = currentNavigationItem?.sidebar;

<div
id="sidebar"
class={`sidebar-transition h-[100vh] max-h-screen px-5 py-4 overflow-y-auto bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 w-60 shadow-lg ml-16 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
class={`sidebar-transition h-content px-5 py-4 overflow-y-auto bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 w-60 shadow-lg ml-16 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
>
<CatalogResourcesSideBar resources={sideNav} currentPath={currentPath} client:load />
</div>
</aside>
<main class={`sidebar-transition w-full max-h-screen ${showSideBarOnLoad ? 'ml-0' : 'ml-16'}`} id="content">
<main
class={`sidebar-transition w-full max-h-content overflow-y-auto ${showSideBarOnLoad ? 'ml-0' : 'ml-16'}`}
id="content"
>
<slot />
</main>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const pathOnDisk = path.join(process.cwd(), 'public', pathToSpec);
const fileExists = fs.existsSync(pathOnDisk);
---

<VerticalSideBarLayout title="OpenAPI Spec" }>
<VerticalSideBarLayout title="OpenAPI Spec">
{
!fileExists ? (
<div class="text-center h-screen flex flex-col justify-center ">
Expand All @@ -65,7 +65,7 @@ const fileExists = fs.existsSync(pathOnDisk);
theme="light"
schema-style="table"
class="relative top-0"
style={{ height: '100vh', width: '100%', zIndex: 100 }}
style={{ height: '100%', width: '100%', zIndex: 100 }}
regular-font="ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"
bg-color="#ffffff"
primary-color="#6b21a8"
Expand Down
15 changes: 13 additions & 2 deletions eventcatalog/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/** @type {import('tailwindcss').Config} */
import config from './eventcatalog.config.js';

const HEADER_HEIGHT = '4rem';
const theme = config.theme || {};

/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {
height: {
header: HEADER_HEIGHT,
content: `calc(100vh - ${HEADER_HEIGHT})`,
},
spacing: {
header: HEADER_HEIGHT,
content: `calc(100vh - ${HEADER_HEIGHT})`,
},
screens: {
xxl: '1990px',
},
Expand All @@ -17,7 +28,7 @@ export default {
DEFAULT: '#ff6633',
dark: '#cc3300',
},
...theme
...theme,
},
},
},
Expand Down