breakpoint tokens and media queries (#13)

* update

* update
This commit is contained in:
Will Bjorn 2021-03-09 09:08:49 -08:00 коммит произвёл GitHub
Родитель b56b715ac8
Коммит 06e8980f3c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 84 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,5 @@
---
'@microsoft/atlas-css': minor
---
Add token values for breakpoints. Create the mixins folder and use tokens to as basis for media query mixins.

Просмотреть файл

@ -0,0 +1 @@
@import 'media-queries.scss';

Просмотреть файл

@ -0,0 +1,70 @@
// Responsiveness
@mixin from($device) {
@media screen and (min-width: $device) {
@content;
}
}
@mixin until($device) {
@media screen and (max-width: $device - 1px),
screen and (min-resolution: 120dpi) and (max-width: $device - 0.1px) {
@content;
}
}
// Orientation
@mixin orientation-portrait {
@media screen and (max-aspect-ratio: 1/1),
screen and (min-resolution: 120dpi) and (max-aspect-ratio: 1/1) {
@content;
}
}
@mixin orientation-landscape {
@media screen and (min-aspect-ratio: 1/1),
screen and (min-resolution: 120dpi) and (min-aspect-ratio: 1/1) {
@content;
}
}
@mixin orientation-square {
@media screen and (aspect-ratio: 1/1),
screen and (min-resolution: 120dpi) and (aspect-ratio: 1/1) {
@content;
}
}
// Mobile-first media queries
@mixin small-only {
@media screen and (max-width: $breakpoint-medium - 1),
screen and (min-resolution: 120dpi) and (min-width: $breakpoint-small) and (max-width: $breakpoint-medium - 0.1px) {
@content;
}
}
@mixin small {
@media screen and (min-width: $breakpoint-small), print {
@content;
}
}
@mixin medium {
@media screen and (min-width: $breakpoint-medium), print {
@content;
}
}
@mixin large {
@media screen and (min-width: $breakpoint-large) {
@content;
}
}
@mixin massive {
@media screen and (min-width: $breakpoint-massive) {
@content;
}
}

Просмотреть файл

@ -0,0 +1,8 @@
// The horizontal gap tied to containers
$container-gap: 64px !default;
// Breakpoints
$breakpoint-small: 540px !default;
$breakpoint-medium: 768px !default;
$breakpoint-large: 1088px !default;
$breakpoint-massive: 1472px !default;