Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !29951
An error occurred while fetching the assigned milestone of the selected merge_request.

Inherit flex-wrap to decrease generated css

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge master-mc-navbar-container-inherit-flex-wrap into master 5 years ago
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: MartijnCuppens

The containers within the navbar are extended, which generates quite a lot of CSS. By inheriting the flex-wrap property, we avoid the generation of these styles.

Also added the child combinator to the containers and used flex-wrap instead of flex-flow, since the flex-direction shouldn't be set.

Compare
  • master (base)

and
  • latest version
    60542916
    2 commits, 2 years ago

1 file
+ 5
- 20

    Preferences

    File browser
    Compare changes
scss/_navbar.scss
+ 5
- 20
  • View file @ 60542916

  • Edit in single-file editor

  • Open in Web IDE


@@ -27,15 +27,16 @@
// Because flex properties aren't inherited, we need to redeclare these first
// few properties so that content nested within behave properly.
// The `flex-wrap` property is inherited to simplify the expanded navbars
%container-flex-properties {
display: flex;
flex-wrap: wrap;
flex-wrap: inherit;
align-items: center;
justify-content: space-between;
}
.container,
.container-fluid {
> .container,
> .container-fluid {
@extend %container-flex-properties;
}
@@ -148,7 +149,7 @@
&#{$infix} {
@include media-breakpoint-up($next) {
flex-flow: row nowrap;
flex-wrap: nowrap;
justify-content: flex-start;
.navbar-nav {
@@ -164,22 +165,6 @@
}
}
// For nesting containers, have to redeclare for alignment purposes
%container-nesting-#{$breakpoint} {
flex-wrap: nowrap;
}
> .container,
> .container-fluid {
@extend %container-nesting-#{$breakpoint};
}
@each $size, $container-max-width in $container-max-widths {
> .container#{breakpoint-infix($size, $container-max-widths)} {
@extend %container-nesting-#{$breakpoint};
}
}
.navbar-collapse {
display: flex !important; // stylelint-disable-line declaration-no-important
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference:
Source branch: master-mc-navbar-container-inherit-flex-wrap

Menu

Explore Projects Groups Snippets