You are here

public static function ClipPathModifier::modification in Modifiers Pack 8

File

modules/modifiers_clip_path/src/Plugin/modifiers/ClipPathModifier.php, line 22

Class

ClipPathModifier
Provides a Modifier to use CSS Clip Path for an element.

Namespace

Drupal\modifiers_clip_path\Plugin\modifiers

Code

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