Overwriting class names

4 views
Skip to first unread message

timk...@gmail.com

unread,
Jan 7, 2010, 2:46:35 PM1/7/10
to xCSS - OO CSS framework
I was surprised by this result:

in my source I have:
.classname {
color: blue;
}
.classname {
width: 300px
}

I expected to have the same result in my generated code, but instead I
got:
.classname {
width: 300px;
}
.classname {
width: 300px;
}

Seems odd to me. So you can never repeat a classname or it will get
overwritten?
Also I noticed this only happens if its in the same source file, if
you split them up between source files, then the generated is as I
expect.

Anton Pawlik

unread,
Jan 8, 2010, 4:36:39 AM1/8/10
to xc...@googlegroups.com
yep thats right. it helps you to keep the overhead small.

timk...@gmail.com

unread,
Jan 8, 2010, 4:28:48 PM1/8/10
to xCSS - OO CSS framework
Ok, thanks. Just wanted to make sure that was the expected result.

Kirik

unread,
Feb 18, 2010, 3:48:46 PM2/18/10
to xCSS - OO CSS framework
If you want to fix it just change 412 line ( $this->parts[$keystr] =
$codestr; ) to:

if(isset($this->parts[$keystr]))
{
$this->parts[$keystr] .= $codestr;
}
else
{
$this->parts[$keystr] = $codestr;
}

Reply all
Reply to author
Forward
0 new messages