@import "../common/mixin.scss";

@include b(divider) {
	background-color: $--color-border;
	position: relative;

	@include m(horizontal) {
		display: block;
		height: 1px;
		width: 100%;
		margin: 16px 0;
	}

	@include m(vertical) {
		display: inline-block;
		width: 1px;
		height: 1em;
		margin: 0 8px;
		vertical-align: middle;
		position: relative;
	}

	@include m(with-text) {
		display: table;
		background-color: transparent;
		white-space: nowrap;
		text-align: center;
		vertical-align: middle;
		&::before {
			position: relative;
			top: 50%;
			display: table-cell;
			width: 50%;
			border-top: 1px solid $--color-border;
			transform: translateY(50%);
			content: "";
		}
		&::after {
			position: relative;
			top: 50%;
			display: table-cell;
			width: 50%;
			border-top: 1px solid $--color-border;
			transform: translateY(50%);
			content: "";
		}
	}

	@include when(left) {
		&::before {
			width: 5%;
		}
		&::after {
			width: 95%;
		}
	}

	@include when(center) {
		&::before {
			width: 50%;
		}
		&::after {
			width: 50%;
		}
	}

	@include when(right) {
		&::before {
			width: 95%;
		}
		&::after {
			width: 5%;
		}
	}

	@include e(text) {
		display: inline-block;
		padding: 0 12px;
		font-weight: 500;
		color: $--color-text-primary;
		font-size: 14px;
	}

	@include when(shadow) {
		box-shadow: $--box-shadow-border;
	}
}
