Сибиряк


Зарегистрирован: Sep 2002
Место проживания: Новосибирск
Публикаций: 1255
Статус:  |
http://www.webamoeba.co.uk/general..../dcss.htm&id=20
DCSS
My biggest qualm with CSS is its lack of dynamics. For example, if I want to create a page where I need to give a number of table cells one or more border lines, I have to create a new style for each possible combination - linetop, linebottom, etc...
If CSS was more dynamic, I could create one style, line(top, bottom, left, right). Where a passed variable = 1 do X.
Admittedly it is possible to set CSS values in a tag and not apply a style or id. That's not very elegant though, and in an industry where elegance and ensured stability are key why shouldn't we demand more from our CSS? If HTML3 is OK why create HTML4? - did that just sound distinctly like a Mazda advert - rhetorical questions.
Implementation
Exactly how this would be implemented, I can't say, but here's a suggestion:
somestyle([vars]) {
('style')
[(var { 'style' })]
}
Lets run through that quickly:
" Declare style name - somestyle
" Setup variables to be passed - ([vars])
" Start definition - {
" Create a standard style to always be applied, regardless of the variables - ('style')
" Where variable 'var' is true apply the following style - [(var { 'style' })]
" End definition - }
So my previously annoying problem with the lines becomes much simpler:
style='line(1000)' - for a top line
style='line(1100)' - for a top and bottom line
style='line(0110)' - for a bottom and left line
Considerations
If my basic description of DCSS was taken up, my main concerns would be; 1. is it dynamic enough - is passing simple 'on/off' values enough 2. is my method of passing the values the best - brackets and 0 and 1 combinations.
Perhaps 'on/off' is enough, some how I get the feeling that it wouldn't take long before someone else was complaining about the lack of dynamics in DCSS. But maybe just the introduction of DCSS would lead to a whole new thinking pattern for styles and set off a DCSS revolution.
As for using 0 and 1s its the best I can think of right now. Then again, if being restricted to a maximum of 24 variables isn't a problem, then each variable could be a single letter. Where the letter is passed in applying a style then it is considered 'true'. So my lines example becomes:
style='line(t)' - for a top line
style='line(tb)' - for a top and bottom line
style='line(bl)' - for a bottom and left line
I also mentioned my concern with the brackets, although I can't see any actual problems with using brackets maybe it would be better to stick to a dividing character, such as the # used when defining id's of specific tags e.g. td#menu. Maybe a similar character could be used, a '+' for example.
__________________
Международное брачное агенство в Сибири.
Сообщить модератору об этом сообщении | Предупреждение | IP: определен
|