Closed jparry67 closed 2 years ago
I realized this is already possible using the StripeElementsOptions instead of the StripeCardElementOptions.
@jparry67 Hi! I have the same problem, I can't solve it. Can you share your code?
@zak427zak sure! Here is my code:
export class CheckoutRoute implements OnInit {
cardOptions: StripeCardElementOptions = {
style: {
base: {
iconColor: '#666EE8',
color: '#000000',
fontWeight: '400',
fontFamily: "'Poppins', sans-serif",
'::placeholder': {
color: '#7B7B7B',
},
fontSize: '13.4px',
lineHeight: '32px',
},
},
};
elementsOptions: StripeElementsOptions = {
locale: 'en',
fonts: [
{
// integrate your font into stripe
cssSrc: 'https://fonts.googleapis.com/css?family=Poppins:400,500',
}
]
};
And then in my html I have this:
<ngx-stripe-card-group class="form-section" [elementsOptions]="elementsOptions">
<input class="card-input name-input" placeholder="Cardholder Name"/>
<ngx-stripe-card-number containerClass="card-input" [options]="cardOptions"></ngx-stripe-card-number>
<div class="input-row">
<ngx-stripe-card-expiry containerClass="card-input" [options]="cardOptions"></ngx-stripe-card-expiry>
<ngx-stripe-card-cvc containerClass="card-input" [options]="cardOptions"></ngx-stripe-card-cvc>
</div>
</ngx-stripe-card-group>
I have these stripe elements on a page where everything else is using Google Fonts, and it's frustrating when all the input fields around this one are almost identical but the font is slightly different.
Would it be possible to let the developer pass in a custom css url to import a font? something like this: