// body font size
@import '../variable/_variable.scss';

@function legacy-direction($value) {
	@if is-direction($value) == false {
	  @error "Cannot convert `#{$value}` to legacy syntax because it doesn't seem to be a direction.";
	}
  
	$conversion-map: (
	  to top          : bottom,
	  to top right    : bottom left,
	  to right top    : left bottom,
	  to right        : left,
	  to bottom right : top left,
	  to right bottom : left top,
	  to bottom       : top,
	  to bottom left  : top right,
	  to left bottom  : right top,
	  to left         : right,
	  to left top     : right bottom,
	  to top left     : bottom right
	);
  
	@if map-has-key($conversion-map, $value) {
	  @return map-get($conversion-map, $value);
	}
  
	@return 90deg - $value;
  }