Support styling Hosted Fields

Created on 5 October 2017, about 8 years ago
Updated 28 September 2025, 10 days ago

Previously themes were able to alter the styles of the Hosted Fields like this:

<?php
function hook_js_settings_alter(&$settings) {
  $settings['commerceBraintree']['hostedFields']['styles'] = [
    'input' => [
      'font-size' => '20px'
    ]
  ];
}
?>

This is no longer possible since they are initialized like this:

braintree.hostedFields.create({
  client: clientInstance,
  fields: settings.hostedFields
}, ...

In a early version the initialization looked like this:

braintree.setup(settings.clientToken, 'custom', {
  id: this.formId,
  hostedFields: settings.hostedFields,
  ...

How could we add support for this again? What was the reason for changing the initialization?

πŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland luksak

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024