MyIntervals / PHP-CSS-Parser

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS

Home Page:http://www.sabberworm.com/blog/2010/6/10/php-css-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for CSS Nesting

jonaskohl opened this issue · comments

Current browsers support the CSS Nesting Module (see spec). This package currently does not support it.

Given the input

.nesting {
  color: hotpink;

  > .is {
    color: rebeccapurple;

    > .awesome {
      color: deeppink;
    }
  }
}

the current output is

.nesting {
        color: hotpink;
        color: rebeccapurple;
        color: deeppink;
}

whereas it should remain unchanged or at least be transformed to something like this:

.nesting {
  color: hotpink;
}

.nesting > .is {
  color: rebeccapurple;
}

.nesting > .is > .awesome {
  color: deeppink;
}