@use '../../tools' as tools;

@mixin thinItalicComplete($font-prefix: $font-prefix) {
	@font-face {
		font-family: 'IBM Plex Serif';
		font-style: italic;
		font-weight: 100;
		src: local('IBM Plex Serif Thin Italic'), local('IBMPlexSerif-ThinItalic'), url('#{$font-prefix}/fonts/complete/woff2/IBMPlexSerif-ThinItalic.woff2') format('woff2'), url('#{$font-prefix}/fonts/complete/woff/IBMPlexSerif-ThinItalic.woff') format('woff');
	}
}

@mixin thinItalicSplit($font-prefix: $font-prefix, $unicode-ranges: $unicode-ranges) {
	@each $unicode-range in $unicode-ranges {
		@font-face {
			font-family: 'IBM Plex Serif';
			font-style: italic;
			font-weight: 100;
			src: local('IBM Plex Serif Thin Italic'), local('IBMPlexSerif-ThinItalic'), url('#{$font-prefix}/fonts/split/woff2/IBMPlexSerif-ThinItalic-#{tools.split-range($unicode-range)}.woff2') format('woff2');
			unicode-range: tools.get-range($unicode-range);
		}	}
}

@mixin all($font-prefix: $font-prefix, $unicode-ranges: $unicode-ranges) {
	@include thinItalicComplete($font-prefix);
	@include thinItalicSplit($font-prefix, $unicode-ranges);
}