@use './styles/icons/utils';

@keyframes codicon-spin {
	100% {
		transform: rotate(360deg);
	}
}

.icon--sync.icon-modifier--spin,
.icon--loading.icon-modifier--spin,
.icon--gear.icon-modifier--spin {
	/* Use steps to throttle FPS to reduce CPU usage */
	animation: codicon-spin 1.5s steps(30) infinite;
}

.icon-modifier--disabled {
	opacity: 0.5;
}

.icon-modifier--hidden {
	opacity: 0;
}

.icon--loading {
	/* Use steps to throttle FPS to reduce CPU usage */
	animation: codicon-spin 1.5s steps(30) infinite;

	/* custom speed & easing for loading icon */
	animation-duration: 1s !important;
	animation-timing-function: var(--gl-ease-spin) !important;

	&::before {
		@include utils.codicon('loading');

		font-family: codicon;
	}
}

.icon--branch {
	&::before {
		@include utils.codicon('git-branch');

		position: relative;
		top: 2px;
		margin: 0 3px;
		font-family: codicon;
	}
}

.icon--commit {
	&::before {
		@include utils.codicon('git-commit');

		position: relative;
		top: 2px;
		margin: 0 1px 0 3px;
		font-family: codicon;
	}
}

.icon--paused {
	&::before {
		@include utils.codicon('debug-pause');

		position: relative;
		top: 2px;
		margin: 0 3px;
		font-family: codicon;
	}
}

.icon--warning {
	&::before {
		@include utils.codicon('alert');

		position: relative;
		top: 2px;
		margin: 0 3px;
		font-family: codicon;
	}
}

.codicon[class*='codicon-'] {
	display: inline-block;
	font: normal normal normal 16px/1 codicon;
	line-height: 2rem;
	vertical-align: middle;
	text-align: center;
	letter-spacing: normal;
	text-decoration: none;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@include utils.all-codicons;
