Extending objects

7 views
Skip to first unread message

pawel.dubiel

unread,
Mar 8, 2010, 1:37:12 PM3/8/10
to xCSS - OO CSS framework
It's really great extension, really appreciate it.

Is it possible to have construction like this below.

.mod { }
.cleanBox extends .mod { }
.articleBox extends .cleanBox { }

and after that the articleBox should contains attributes from ".mod"
and those added and overwritten in '.cleanBox'

or I have to write.

.mod {}
.cleanBox {}
.articleBox extends .mod & .cleanBox {}

The first construction has some advantages over second, because in
the second example it is not possible to create .cleanBox object with
attributes from .mod


Cheers,
Pawel Dubiel

Anton Pawlik

unread,
Mar 8, 2010, 1:43:33 PM3/8/10
to xc...@googlegroups.com
hey thank you, both ways are supported and possible. if you like to try it out, use the onlinecompiler

http://xcss.antpaw.org/onlinecompiler/

.mod { asdf:asdf; }
.cleanBox extends .mod { blub:foo; }
.articleBox extends .cleanBox { foo: blub; }

pawel.dubiel

unread,
Mar 8, 2010, 3:48:34 PM3/8/10
to xCSS - OO CSS framework
Hi,

Thanks for the response.

I've asked this question beasue I had a few problems with my xcss code
and after all I think i found a minor bug in the xcss.

It looks like that code doesn't compile correctly ( endup with
"cleanBoxExtendedExtendedExtended h1" }

.mod {
self {
margin: 10px;
}

h1 {
font-size:40px;
}
}

.cleanBox extends .mod {
h1 {
font-size:60px;
}
}

.cleanBoxExtended extends .cleanBox {

}

.articleBox extends .cleanBox {

}


However when the name of the "cleanBoxExtended" is changed to
XXXXXcleanBoxExtended everything works fine.

Cheers,
Pawel

Anton Pawlik

unread,
Mar 8, 2010, 4:08:06 PM3/8/10
to xc...@googlegroups.com
Yes thats a known bug. I will try to provide a fix. currently rewriting it from scratch. some features made the code really complicated and they arent used at all. now i have a much better understanding on how it should work.
Reply all
Reply to author
Forward
0 new messages