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,
2023-02-21 21:44:48 +01:00
small: config.$breakpoint--small,
medium: config.$breakpoint--medium,
large: config.$breakpoint--large,
x-large: config.$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 {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint(config.$breakpoint--small) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--small-max {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint-max(config.$breakpoint--small) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--medium {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint(config.$breakpoint--medium) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--medium-max {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint-max(config.$breakpoint--medium) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--large {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint(config.$breakpoint--large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--large-max {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint-max(config.$breakpoint--large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--x-large {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint(config.$breakpoint--x-large) {
2023-01-06 22:40:29 +01:00
@content;
}
}
@mixin sl-breakpoint--x-large-max {
2023-02-21 21:44:48 +01:00
@include sl-breakpoint-max(config.$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;
}
}
}