edwardfxiao/react-inputs-validation

CSS style custom validation message

hgrbble1 opened this issue · 2 comments

How do you change the text color of the validation message and the border color from red to a different color?

in this case, you can only set the css rule to it directly, like

 .react-inputs-validation__msg___pxv8o.react-inputs-validation__error___2aXSp{
    color: blue;
}

if you are trying to make it work to a specific error message, I suggest you provide a className to the wrapper

// js
<Textbox
   ...
  classNameWrapper="errorBlueWrapper"
  ...
/>
/*css*/
.errorBlueWrapper  .react-inputs-validation__msg___pxv8o react-inputs-validation__error___2aXSp{
    color: blue!important;
}

.errorBlueWrapper  input[type=number].react-inputs-validation__textbox__input___20hDL.react-inputs-validation__error___2aXSp, input[type=password].react-inputs-validation__textbox__input___20hDL.react-inputs-validation__error___2aXSp, input[type=phone].react-inputs-validation__textbox__input___20hDL.react-inputs-validation__error___2aXSp, input[type=text].react-inputs-validation__textbox__input___20hDL.react-inputs-validation__error___2aXSp{
  border:1px solid blue!important;
  color: blue!important;
}

note: the react-inputs-validation class name hash may have variation after each version update. So the save way to get it is by inspecting the element to locate the current classname

e.g
image

Thank you!