Skip to content
GitLab
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
  • Issues
  • #20123
Closed
Open
Issue created Jun 15, 2016 by Administrator@rootContributor

Using percentages in $container-max-widths

Created by: depl0y

By default, Bootstrap v4 SASS comes with the following settings for $container-max-widths:

$container-max-widths: (
  sm: 576px,
  md: 720px,
  lg: 940px,
  xl: 1140px
)

While I understand that I could use container-fluid to get the container width set to 100% all the time, I would like to be able to set certain widths to a percentage.

For example:

$container-max-widths: (
        sm: 100%,
        md: 100%,
        lg: 940px,
        xl: 1140px
);

This makes sure, that on smaller screens, the layout has a nice complete width, while on large screens it is bound to a max-width.

Except, setting these values causes an error while compiling the sass files: Incompatible units: 'px' and '%'.

I currently override these values by adding the following to my own sass files, but it would be nice if it could be done directly from within Bootstrap.

@media (max-width: map-get($grid-breakpoints, "lg")) {
  .container {
    max-width: 100%;
  }
}
Assignee
Assign to
Time tracking