Skip to content
Pierre Germain edited this page Sep 12, 2022 · 18 revisions

Breakpoints

break px name
xs 0 mobile
sm 576
md 768 tablet
lg 992
xl 1200 desktop
xxl 1400
// Mobile
@include media-breakpoint-down(md) {}
@media (max-width: 767.98px) {}

// Tablet
@include media-breakpoint-between(sm,xl) {}
@media (min-width: 576px) and (max-width: 991.98px) { ... }

//  Tablet and Desktop
@include media-breakpoint-up(md) {}

//  Desktop
@include media-breakpoint-up(xl) {}
@media (min-width: 1200px) { ... }

Dimensions to test

  • 1440px
  • 768px
  • 376px

Chrome Debugging

part 1

part 2

manual

SASS TRICKS

%btn {}
@extend .btn;

Css Tricks

Make equal height columns

my-div {
    margin-bottom: -99999px;
    padding-bottom: 99999px;
}

See also: https://stackoverflow.com/questions/19695784/how-can-i-make-bootstrap-columns-all-the-same-height

Center Elements

https://stackoverflow.com/questions/36817249/element-will-not-stay-centered-especially-when-re-sizing-screen

WCAG

.visually-hidden { 
  position: absolute; 
  left: -10000px; 
  top: auto; 
  width: 1px; 
  height: 1px; 
  overflow: hidden; 
}

.visually-hidden:focus { 
  left: 20px; 
  width: auto; 
  height: auto; 
}
	
.display-none { 
  display: none; 
}
.visibility-hidden { 
  visibility: hidden; 
}

Focus

[data-whatinput="keyboard"]& a:focus {
  background-color: #fafafa;
}

Clone this wiki locally