@use "sass:map";
@use "../variables/default" as vd;
@use "../functions/helper" as fh;
@use "../functions/theme" as ft;
@use "../mixins/common" as mc;
@use "./gen-mixins/image" as gi;

/*
 * 已发布的旧工具类集中保留在此，仅由独立兼容入口使用。
 * 不加载 theme、reset 或当前工具类；CSS Variables 由调用方提供。
 */
$color: ft.themefix(border-color-default);
$image-options: (unit: vd.$unit, scale: vd.$scale, prefix: vd.$prefix);
$image-size-list: 256, 150, 128, 100, 96, 64, 56, 40, 32, 24;

/**
 * @deprecated 使用 g-f-1。
 */
#{vd.$computed-prefix}col {
	flex: 1;
}

/**
 * @deprecated 使用 g-f-2。
 */
#{vd.$computed-prefix}col-2 {
	flex: 2;
}

/**
 * @deprecated 使用 g-f-1/1。
 */
#{vd.$computed-prefix}1of1 {
	flex: 0 0 100%;
}

/*
 * @deprecated 使用 g-f-{part}/{total}；仅保留 Sass 原有的有效分数。
 */
@for $total from 2 through 5 {
	@for $part from 1 through $total - 1 {
		#{vd.$computed-prefix}#{$part}of#{$total} {
			flex: 0 0 fh.percentw($part, $total);
		}
	}
}

/*
 * @deprecated 使用 g-fwr-w、g-fwr-wr、g-fwr-n。
 */
@each $suffix, $value in (w: wrap, wr: wrap-reverse, n: nowrap) {
	#{vd.$computed-prefix}fw-#{$suffix} {
		flex-wrap: $value;
	}
}

/*
 * @deprecated 使用 g-fl-{part}/12。
 */
@for $part from 1 through 12 {
	#{vd.$computed-prefix}fw-#{$part} {
		float: left;
		width: fh.percentw($part, 12);
	}
}

/*
 * @deprecated 使用 g-fl-row。
 */
#{vd.$computed-prefix}row::before,
#{vd.$computed-prefix}row::after {
	display: table;
	content: " ";
}

#{vd.$computed-prefix}row::after {
	clear: both;
}

#{vd.$computed-prefix}row {
	padding: 0;
	margin: 0;
}

/*
 * @deprecated 使用 g-bd、g-bdt、g-bdr、g-bdb、g-bdl。
 */
#{vd.$computed-prefix}b {
	@include mc.common-border-1px('', $color);
}
#{vd.$computed-prefix}bb {
	@include mc.common-border-1px(bottom, $color);
}
#{vd.$computed-prefix}bl {
	@include mc.common-border-1px(left, $color);
}
#{vd.$computed-prefix}bt {
	@include mc.common-border-1px(top, $color);
}
#{vd.$computed-prefix}br {
	@include mc.common-border-1px(right, $color);
}

/*
 * @deprecated 使用 g-bsh、g-bsh-t。
 */
#{vd.$computed-prefix}bs {
	box-shadow: ft.themefix(border-shadow-default) !important;
}

#{vd.$computed-prefix}bs-t {
	box-shadow: ft.themefix(border-shadow-default-top) !important;
}

/**
 * @deprecated 整组废弃，无替代规则。
 */
#{vd.$computed-prefix}lh-two {
	height: calc(ft.themefix(line-height-limit) * 2);
	line-height: ft.themefix(line-height-limit);
}

/**
 * @deprecated 整组废弃，无替代规则。
 */
#{vd.$computed-prefix}lh-one {
	height: ft.themefix(line-height-limit);
	line-height: ft.themefix(line-height-limit);
}

/**
 * @deprecated 使用 g-h-full。
 */
#{vd.$computed-prefix}height-full {
	height: 100%;
}

/**
 * @deprecated 使用 g-w-full。
 */
#{vd.$computed-prefix}width-full {
	width: 100%;
}

/*
 * @deprecated 使用 g-d-n、g-d-b、g-d-i、g-d-ib。
 */
#{vd.$computed-prefix}dp-n {
	display: none !important;
}

#{vd.$computed-prefix}dp-b {
	display: block !important;
}

#{vd.$computed-prefix}dp-i {
	display: inline !important;
}

#{vd.$computed-prefix}dp-ib {
	display: inline-block !important;
}

/*
 * @deprecated 使用 g-divider。
 */
#{vd.$computed-prefix}divide {
	position: relative;
	display: inline-block;
	width: fh.unitfix(1);
	height: fh.unitfix(12);
	margin: 0 fh.unitfix(8);
	vertical-align: middle;
	background: #ccc;
	box-sizing: border-box;
}

/*
 * @deprecated 使用 g-bsz-bb。
 */
#{vd.$computed-prefix}bs-bb {
	box-sizing: border-box;
}

/*
 * @deprecated 使用 g-ta-c、g-ta-l、g-ta-r。
 */
#{vd.$computed-prefix}tc {
	text-align: center !important;
}

#{vd.$computed-prefix}tl {
	text-align: left !important;
}

#{vd.$computed-prefix}tr {
	text-align: right !important;
}

/*
 * @deprecated 使用 g-tdl-lt、g-tdl-ul。
 */
#{vd.$computed-prefix}td-lh {
	text-decoration: line-through !important;
}

#{vd.$computed-prefix}td-ul {
	text-decoration: underline !important;
}

/*
 * @deprecated 使用 g-ws-nw；g-line-nowrap 继续公开使用。
 */
#{vd.$computed-prefix}nowrap {
	white-space: nowrap !important;
}

/*
 * @deprecated 使用 g-line-wrap。
 */
#{vd.$computed-prefix}break {
	word-break: break-all;
	overflow-wrap: break-word;
	text-wrap: wrap;
}

/**
 * @deprecated 使用 g-line-1。
 */
#{vd.$computed-prefix}line-one {
	@include mc.common-text-line(1);
}

/**
 * @deprecated 使用 g-line-2。
 */
#{vd.$computed-prefix}line-two {
	@include mc.common-text-line(2);
}

/*
 * @deprecated 使用 g-image-*、g-image-circle-*、g-image-radius-*。
 */
@include gi.image-size($image-size-list, map.merge($image-options, (name: img)));
@include gi.image-size($image-size-list, map.merge($image-options, (name: imgc, mode: 'circle')));
@include gi.image-size($image-size-list, map.merge($image-options, (name: imgr, mode: 'radius')));
