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 --mud-appbar-height does not match actual app bar height #10217

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

RamType0
Copy link
Contributor

@RamType0 RamType0 commented Nov 8, 2024

Description

Fixes #10083.
This also includes the fix for the issue of duplicated CSS variables reported in #10214.

How Has This Been Tested?

  • Run Unit tests and confirmed that this PR do not make newly failed test.
    (DateRangePickerTests.FormatFirst_Should_RenderCorrectly and DateRangePickerTests.FormatLast_Should_RenderCorrectly fail even before this PR)
  • Visually confirmed that AppBar's responsive height works properly inMudBlazor.Docs.Server.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • LayoutProperties.AppbarHeight is now obsoleted and renamed to LayoutProperties.AppBarBaseHeight as its current naming is confusing
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

Copy link

sonarcloud bot commented Nov 8, 2024

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.21%. Comparing base (7576772) to head (fe05561).
Report is 55 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10217       /-   ##
==========================================
  Coverage   91.16%   91.21%    0.05%     
==========================================
  Files         411      411              
  Lines       12467    12506       39     
  Branches     2420     2439       19     
==========================================
  Hits        11365    11407       42     
  Misses        557      555       -2     
  Partials      545      544       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Garderoben Garderoben left a comment

Choose a reason for hiding this comment

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

I really dont understand what you are trying to achieve here?
Could you please elaborate, the issue you refer to and the changes you do, i dont see the connection.

Also we will not merge the current solution to the library because of the CSS added to the :root

@RamType0
Copy link
Contributor Author

RamType0 commented Nov 26, 2024

I really dont understand what you are trying to achieve here? Could you please elaborate, the issue you refer to and the changes you do, i dont see the connection.

The actual height of MudAppBar not always equals to --mud-appbar-height.
MudAppBar sometimes has actual height of calc(var(--mud-appbar-height) - var(--mud-appbar-height) / 8) with MudBlazor's built-in responsive layout.

This problem making it very difficult to make MudBlazor app with safe area support.
Unless this issue does not exist, we can simply support safe area by

<MudAppBar Style="padding-top: env(safe-area-inset-top)"/>

<MudMainContent Style="margin-top: calc(env(safe-area-inset-top)   var(--mud-appbar-height))">
@Body
</MudMainContent>

This PR makes --mud-appbar-height always matches actual app bar height.

Also we will not merge the current solution to the library because of the CSS added to the :root

Why?
I have never seen such restriction in Contributing.

@Garderoben
Copy link
Member

I really dont understand what you are trying to achieve here? Could you please elaborate, the issue you refer to and the changes you do, i dont see the connection.

The actual height of MudAppBar not always equals to --mud-appbar-height.
MudAppBar sometimes has actual height of calc(var(--mud-appbar-height) - var(--mud-appbar-height) / 8) with MudBlazor's built-in responsive layout.

This problem making it very difficult to make MudBlazor app with safe area support.
Unless this issue does not exist, we can simply support safe area by

<MudAppBar Style="padding-top: env(safe-area-inset-top)"/>

<MudMainContent Style="margin-top: calc(env(safe-area-inset-top)   var(--mud-appbar-height))">
@Body
</MudMainContent>

This PR makes --mud-appbar-height always matches actual app bar height.

Also we will not merge the current solution to the library because of the CSS added to the :root

Why? I have never seen such restriction in Contributing.

Okay then i understand what you are trying to achieve, you want the variable to be updated with the real value depending on device size.

Doing it this way in the root is messy and is always calculated in your browser, see this:
whatitlookslike.webm

The current AppBar Height property is just meant to be the base size, where it gets changed depending on device size. I don't think the gains here is worth moving it all to the root: as a component library as it effects everyone and is a specific request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--mud-appbar-height is not always equals MudAppBar's actual height
3 participants