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

Navbar optimizations #29864

Merged
merged 3 commits into from
Dec 25, 2019
Merged

Navbar optimizations #29864

merged 3 commits into from
Dec 25, 2019

Conversation

MartijnCuppens
Copy link
Member

  • Remove redundant display: inline-block from flex children
  • Remove line-height: inherit; which is the default value of line-height
  • Use flex shorthand
  • Improve background shorthand
  • Fix removed brand margin caused by requiring containers in navbars

@MartijnCuppens MartijnCuppens requested a review from a team as a code owner December 16, 2019 20:20
@MartijnCuppens MartijnCuppens added this to Inbox in v5 via automation Dec 16, 2019
@XhmikosR
Copy link
Member

@MartijnCuppens did you test this with IE 11 too?

@MartijnCuppens
Copy link
Member Author

@MartijnCuppens did you test this with IE 11 too?

Yes

@twbs twbs deleted a comment from erolgobel17 Dec 18, 2019
@mdo
Copy link
Member

mdo commented Dec 18, 2019

  • Use flex shorthand
  • Improve background shorthand

Generally speaking, I always prefer to be explicit instead of using shorthand. Shorthand often hides an explicit choice and can add extra property-values. Long form is also a little more readable IMO as it avoids special syntax around /, spaces, etc. Thoughts?

@XhmikosR
Copy link
Member

It's a thin line for sure :/ That being said when we just need to set all properties, a shorthand is fine IMHO. No need not to leverage shorthands' power in this case.

scss/_navbar.scss Outdated Show resolved Hide resolved
- Remove redundant `display: inline-block` from flex children
- Remove `line-height: inherit;` which is the default value of `line-height`
- Use flex shorthand
- Improve background shorthand
- Fix removed brand margin caused by requiring containers in navbars
@MartijnCuppens
Copy link
Member Author

Generally speaking, I always prefer to be explicit instead of using shorthand.

It's a thin line indeed, but in this case:

  • The adjustments to the flex shorthand only add flex-shrink: 0, which makes sense because you don't want to chop off the navigation.

  • The background property was already a shorthand which didn't include the background sizing.

when we just need to set all properties, a shorthand is fine

Let's live by this rule. I'm gonna check where we need to adjust things on other places (I'll open a separate PR to fix these issues).

v5 automation moved this from Inbox to Approved Dec 24, 2019
@XhmikosR XhmikosR merged commit 74e45eb into master Dec 25, 2019
v5 automation moved this from Approved to Shipped Dec 25, 2019
@XhmikosR XhmikosR deleted the master-mc-navbar-optimize branch December 25, 2019 16:38
olsza pushed a commit to olsza/bootstrap that referenced this pull request Oct 3, 2020
- Remove redundant `display: inline-block` from flex children
- Remove `line-height: inherit;` which is the default value of `line-height`
- Use flex shorthand
- Improve background shorthand
- Fix removed brand margin caused by requiring containers in navbars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v5
  
Shipped
Development

Successfully merging this pull request may close these issues.

None yet

3 participants