Skip to content

Instantly share code, notes, and snippets.

@alexeyraspopov
Created October 9, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexeyraspopov/ba6a11bfaa5de78b6c34ac243b85c9b6 to your computer and use it in GitHub Desktop.
Save alexeyraspopov/ba6a11bfaa5de78b6c34ac243b85c9b6 to your computer and use it in GitHub Desktop.
:root {
--gap: 0.5em;
}
.horizontal-stack {
display: flex;
flex-direction: row;
}
.vertical-stack {
display: flex;
flex-direction: column;
}
@supports (gap: 1px) {
.horizontal-stack {
column-gap: var(--gap);
}
.vertical-stack {
row-gap: var(--gap);
}
}
@supports not (gap: 1px) {
.horizontal-stack > * + * {
margin-left: var(--gap);
}
.vertical-stack > * + * {
margin-top: var(--gap);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment