Skip to content

Instantly share code, notes, and snippets.

@andyjessop
Last active March 13, 2023 08:05
Show Gist options
  • Save andyjessop/db25ba236decdd54cf076d7f1264bb66 to your computer and use it in GitHub Desktop.
Save andyjessop/db25ba236decdd54cf076d7f1264bb66 to your computer and use it in GitHub Desktop.
Ant.d's Space component in CSS
import { spaced } from '@crux/design/styles';
...
html`
<div class=${cx(spaced.container, spaced.vertical, spaced.small)}>
<div>1</div>
<div>2</div>
<div>3</div>
</div>`;
.container {
display: inline-flex;
flex-direction: row;
align-items: center;
gap: var(--cx-spaced-gap-default, var(--cx-spacing-2));
}
.container.small {
gap: var(--cx-spaced-gap-small, var(--cx-spacing-1));
}
.container.large {
gap: var(--cx-spaced-gap-large, var(--cx-spacing-4));
}
.container.vertical {
flex-direction: column;
align-items: stretch;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment