Change Braintree font text color

Is there a way to change the color of the placeholder text in a created field created by javascript in Braintree format? I do not see in it one of the parameters that you can pass to the constructor. Our design is on a dark background and placeholder values ​​are not visible.

+4
source share
1 answer

Full disclosure: I work at Braintree. If you have further questions, feel free to contact support .

There is a way to change the color of the placeholder, which is not documented, since it is not a 100% fix.

However, in your JS you can do the following:

braintree.hostedFields.create({
  client: clientInstance,
  styles: {
    'input': {
      'font-size': '14pt'
    },
    'input.invalid': {
      'color': 'red'
    },
    'input.valid': {
      'color': 'green'
    },
    '::-webkit-input-placeholder': {
      'color': 'pink'
    }
     ':-moz-placeholder': {
       'color': 'pink'
    },
   '::-moz-placeholder': {
   'color': 'pink'
   },       
   ':-ms-input-placeholder': {
    'color': 'pink'
    }
},

100% - , , - , . , , .

+8

Source: https://habr.com/ru/post/1665656/


All Articles