The placeholders of Stripe React elements come with a CSS property Opacity: 1
. Unfortunately, this property cannot be modified using the style object. However, other ::placeholder
CSS properties can be adjusted as needed.
Style Object:
const iframeStyles = {
base: {
color: "#276678", //$blue
fontSize: "30px",
lineHeight: "38px",
fontFamily: "Lato",
fontWeight: 400,
"::placeholder": {
color: "#C8D7DE", //$bluepastel
opacity: 0,
}
},
invalid: {
},
complete: {
}
};
Firefox inspection output:
https://i.sstatic.net/W7whL.png
I attempted to use !important
, but it did not work. The opacity property simply does not take effect. Are there any alternative methods to address this issue?