How do i add a background image to a imput submit button in my module? So i have a input submit button that needs an image.

I've been looking at the module styling documentation where it says i can attach the styling to a render array of a block plugin. What does this mean and how do i do this? I'll include the trimmed down code where i want to include this styling.

LoginBlock.php:

class LoginBlock extends BlockBase implements ContainerFactoryPluginInterface {

  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container-&gt;get('plugin.manager.pixelpin_openid_connect_client.processor'),
      $container-&gt;get('form_builder')
    );
  }


  public function build() {
    return $this-&gt;formBuilder-&gt;getForm('Drupal\pixelpin_openid_connect\Form\LoginForm');
  }

}


LoginForm.php:

class LoginForm extends FormBase implements ContainerInjectionInterface {

  public function buildForm(array $form, FormStateInterface $form_state) {

        //submit button that i want to add styling too

          $value = 'Log in Using PixelPin';
          $label = 'Log in Using PixelPin';

          $form['pixelpin_openid_connect_client_pixelpin_login'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; t($value, array(
              '@client_title' =&gt; $client['label'],
            )),
            '#name' =&gt; $client_id,
            '#prefix' =&gt; '&lt;div&gt;',
            '#suffix' =&gt; '&lt;/div&gt;',
          );      
    }
    return $form;
  }

  public function submitForm(array &amp;$form, FormStateInterface $form_state) {
    //code
  }

}


pixelpin_openid_connect.libraries.yml:

pixelpin_logo:
  version: 1.x
  css:
    theme:
      css/style.css: {}


style.css:

#edit-pixelpin-openid-connect-client-enable-login {
  background: #f0f0f0 url(/ppicon.png) no-repeat center;
  cursor: pointer;
  height: 26px;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
  padding: 0;
  text-indent: -9999px;
  direction: ltr;
  width: 34px;
}
You can attach it to any render array; the submit button itself seems as good as any:

$form['pixelpin_openid_connect_client_pixelpin_login'] = [
  ...
  '#attached' =&gt; [
    'library' =&gt; [
      'pixelpin_openid_connect/pixelpin_logo',
    ],
  ],
  ...
];