Skip Menu |
 

This queue is for tickets about the CSS CPAN distribution.

Report information
The Basics
Id: 68297
Status: new
Priority: 0/
Queue: CSS

People
Owner: Nobody in particular
Requestors: cheako [...] mikemestnik.net
Cc:
AdminCc:

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



From cheako [...] mikemestnik.net Wed May 18 19: 46:06 2011
MIME-Version: 1.0
X-Spam-Status: No, score=-6.121 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_NEUTRAL=0.779] autolearn=ham
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <4DD45A33.3080204 [...] mikemestnik.net>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.121
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 105F0241AE5 for <cpan-bug+CSS [...] hipster.bestpractical.com>; Wed, 18 May 2011 19:46:06 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HXWjZPC10lQO for <cpan-bug+CSS [...] hipster.bestpractical.com>; Wed, 18 May 2011 19:46:04 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 2A6B5241AD7 for <bug-CSS [...] rt.cpan.org>; Wed, 18 May 2011 19:46:04 -0400 (EDT)
Received: (qmail 13237 invoked by uid 103); 18 May 2011 23:46:03 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 18 May 2011 23:46:03 -0000
Received: from hades.mikemestnik.net (HELO hades.mikemestnik.net) (184.106.158.151) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Wed, 18 May 2011 16:46:00 -0700
Received: from arcadia.mikemestnik.net (arcadia.mikemestnik.net [IPv6:2001:470:1f11:9e9:4261:86ff:fe4b:293b]) by hades.mikemestnik.net (Postfix) with ESMTPSA id 93F48B002F for <bug-CSS [...] rt.cpan.org>; Wed, 18 May 2011 23:45:57 +0000 (UTC)
Delivered-To: cpan-bug+CSS [...] hipster.bestpractical.com
Subject: Expanding the usefulness with better support for building CSS.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
Return-Path: <cheako [...] mikemestnik.net>
X-RT-Mail-Extension: css
X-Original-To: cpan-bug+CSS [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Wed, 18 May 2011 18:45:55 -0500
X-Spam-Level:
To: bug-CSS [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
X-Enigmail-Version: 1.1.2
From: Mike Mestnik <cheako [...] mikemestnik.net>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 1196
Download (untitled) / with headers
text/plain 1.1k
Thus far I have two code examples that seam to work, however CSS currently lacks a simple API for building Styles. Inline style: print CGI->img( { style=>CSS::Adaptor->new( )->output_properties( [ new CSS::Property ( { property => 'float', value => 'left' } ), new CSS::Property ( { property => 'width', value => ($inline?150:300).'px' } ) ] ), alt=>'Item Image', src=>'http://localhost/favicon.ico', } ); Building a .css: my $css = new CSS({'adaptor'=>'CSS::Adaptor::Pretty'}); print CGI->header(-type=>'text/css'); my $columns=CGI->param('columns')||1; $columns=1 if ($columns<1); my $inline=CGI->param('inline'); my $style = new CSS::Style; $style->add_selector(new CSS::Selector({name=>'div.outer_auction'})); $style->add_property(new CSS::Property ( { property => 'width', value => ($inline?100/$columns.'%':'100%') } )); $style->add_property(new CSS::Property ( { property => 'overflow', value => 'hidden' } )); push @{$css->{styles}}, $style; print $css->output(); Currently functions that don't work are sanitation and where available quoting/escaping. Currently a ';' in a property is just passed.


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.