You are here

function _sassy_match_media_queries in Sassy 7

Extracts all media queries from an SCSS string and replace them with named placeholders.

Parameters

$data: A SCSS string.

Return value

An array of placeholders values, indexed by the placeholder token.

1 call to _sassy_match_media_queries()
sassy_parse in ./sassy.module
Parse a SCSS string and transform it into CSS.

File

./sassy.module, line 233
Handles compiling of .sass / .scss files.

Code

function _sassy_match_media_queries($data, $syntax) {
  $placeholders = array();
  preg_match_all('/@media\\s*(.+)\\s*\\{/', $data, $matches);
  foreach ($matches[1] as $key => $value) {
    $placeholders['sassy_media_query_' . $key] = $value;
  }
  return $placeholders;
}