one property use two times for different browsers

5 views
Skip to first unread message

gawan

unread,
Jan 22, 2010, 5:48:54 AM1/22/10
to xCSS - OO CSS framework
Hi,
first of all thank you for your excellent framework! But I have this
problem:

h3 {
background-image: -moz-linear-gradient(top, red, blue);
background-image: -webkit-gradient(linear, left top, left bottom,
from(red), to(blue));
}

but result is only

h3 {
background-image: -webkit-gradient(linear, left top, left bottom, from
(red), to(blue));
}

Could you fix this bug? May be if value of property starts with "-" or
"-moz|-webkit|-o-," then don't reduce lines...

gawan

unread,
Jan 22, 2010, 6:14:47 AM1/22/10
to xCSS - OO CSS framework
also this:

div {
/* IE */
filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=5,
OffY=5, Color='gray');
/* slightly different syntax for IE8 */
-ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=5,
OffY=5, Color='gray')";
}

is reduced to:

div {
filter: progid;
-ms-filter: "progid;
}

:-(

Anton Pawlik

unread,
Jan 22, 2010, 7:09:41 AM1/22/10
to xCSS - OO CSS framework
Hey thank you for using it :D! The first problem that you are facing
is actually a feature of xCSS :), it wont let you use the same
property two or more times inside the object. The other problem that
you have is caused by the property value, it contains ':' and '=' and
it's only valid for content property to have this characters. That's
why I've added the hookfiles array inside the config.php, you can keep
all the nasty invalid CSS stuff there. And i don't think I'm going to
fix this since this is invalid CSS anyway.

gawan

unread,
Jan 25, 2010, 2:34:48 AM1/25/10
to xCSS - OO CSS framework

On Jan 22, 1:09 pm, Anton Pawlik <anton.paw...@googlemail.com> wrote:
> The first problem that you are facing
> is actually a feature of xCSS :), it wont let you use the same
> property two or more times inside the object.

yes, I understand, but in this situation it is correct css, so could
you change or rebuild this feature? ;)
Or can you give me tip how can I use it?

Anton Pawlik

unread,
Jan 25, 2010, 4:11:11 AM1/25/10
to xc...@googlegroups.com
hey, ok i can provide a fix for you, but i wont change it in the public xCSS class, because its not correct css (w3c validation). Change the line 783 "$this->css[$keystr][trim($codeval[0])] = trim($codeval[1]);" to this:


                            $prop = trim($codeval[0]);
                            if(isset($this->css[$keystr][$prop]))
                            {
                                $this->css[$keystr][$prop.': var_rule'] = trim($codeval[1]);                                
                            }
                            else
                            {
                                $this->css[$keystr][$prop] = trim($codeval[1]);                                
                            }

gawan

unread,
Jan 25, 2010, 6:22:40 AM1/25/10
to xCSS - OO CSS framework
Excellent :) Thank you very much. It is fixed.
Best would be this feature add into config.php
(e.g. $config['css_extensions'])
Is it possible?

Anton Pawlik

unread,
Jan 25, 2010, 8:48:40 AM1/25/10
to xc...@googlegroups.com
sure its possible but i don't want to confuse beginners even more :)

2010/1/25 gawan <marek....@gmail.com>

gawan

unread,
Jan 25, 2010, 9:20:25 AM1/25/10
to xCSS - OO CSS framework
You can do it such as undocumented feature ;-)
it is also not very good if I need to do this hack with every new
release.
m.

Anton Pawlik

unread,
Jan 25, 2010, 10:45:22 AM1/25/10
to xc...@googlegroups.com
okok :D

2010/1/25 gawan <marek....@gmail.com>

gawan

unread,
Jan 26, 2010, 8:53:52 AM1/26/10
to xCSS - OO CSS framework
sorry I have one more problem with this hack, i use it for other page
and ....

source is:
.box h4 {
background-image: -moz-linear-gradient(top, #51A8DA, #368CCA);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from
(#51A8DA), to(#368CCA));
}

end result is:
.box h4 {
background-image: -moz-linear-gradient(top, #51A8DA, #368CCA);
background-image: var_rule: -webkit-gradient(linear, 0% 0%, 0% 100%,
from(#51A8DA), to(#368CCA));
}

there is "var_rule" in second row .... I absolutely don't understand
why, I copied xcss dir 2 times and result is same ....
is your hack correct in all cases?

thank you very much.

On Jan 25, 4:45 pm, Anton Pawlik <anton.paw...@googlemail.com> wrote:
> okok :D
>
> 2010/1/25 gawan <marek.smo...@gmail.com>

Anton Pawlik

unread,
Jan 26, 2010, 10:10:46 AM1/26/10
to xc...@googlegroups.com
yes this hack is very safe to use, i can't say why its not working for you. ive tested it with v1.0.1 and v1.0.0
Reply all
Reply to author
Forward
0 new messages