Skip Menu |
 

This queue is for tickets about the CSS-LESSp CPAN distribution.

Report information
The Basics
Id: 67915
Status: open
Priority: 0/
Queue: CSS-LESSp

People
Owner: Nobody in particular
Requestors: RENEEB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.86
Fixed in: (no value)



Subject: [PATCH] support nested rules
Download (untitled) / with headers
text/plain 936b
There are nested rules in LESS[1], but CSS::LESSp does not support it, yet. This is a patch to support this: etecture@ubuntu:/usr/local/share/perl/5.10.1/CSS$ diff -u LESSp.pm.old LESSp.pm --- LESSp.pm.old 2011-05-03 01:11:15.623783012 -0700 +++ LESSp.pm 2011-05-03 01:13:39.355783003 -0700 @@ -75,8 +75,11 @@ my @prenames = $parent->{'name'} =~ /\,/ ? split(/\s*\,\s*/, $parent->{'name'}) : ($parent->{'name'}); my @postnames = (); for my $prename ( @prenames ) { - for my $name ( @names ) { - push @postnames, $prename.( $name =~ /^\:/ ? "" : " " ).$name; + for my $name ( @names ) { + my $space = $name =~ /^(?:&|:)/ ? '' : ' '; + $name =~ s/^&//; + + push @postnames, $prename . $space .$name; } } @names = @postnames; [1] http://lesscss.org/#docs
Subject: LESSp.pm.patch
Download LESSp.pm.patch
text/x-diff 795b
etecture@ubuntu:/usr/local/share/perl/5.10.1/CSS$ diff -u LESSp.pm.old LESSp.pm --- LESSp.pm.old 2011-05-03 01:11:15.623783012 -0700 +++ LESSp.pm 2011-05-03 01:13:39.355783003 -0700 @@ -75,8 +75,11 @@ my @prenames = $parent->{'name'} =~ /\,/ ? split(/\s*\,\s*/, $parent->{'name'}) : ($parent->{'name'}); my @postnames = (); for my $prename ( @prenames ) { - for my $name ( @names ) { - push @postnames, $prename.( $name =~ /^\:/ ? "" : " " ).$name; + for my $name ( @names ) { + my $space = $name =~ /^(?:&|:)/ ? '' : ' '; + $name =~ s/^&//; + + push @postnames, $prename . $space .$name; } } @names = @postnames;
Now I have created a test file...
Subject: nested-rules.css
#headline { color: #333333; } #headline .link { width: 300px; } #headline .link:hover { font-weight: bold; } #test { color: #000000; } #test ul { padding: 0; } #test ul.hallo { font-weight: bold; }
Subject: nested-rules.less
Download nested-rules.less
application/octet-stream 214b

Message body not shown because it is not plain text.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.