You are here

public function TextColor::buildStyleFormElements in Bootstrap Styles 1.0.x

Overrides StylePluginBase::buildStyleFormElements

File

src/Plugin/BootstrapStyles/Style/TextColor.php, line 67

Class

TextColor
Class TextColor.

Namespace

Drupal\bootstrap_styles\Plugin\BootstrapStyles\Style

Code

public function buildStyleFormElements(array &$form, FormStateInterface $form_state, $storage) {
  $form['text_color'] = [
    '#type' => 'radios',
    '#options' => $this
      ->getStyleOptions('text_colors'),
    '#title' => $this
      ->t('Text Color'),
    '#default_value' => $storage['text_color']['class'] ?? NULL,
    '#validated' => TRUE,
    '#attributes' => [
      'class' => [
        'field-text-color',
        'bs_input-circles',
        'with-selected-gradient',
      ],
    ],
  ];

  // Responsive.
  $this
    ->createBreakpointsStyleFormFields($form, 'text_color', 'typography', $storage, 'text_colors');

  // Attach the Layout Builder form style for this plugin.
  $form['#attached']['library'][] = 'bootstrap_styles/plugin.text_color.layout_builder_form';
  return $form;
}