Skip to content

Commit f8302b7

Browse files
authored
feat(text): support state colors
For consistency with other elements like form/button/label, etc. this PR adds the states info, success, warning, error to the text element.
1 parent bdf6e55 commit f8302b7

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/definitions/elements/text.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ each(@colors, {
4141
}
4242
})
4343

44+
& when (@variationTextStates) {
45+
each(@textStates, {
46+
@state: replace(@key, '@', '');
47+
@c: @textStates[@@state][color];
48+
49+
span.ui.@{state}.text {
50+
color: @c;
51+
}
52+
})
53+
}
54+
4455
& when (@variationTextDisabled) {
4556
span.ui.disabled.text {
4657
opacity: @disabledOpacity;

src/themes/default/globals/colors.less

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,3 +598,18 @@
598598
transparentColor: @transparentFormWarningColor;
599599
};
600600
}
601+
602+
@textStates: {
603+
@error: {
604+
color: @negativeColor;
605+
};
606+
@info: {
607+
color: @infoColor;
608+
};
609+
@success: {
610+
color: @positiveColor;
611+
};
612+
@warning: {
613+
color: @warningColor;
614+
};
615+
}

src/themes/default/globals/variation.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
/* Text */
208208
@variationTextInverted: true;
209209
@variationTextDisabled: true;
210+
@variationTextStates: true;
210211
@variationTextSizes: @variationAllSizes;
211212

212213

0 commit comments

Comments
 (0)