media query not parsed correctly
Status: Inactive
Brought to you by:
floele
The following media query is transformed into the following result:
@media (min-width: 600px) {
.sample {
display: block;
}
}
Result:
@media min-width 600px {
.sample {
display:block;
}
}
The media query is broken. I had a look in to the source code and think that the colon and the braces aren't handled inside the media query.
case 'at':
if(csstidy::is_token($string,$i))
{
if($string{$i} == '/' && @$string{$i+1} == '*')
{
$this->status = 'ic'; ++$i;
$this->from = 'at';
}
elseif($string{$i} == '{')
{
$this->status = 'is';
$this->_add_token(AT_START, $this->at);
}
elseif($string{$i} == ',')
{
$this->at = trim($this->at).',';
}
elseif($string{$i} == '\\')
{
$this->at .= $this->_unicode($string,$i);
}
}
They are just ignored and are not part of the result.
Here are my options:
$options = array(
'remove_bslash' => false,
'compress_colors' => false,
'compress_font-weight' => false,
'lowercase_s' => false,
'optimise_shorthands' => 1,
'remove_last_;' => false,
'case_properties' => 1,
'sort_properties' => false,
'sort_selectors' => false,
'merge_selectors' => 2,
'discard_invalid_properties' => false,
'css_level' => 'CSS2.1',
'preserve_css' => true,
'timestamp' => false,
'template' => 'default'
);
Version 1.3
Maybe this will help to someone:
case 'at':
if(csstidy::is_token($string,$i))
{
if($string{$i} == '/' && @$string{$i+1} == '*')
{
$this->status = 'ic'; ++$i;
$this->from = 'at';
}
elseif($string{$i} == '{')
{
$this->status = 'is';
$this->_add_token(AT_START, $this->at);
}
elseif($string{$i} == ',')
{
$this->at = trim($this->at).',';
}
elseif($string{$i} == '\')
{
$this->at .= $this->_unicode($string,$i);
}
#Change: accept media queries
elseif($string{$i} == '(' || $string{$i} == ')' || $string{$i} == ':')
{
$this->at .= $string{$i};
}
}