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

Bar: working on new scss #5013

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
32 changes: 16 additions & 16 deletions Source/Blazorise.Bootstrap5/Bootstrap5ClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -659,21 +659,21 @@ public override string Container( Breakpoint breakpoint )

public override string Bar( BarMode mode ) => "navbar";

public override string BarInitial( BarMode mode, bool initial ) => initial ? "b-bar-initial" : null;
public override string BarInitial( BarMode mode, bool initial ) => initial ? "navbar-initial" : null;

public override string BarAlignment( BarMode mode, Alignment alignment ) => FlexAlignment( alignment );

public override string BarThemeContrast( BarMode mode, ThemeContrast themeContrast ) => $"navbar-{ToThemeContrast( themeContrast )} b-bar-{ToThemeContrast( themeContrast )}";

public override string BarBreakpoint( BarMode mode, Breakpoint breakpoint ) => breakpoint != Breakpoint.None && breakpoint != Breakpoint.Mobile ? $"navbar-expand-{ToBreakpoint( breakpoint )}" : null;

public override string BarMode( BarMode mode ) => $"b-bar-{ToBarMode( mode )}";
public override string BarMode( BarMode mode ) => mode != Blazorise.BarMode.Horizontal ? $"navbar-{ToBarMode( mode )} flex-column" : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not an issue, but I think it reads better in the positive mode == Blazorise.BarMode.Horizontal and invert acorrdingly.

Also that's how It is done in other places below, so I'd just keep it consistent
image


public override string BarItem( BarMode mode, bool hasDropdown ) => mode == Blazorise.BarMode.Horizontal
? hasDropdown
? "nav-item dropdown"
: "nav-item"
: "b-bar-item";
: "nav-item";

public override string BarItemActive( BarMode mode ) => Active();

Expand All @@ -683,55 +683,55 @@ public override string BarItem( BarMode mode, bool hasDropdown ) => mode == Blaz

public override string BarItemHasDropdownShow( BarMode mode ) => null;

public override string BarLink( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "nav-link" : "b-bar-link";
public override string BarLink( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "nav-link" : "nav-link";

public override string BarLinkDisabled( BarMode mode ) => Disabled();

public override string BarBrand( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-brand" : "b-bar-brand";
public override string BarBrand( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-brand" : "navbar-brand";

public override string BarToggler( BarMode mode, BarTogglerMode togglerMode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-toggler" :
togglerMode == BarTogglerMode.Popout ? "b-bar-toggler-popout" : "b-bar-toggler-inline";
togglerMode == BarTogglerMode.Popout ? "navbar-toggler-popout" : "navbar-toggler-inline";

public override string BarTogglerCollapsed( BarMode mode, BarTogglerMode togglerMode, bool isShow ) => isShow || mode != Blazorise.BarMode.Horizontal ? null : "collapsed";

public override string BarMenu( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "collapse navbar-collapse" : "b-bar-menu";
public override string BarMenu( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "collapse navbar-collapse" : "collapse navbar-collapse";
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference here? We have a condition where both cases takes us to the same result?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected to be collapse navbar-collapse for every case?


public override string BarMenuShow( BarMode mode ) => Show();

public override string BarStart( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-nav me-auto" : "b-bar-start";
public override string BarStart( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-nav me-auto" : "navbar-start flex-column";

public override string BarEnd( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-nav ms-auto" : "b-bar-end";
public override string BarEnd( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "navbar-nav ms-auto" : "navbar-end flex-column";

public override string BarDropdown( BarMode mode, bool isBarDropDownSubmenu ) => mode == Blazorise.BarMode.Horizontal ? "dropdown" : "b-bar-dropdown";
public override string BarDropdown( BarMode mode, bool isBarDropDownSubmenu ) => mode == Blazorise.BarMode.Horizontal ? "dropdown" : "dropdown";

Comment on lines -705 to 706
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant condition?

public override string BarDropdownShow( BarMode mode ) => Show();

public override string BarDropdownToggle( BarMode mode, bool isBarDropDownSubmenu ) => mode == Blazorise.BarMode.Horizontal
? isBarDropDownSubmenu
? "dropdown-item"
: "nav-link dropdown-toggle"
: "b-bar-link b-bar-dropdown-toggle";
: "nav-link dropdown-toggle";
Comment on lines 709 to +713
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check, but this seems like it can be simplified to mode == Blazorise.BarMode.Horizontal && isBarDropDownSubmenu ...?


public override string BarDropdownToggleDisabled( BarMode mode, bool isBarDropDownSubmenu, bool disabled )
=> mode == Blazorise.BarMode.Horizontal && disabled ? "disabled" : null;

public override string BarDropdownItem( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "dropdown-item" : "b-bar-dropdown-item";
public override string BarDropdownItem( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "dropdown-item" : "dropdown-item";
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant?


public override string BarTogglerIcon( BarMode mode ) => "navbar-toggler-icon";

public override string BarDropdownDivider( BarMode mode ) => "dropdown-divider";

public override string BarDropdownMenu( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "dropdown-menu" : "b-bar-dropdown-menu";
public override string BarDropdownMenu( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "dropdown-menu" : "dropdown-menu";
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant?


public override string BarDropdownMenuVisible( BarMode mode, bool visible ) => visible ? Show() : null;

public override string BarDropdownMenuRight( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "dropdown-menu-end" : "b-bar-right";
public override string BarDropdownMenuRight( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? "dropdown-menu-end" : "dropdown-menu-end";
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant?


public override string BarDropdownMenuContainer( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? null : "b-bar-dropdown-menu-container";
public override string BarDropdownMenuContainer( BarMode mode ) => mode == Blazorise.BarMode.Horizontal ? null : "dropdown-menu-container";

public override string BarCollapsed( BarMode mode ) => null;

public override string BarLabel( BarMode mode ) => "b-bar-label";
public override string BarLabel( BarMode mode ) => "navbar-label";

#endregion

Expand Down
Loading
Loading