overrides: "styles" does not style labels or anything outside of the "input"
See original GitHub issueGeneral information
- SDK/Library version: 1.13.0
- Environment: sandbox
- Browser and OS: Chromum 69.0.3497.100 (Official Build) Arch Linux (64-bit)
Issue description
according to: https://developers.braintreepayments.com/guides/drop-in/customization/javascript/v3
I’m supposedly able to add a “styles” object to the create call in order to create some styles. the passed in object has absolutely no effect.
await DropIn.create({
authorization: tokenizationKey,
container: dropInContainer,
locale: 'en_US',
card: {
cardholderName: {
required: true
},
overrides: {
styles: {
label: {
width: '100%'
}
}
}
}
})
I tried copy and pasting what is in the guide:
braintree.dropin.create({
authorization: 'CLIENT_AUTHORIZATION',
container: '#dropin-container',
card: {
overrides: {
styles: {
input: {
color: 'blue',
'font-size': '18px'
},
'.number': {
'font-family': 'monospace'
// Custom web fonts are not supported. Only use system installed fonts.
},
'.invalid': {
color: 'red'
}
}
}
}
})
the input color did not turn blue, and the font did not change to monospace
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React-native: Override the style of an external component
If the component does not support any styling properties, there is no one true way to override its styles, since any additional props...
Read more >How to Override CSS Styles - W3docs
When an important rule is used on a style declaration, this declaration will override any other declarations. When two conflicting declarations with the...
Read more >5 Ways to Make Basic Style Changes to Your Marketo Forms
Here are 5 ways to add simple snippets of CSS code to give your forms some fresh style, along with how to add...
Read more >10 Most Common Bootstrap Mistakes That Developers Make
You can overwrite in your own stylesheet default bootstrap colors, styles, margins, paddings, everything. There is no need to touch the bootstrap.css ...
Read more >Forms - Bootstrap
Checkboxes and radio buttons support HTML-based form validation and provide concise, accessible labels. As such, our <input> s and <label> s are sibling ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I appreciate the feedback and we’ll take steps to improve the documentation.
We made a specific choice to use Hosted Fields (a separate iframe for each card input) instead of a single iframe so that CSS customization would be easier to accomplish. In the previous iteration of Drop-in, which was a single iframe, this was a frequently requested feature. There’s a limit to the kinds of css we allow to be injected into the Braintree hosted iframes, so having a single iframe wouldn’t allow for as much customization as the current implementation.
Again, we’ll take steps to improve the documentation around it. I can see why it was confusing.
Thanks for the help