@use '../00-abstract/index' as *;

/* Usefull - Colors Palette */
////
/// @group UsefullClasses-Colors_Pallete
/// Usefull - Colors Palette

/*
	Note:
	- In order to improve the SASSDOC generated file, the loop was splited in 2!
*/

///
.background {
	@each $color, $variations in $osui-colors-extended {
		@each $type, $value in $variations {
			&-#{$color} {
				@if ($type == '') {
					& {
						// entity colour → inherit the :root role so apps can re-skin it
						background-color: var(--color-#{$color});
					}
				} @else {
					&-#{$type} {
						// no entity record → no role; read the token directly
						background-color: #{$value};
					}
				}
			}
		}
	}
}

///
.text {
	@each $color, $variations in $osui-colors-extended {
		@each $type, $value in $variations {
			&-#{$color} {
				@if ($type == '') {
					& {
						// entity colour → inherit the :root role so apps can re-skin it
						color: var(--color-#{$color});
					}
				} @else {
					&-#{$type} {
						// no entity record → no role; read the token directly
						color: #{$value};
					}
				}
			}
		}
	}
}
