You are here

protected function ResponsiveTrait::buildBreakpoints in Bootstrap Styles 1.0.x

Add the breakpoints classes to the build classes.

Parameters

array $classes: An associative array containing build classes.

array $storage: An associative array containing the form storage.

array $fields: The array of field names.

2 calls to ResponsiveTrait::buildBreakpoints()
BackgroundColor::build in src/Plugin/BootstrapStyles/Style/BackgroundColor.php
TextColor::build in src/Plugin/BootstrapStyles/Style/TextColor.php

File

src/ResponsiveTrait.php, line 381

Class

ResponsiveTrait
A Trait for responsive methods.

Namespace

Drupal\bootstrap_styles

Code

protected function buildBreakpoints(array &$classes, array $storage, array $fields) {

  // Loop through the fields.
  foreach ($fields as $field_name) {

    // Loop through the breakpoints.
    foreach ($this
      ->getBreakpointsKeys() as $breakpoint) {
      if (isset($storage[$field_name . '_' . $breakpoint]['class'])) {
        $classes[] = $storage[$field_name . '_' . $breakpoint]['class'];
      }
    }
  }
}