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
  • Merge requests
  • !3785

Update Media Queries Order

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ctalkington/patch2101 into 2.1.0-wip Jun 10, 2012
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 6

Created by: ctalkington

I have been using the responsive media queries a lot more lately and I noticed that the way BS currently is ordering media queries, you have to use !important when you want to override anything in tablet to mobile range. I understand BS is a starting point but it should also provide a smart workflow so that you can just add your styling into the responsive less files. My changes allow cascading to take effect and provide a nicer start point for many projects that are starting at desktop and going down to mobile.

It isn't that apparent with the styles BS currently uses, as they don't really target the same things, but once you start trying to adjust things you see what I mean.

In the below sample, by using the new ordering, devices 480px and below would have a blue background and devices 767px and below would have a red background. If it was the other way around, the background would always be red even at 480px unless !important is used which can create a major pain in the neck.

@media (max-width:767px) {
    body {
        background: red;
        color: white;
    }
}
@media (max-width:480px) {
    body {
        background: blue;
        font-family: serif;
    }
}
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ctalkington/patch2101