@import "mixins/mixins";
@import "common/var";

@include b(badge) {
	position: relative;
	vertical-align: middle;
	display: inline-block;
	margin-right: 16px;
	@include e(content) {
		top: auto;
		background-color: $--badge-fill;
		border-radius: $--badge-radius;
		color: $--color-white;
		display: inline-block;
		font-size: $--badge-font-size;
		height: $--badge-size;
		line-height: $--badge-size;
		padding: 0 $--badge-padding;
		text-align: center;
		white-space: nowrap;
		border: 1px solid $--color-white;

		@include when(fixed) {
			position: absolute;
			top: 0;
			right: #{1 + $--badge-size / 2};
			transform: translateY(-50%) translateX(100%);

			@include when(dot) {
				right: 5px;
			}
		}

		@include when(dot) {
			height: 8px;
			width: 8px;
			padding: 0;
			right: 0;
			border-radius: 50%;
		}

		@include status(success) {
			background-color: #63C532;
		}

		@include status(error) {
			background-color: #F56C6C;
		}

		@include status(default) {
			background-color: #D9D9D9;
		}

		@include status(processing) {
			position: relative;
			background-color: #33A9F9;
			&:after {
				position: absolute;
				top: -3px;
				left: -3px;
				width: 100%;
				height: 100%;
				border-radius: 50%;
				border: 3px solid rgba(51,169,249,0.13);
				content: '';
			}
		}

		@include status(warning) {
			background-color: #FAAD14;
		}
	}
}
