@use 'sass:map';

$space: (
  -xs: -0.125rem,
  -xxs: -0.063rem,
  xxs: 0.063rem,
  xs: 0.125rem,
  sm: 0.25rem,
  md: 0.5rem,
  lg: 0.75rem,
  2x: 1rem,
  3x: 1.5rem,
  4x: 2rem,
  6x: 3rem,
  8x: 4rem,
  12x: 6rem,
  15x: 7.5rem
);

@function space($key) {
  @if map.has-key($space, $key) {
    @return map.get($space, $key);
  }
  @warn "Unknown `#{$key}` in $space";
  @return null;
}
