To add a contextual background color belonging the same family as the transaction state's text color, add the -hasBg class to the element.
Add disabled states to the element with the -isDisabled class. Combined the -isDisabled class to the -hasBg class to have a disabled background variant.
<div class="sds-transactionState -processing">
<div class="sds-icon sds-icon-inprogress" aria-hidden="true"></div>
<div class="sds-transactionState__text">En cours</div>
</div>
<div class="{{ namespace }}transactionState{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}">
<div class="{{ namespace }}icon {{ namespace }}{{ icon }}" aria-hidden="true"></div>
<div class="{{ namespace }}transactionState__text">{{ text }}</div>
{% if infoDot %}
{% render "@info-dot--small",{
"data-placement": "auto",
"title": false,
"text": "Vous n’avez pas les droits de signature pour cette transactions à cause de {raison}"
},true %}
{% endif %}
</div>
/* variables specific to current element */
$element-specific-variables: "";
.#{$namespace}transactionState {
/* Save root element context for easy access if nesting is needed */
$self: &;
/* properties of current element + media queries */
@include spacer-component-inline("sm");
display: inline-flex;
align-items: center;
white-space: nowrap;
/* Pseudo Elements */
&::before {
}
&::after {
}
/*
Include elements that are linked to the current element but have to reside at the root level of the stylesheet
(e.g: keyframes)
*/
@at-root {
}
/* children - write selector in full in comments in order to facilitate search */
// transactionState__text
&__text {
// follows same logic as parent
font-weight: map-deep-get($token-font-weight-map, "semi-bold");
}
/* modifiers */
// transactionState -processing
&.-processing {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-warning-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-warning-10");
}
}
// transactionState -closed
&.-closed {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-primary-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-primary-10");
}
}
// transactionState -paid
&.-paid {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-success-contrast");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-success-10");
}
}
// transactionState -rejected
&.-rejected {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-danger-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-danger-10");
}
}
// transactionState -cancelled
&.-cancelled {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-danger-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-danger-10");
}
}
&.-crossValidation {
@include custom-prop-fallback("color", "sys-color-text-status-warning-contrast");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-warning-10");
}
}
&.-active {
@include custom-prop-fallback("color", "sys-color-text-status-success-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-success-10");
}
}
&.-highlight {
@include custom-prop-fallback("color", "sys-color-text-highlight-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-highlight-10");
}
}
&.-textHelper {
@extend %textHelper;
.#{$namespace}icon {
&::before {
font-size: 1.25em;
}
}
}
&.-hasBg {
@include spacer-component-inset-horiz-greater("xs", "sm");
border-radius: map-deep-get($token-radius-map, "8");
}
&.-isDisabled {
@include custom-prop-fallback("color", "sys-color-background-neutral-120");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-neutral-10");
}
}
/* random parent element */
/*
*
* Syntax : .randomParentElt & {}
*
*/
/* Pseudo Classes */
&:hover {
@media (hover: hover) {
}
}
&:focus {
}
&:active {
}
&:focus,
&:active {
}
}