You are here

public static function HtmlFontSizeModifier::modification in Modifiers Pack 8

1 call to HtmlFontSizeModifier::modification()
HtmlFontSizeModifierTest::testModification in modules/modifiers_html_font_size/tests/src/Unit/HtmlFontSizeModifierTest.php
@covers ::modification

File

modules/modifiers_html_font_size/src/Plugin/modifiers/HtmlFontSizeModifier.php, line 22

Class

HtmlFontSizeModifier
Provides a Modifier to set the HTML font size on an element.

Namespace

Drupal\modifiers_html_font_size\Plugin\modifiers

Code

public static function modification($selector, array $config) {
  if (!empty($config['fonts_base_size'])) {
    $media = parent::getMediaQuery($config);
    $css[$media][$selector][] = 'font-size:' . $config['fonts_base_size'] . '!important';
    return new Modification($css);
  }
  return NULL;
}