Skip to content

Instantly share code, notes, and snippets.

@matthooks
Last active November 12, 2020 16:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthooks/03d7c741cd48789a140b1503193b0b6c to your computer and use it in GitHub Desktop.
Save matthooks/03d7c741cd48789a140b1503193b0b6c to your computer and use it in GitHub Desktop.
Stripe Elements + Typekit

See comment below:

@matthooks
Copy link
Author

matthooks commented Apr 6, 2018

Having trouble getting Stripe Elements to work with Typekit?

Step 1

typekit-1

Step 2

typekit-2

Step 3

typekit-3

Step 4

Now you can import the css file:

let stripe = Stripe('pk');
let elements = stripe.elements({
  fonts: [{
    cssSrc: 'https://use.typekit.net/your-kit-id-here.css'
  }]
})

let card = elements.create('card', {
  style: {
    base: {
      fontFamily: 'your-font-name'
    }
  }
})

@YvesRijckaert
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment