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

Align sidebar elements with breadcrumbs bar and toolbar #1402

Merged
merged 3 commits into from
Mar 30, 2023
Merged

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Mar 30, 2023

I'm formalising the heights of various elements so things line up properly between the sidebar and the main area.

The core change is that I'm giving the same height to all the elements that have the potential to be lined up with each other: the sidebar's tab bar, the breadcrumbs bar, the explorer's root entity button, the search input row, the metadata viewer's header rows.

Giving the same height to the breadcrumbs bar and to the toolbar simplifies things a lot because when the search is enabled, the search input row must line up with the toolbar, and when the search is disabled, the explorer's root entity button must line up with the breadcrumbs bar.

I introduce a CSS variable in the viewer to control this height: --toolbar-height. Seems logical that the toolbar be the element that other elements line up to, since it's kind of the most important one.

I also add a CSS variable to control the height of the toolbar buttons: --toolbarBtn-height, which I use for explorer buttons too, and I map those two variables to two more variables in the lib: --h5w-toolbar--height and --h5w-btn--height. I give those default values such that the toolbar and buttons in Braggy (notably) keep the same height as before.

This is what it looks like now:

image

image

apps/storybook/src/Customization.stories.mdx Show resolved Hide resolved
apps/storybook/src/Customization.stories.mdx Show resolved Hide resolved
packages/app/src/Sidebar.module.css Show resolved Hide resolved
packages/app/src/Sidebar.module.css Show resolved Hide resolved
packages/app/src/Sidebar.module.css Show resolved Hide resolved
packages/app/src/search/Search.module.css Show resolved Hide resolved
packages/lib/src/toolbar/Toolbar.module.css Show resolved Hide resolved
packages/lib/src/toolbar/Toolbar.module.css Show resolved Hide resolved
@axelboc axelboc requested a review from loichuder March 30, 2023 14:02
Copy link
Member

@loichuder loichuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligning the search elements indeed felt a bit hacky so it is a nice improvement

@axelboc
Copy link
Contributor Author

axelboc commented Mar 30, 2023

/approve

@axelboc axelboc merged commit f83fd4b into main Mar 30, 2023
@axelboc axelboc deleted the fix-vert-align branch March 30, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants