Skip to content
Snippets Groups Projects
Commit 783f8a0e authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray
Browse files

Merge branch '25198-improper-use-of-bootstrap-media-query-variables' into 'master'

Resolve "Improper use of bootstrap media query variables"

## What does this MR do?

Corrects media queries which are off by `1px` due to incorrect `$screen-{xs,sm,md,lg}-min` usage.

## Are there points in the code the reviewer needs to double check?

Ensure none of these errors were somehow intentional (I can't imagine a legitimate use case for `@media (max-width: $screen-sm-min)` though)

## Why was this MR needed?

When "min" breakpoints are used for "max-width" media queries, they create an overlap in rule breakpoints.  For instance in the following scenario:

```scss
.foo {
  @media (min-width: $screen-sm-min) {
    width: 100px;
    padding: 0;
  }
  @media (max-width: $screen-sm-min) {
    padding: 10px 0;
  }
}
```

If the viewport were set to exactly `$screen-sm-min` pixels, both of these media queries would apply.  It is important to use `max-width: $screen-xs-max` in this case which is equal to `$screen-sm-min - 1`.

## Does this MR meet the acceptance criteria?

- [ ] ~~[Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added~~
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- Tests
  - [ ] ~~Added for this feature/bug~~
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #25198

See merge request !7863
parents d3f1ad82 cc1c9f8b
No related branches found
No related tags found
1 merge request!7863Resolve "Improper use of bootstrap media query variables"
Pipeline #
Showing
with 22 additions and 22 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment