sass-site/source/assets/sass/_breakpoints.scss

81 lines
1.5 KiB
SCSS
Raw Normal View History

2023-02-21 21:44:48 +01:00
@use 'config';
2023-01-12 19:19:42 +01:00
2023-01-06 22:40:29 +01:00
$sl-breakpoints: (
2023-01-09 20:10:02 +01:00
// for mixins to span across breakpoints and without one
none: 0,
small: config.$sl-breakpoint--small,
medium: config.$sl-breakpoint--medium,
large: config.$sl-breakpoint--large,
x-large: config.$sl-breakpoint--x-large
2023-01-06 22:40:29 +01:00
);
@mixin sl-breakpoint($breakpoint) {
@media only screen and (min-width: $breakpoint) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint-max($breakpoint) {
@media only screen and (max-width: $breakpoint) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--small {
@include sl-breakpoint(config.$sl-breakpoint--small) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--small-max {
@include sl-breakpoint-max(config.$sl-breakpoint--small) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--medium {
@include sl-breakpoint(config.$sl-breakpoint--medium) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--medium-max {
@include sl-breakpoint-max(config.$sl-breakpoint--medium) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--large {
@include sl-breakpoint(config.$sl-breakpoint--large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--large-max {
@include sl-breakpoint-max(config.$sl-breakpoint--large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--x-large {
@include sl-breakpoint(config.$sl-breakpoint--x-large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--x-large-max {
@include sl-breakpoint-max(config.$sl-breakpoint--x-large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
2023-01-09 20:10:02 +01:00
@mixin sl-breakpoint-set($breakpoint, $size) {
2023-01-06 22:40:29 +01:00
@if $breakpoint == none {
@content;
2023-01-09 20:10:02 +01:00
} @else {
2023-01-06 22:40:29 +01:00
@include sl-breakpoint($size) {
@content;
}
}
}