Open joejoseph00 opened 8 years ago
I modified the debug code slightly and retested:
Here's the output:
cat /www/debug2.txt
token->source=@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)
self::MEDIA=1
matches[self::MEDIA]=media
token->source=@media only screen and (max-width : 320px)
self::MEDIA=1
matches[self::MEDIA]=media
token->source=@media(max-width:374px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media (max-width:420px)
self::MEDIA=1
matches[self::MEDIA]=media
token->source=@media(max-width:461px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(max-width:480px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(max-width:540px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(max-width:767px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(min-width:768px) and (max-width:991px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(min-width:768px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(min-width:992px) and (max-width:1199px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media only screen and (min-width : 992px)
self::MEDIA=1
matches[self::MEDIA]=media
token->source=@media(min-width:1200px)
self::MEDIA=1
matches[self::MEDIA]=
token->source=@media(max-width:1024px)
self::MEDIA=1
matches[self::MEDIA]=
here's the debug code used:
diff --git a/tree/SassMediaNode.php b/tree/SassMediaNode.php
index 616f389..89195c9 100644
--- a/tree/SassMediaNode.php
+++ b/tree/SassMediaNode.php
@@ -52,6 +52,18 @@ class SassMediaNode extends SassNode
preg_match(self::MATCH, $token->source, $matches);
$this->token = $token;
+
+//if (!isset($matches[self::MEDIA])) {
+ $file = 'debug2.txt';
+ // Open the file to get existing content
+ $current = file_get_contents($file);
+ // Append a new person to the file
+ $current .= 'token->source=' . $token->source . "\n";
+ $current .= 'self::MEDIA=' . self::MEDIA . "\n";
+ $current .= 'matches[self::MEDIA]=' . $matches[self::MEDIA] . "\n";
+ // Write the contents back to the file
+ file_put_contents($file, $current);
+//}
$this->media = $matches[self::MEDIA];
}
had a look at the regex, seems to not like this:
@media(max-width:1234px)
possible hints for solution: https://www.drupal.org/node/1777712 and followup here:
Replacing @media (... with @media screen and (... has reduced the number of these notices that we see.
Compiling our scss gives us this message repeated for many of our @media during compile of .scss : `Undefined offset: 1 in SassMediaNode->__construct() (line 55 of core/sites/all/libraries/phpsass/tree/SassMediaNode.php).
Based on our .scss, we have @media used about 10 times. `
I debugged by writing to a text file the key variables involved at the line 55 and a few lines up before line 55 of phpsass/tree/SassMediaNode.php.
Here is the useful debug code that was used to generate the above message.