Skip to content

Instantly share code, notes, and snippets.

@Hansanghyeon
Created June 19, 2021 08:49
Show Gist options
  • Save Hansanghyeon/05b5f721f4543ff4b4e9759710d4fcef to your computer and use it in GitHub Desktop.
Save Hansanghyeon/05b5f721f4543ff4b4e9759710d4fcef to your computer and use it in GitHub Desktop.
[scss] gap @supports
@mixin gap($size: 1em, $direction: y) {
--gap: #{$size};
@supports (gap: var(--gap)) {
gap: var(--gap);
}
@supports not (gap: var(--gap)) {
> *:not(:last-child) {
@if $direction == x {
margin-right: var(--gap);
}
@if $direction == y {
margin-bottom: var(--gap);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment