/* ================================= */
/* CSS for control sap.tnt/InfoLabel */
/* Horizon theme                     */
/* ================================= */

// ==========================================================================
// Variables and mixins
// ==========================================================================

@_sap_tnt_InfoLabel_LineHeightDisplayOnly: 1rem;
@_sap_tnt_InfoLabel_DisplayModeBorder: none;
@_sap_tnt_InfoLabel_DisplayModeBackground: #EAECEE;
@_sap_tnt_InfoLabel_DisplayModeColor: #354A5F;
@_sap_tnt_InfoLabel_BorderRadius: 0.25rem;
@_sap_tnt_InfoLabel_DisplayBorderRadius: 0.1875rem;
@_sap_tnt_InfoLabel_Height: 1.375rem;
@_sap_tnt_InfoLabel_HeightWithoutBorders: 1.375rem;
@_sap_tnt_InfoLabel_LineHeight: 1.375rem;
@_sap_tnt_InfoLabel_Text: none;
@_sap_tnt_InfoLabel_Padding: 0 0.375rem;
@_sap_tnt_InfoLabel_DisplayPadding: 0 0.25rem;
@_sap_tnt_InfoLabel_IconMargin: 0.25rem;
@_sap_tnt_InfoLabel_DisplayIconMargin: 0.125rem;
@_sap_tnt_InfoLabel_FontFamily: @sapFontSemiboldDuplexFamily;
@_sap_tnt_InfoLabel_FontSize: @sapFontSize;
@_sap_tnt_InfoLabel_DisplayFontSize: @sapFontSmallSize;
@_sap_tnt_InfoLabel_DisplayFontSizeIcon: 0.625rem;
@_sap_tnt_InfoLabel_NarrowPadding: @_sap_tnt_InfoLabel_Padding;
@_sap_tnt_InfoLabel_LetterSpacing: normal;

@_sap_tnt_InfoLabel_ColorsArray:
	@sapAvatar_1_Background @sapAvatar_1_TextColor,
	@sapAvatar_2_Background @sapAvatar_2_TextColor,
	@sapAvatar_3_Background @sapAvatar_3_TextColor,
	@sapAvatar_4_Background @sapAvatar_4_TextColor,
	@sapAvatar_5_Background @sapAvatar_5_TextColor,
	@sapAvatar_6_Background @sapAvatar_6_TextColor,
	@sapAvatar_7_Background @sapAvatar_7_TextColor,
	@sapAvatar_8_Background @sapAvatar_8_TextColor,
	@sapAvatar_9_Background @sapAvatar_9_TextColor,
	@sapAvatar_10_Background @sapAvatar_10_TextColor;

.create-classes-for-background-and-border-colors(backgroundColor, @_sap_tnt_InfoLabel_ColorsArray);

// Iterate over the InfoLabel ColorsArray and create separate class for each
// color named with the passed prefix and the number of the color
.create-classes-for-background-and-border-colors(@prefix, @list) {
	.iter(length(@list));
	.iter(@i) when (@i > 0) {
		.iter(@i - 1);

		@pair: extract(@list, @i);
		@backgroundColor: extract(@pair, 1);
		@textColor: extract(@pair, 2);

		.@{prefix}@{i} {
			background-color: @backgroundColor;

			.sapTntInfoLabelInner {
				color: @textColor;
			}
		}
	}
}