Skip to content

Commit 827a1b2

Browse files
committed
fix(form_field): add color input on helper and label
1 parent 6640e16 commit 827a1b2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

libs/flowbite-angular/form/src/helper/helper.directive.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export class Helper {
2828
readonly config = injectFlowbiteHelperConfig();
2929
readonly formFieldState = injectFlowbiteFormFieldState();
3030

31+
/**
32+
* @see {@link injectFlowbiteHelperConfig}
33+
*/
34+
readonly color = input(this.formFieldState().color());
35+
3136
/**
3237
* @see {@link injectFlowbiteHelperConfig}
3338
*/
@@ -41,7 +46,7 @@ export class Helper {
4146
root: twMerge(
4247
mergedTheme.host.base,
4348
mergedTheme.host.transition,
44-
colorToTheme(mergedTheme.host.color, this.formFieldState().color())
49+
colorToTheme(mergedTheme.host.color, this.state.color())
4550
),
4651
},
4752
};

libs/flowbite-angular/form/src/label/label.directive.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export class Label {
2828
readonly config = injectFlowbiteLabelConfig();
2929
readonly formFieldState = injectFlowbiteFormFieldState();
3030

31+
/**
32+
* @see {@link injectFlowbiteLabelConfig}
33+
*/
34+
readonly color = input(this.formFieldState().color());
35+
3136
/**
3237
* @see {@link injectFlowbiteLabelConfig}
3338
*/
@@ -41,7 +46,7 @@ export class Label {
4146
root: twMerge(
4247
mergedTheme.host.base,
4348
mergedTheme.host.transition,
44-
colorToTheme(mergedTheme.host.color, this.formFieldState().color()),
49+
colorToTheme(mergedTheme.host.color, this.state.color()),
4550
mergedTheme.host.mode[this.formFieldState().mode()]
4651
),
4752
},

0 commit comments

Comments
 (0)