[wp-trac] [WordPress Trac] #7766: Support Rounded corners in Opera
via SVG
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 19 03:07:39 GMT 2008
#7766: Support Rounded corners in Opera via SVG
----------------------------+-----------------------------------------------
Reporter: DD32 | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.8
Component: Administration | Version: 2.7
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
Opera has support for rounded corners on elements via SVG backgrounds:
http://my.opera.com/lugansk/blog/2008/07/20/rounded-corners-in-svg-making-
not-all-corners-round
It'd be nice to support them in Opera too. Here's a generic svg.php file
which i just knocked up:
{{{
<?php
/* SVG Rounded corners for Opera.
* Note: The radius needs to be twice that of -*-border-radius due to
rendering differences.
**/
header('Content-Type: image/svg+xml');
$radius = isset($_GET['radius']) ? $_GET['radius'] : '5';
$radius = 2 * (int)$radius;
$radiusunit = isset($_GET['unit']) ? $_GET['unit'] : 'px';
$back = isset($_GET['back']) ? $_GET['back'] : 'FFF';
$fill = isset($_GET['fill']) ? $_GET['fill'] : 'E4F2FD';
$stroke = isset($_GET['stroke']) ? $_GET['stroke'] : $fill;
echo '<','?xml version="1.0"?','>';
?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="100%" height="100%" fill="#<?php echo $back ?>"
/>
<rect x="0" y="0" width="100%" height="100%" rx="<?php echo $radius ?>"
ry="<?php echo $radius ?>" fill="#<?php echo $fill ?>" stroke="#<?php echo
$stroke ?>" stroke-width="1" />
</svg>
}}}
Can be used as such like this:
{{{
#login form .submit input {
background: url(../images/svg.php?radius=5);
}
}}}
I just started to implement it, But am running into some hurdles (Like a
border style being applied to input elements that i cant work out where
its coming from) and the need to either set these in their own stylesheet
(As you need to specifically state the colours) or in the colours
stylesheets which ends up a bit messy.
Thoughts? Is it worth implementing?
--
Ticket URL: <http://trac.wordpress.org/ticket/7766>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list