in-only ()
Generates a media query rule for the given horizontal breakpoint.
Parameters
$breakpoint
- The name of the breakpoint at which the generated rule should break.
- Type
String
Return Value
String
- A string representation of the media query condition that meets the requirements for the given breakpoint.
Example
@use '@sass-fairy/break';
// 1. As a function
@debug break.in-only('md');
// '(min-width: 768px) and (max-width: 991.98px)'
// 2. As a mixin
body {
padding: 2rem;
@include break.in-only('md') {
padding: 1rem;
}
}
// body { padding: 2rem }
// @media (min-width: 768px) and (max-width: 991.98px) {
// body { padding: 1rem }
// }