5 ms·
The LISPers here around will miss DSSSL for sure ... Me, I can't get over the point that CSS introduced a whole new syntax for item/values when HTML/SGML attri
by tannhaeuser 9y ago
The LISPers here around will miss DSSSL for sure ...
Me, I can't get over the point that CSS introduced a whole new syntax for item/values when HTML/SGML attributes were exactly designed for presentational properties. The idea/dogma that content goes into HTML and presentation into CSS, with completely separate syntax, didn't make any more sense back then as it does now:
> "Well, you get to learn this language to write your document, and then you get to learn that language for actually making your document look like you want it to."
- tarikjn 9y agoI am not sure I understand your point, how do you expect to be able to apply a style across multiple elements in a HTML document using attributes of existing elements? Nevertheless you'd have to define selectors or use classes, even XPATH had to come along for XML. Then you would also have to define property names and value. And you pretty much invented CSS. To apply it by classification, it has to be declared independent from your document tree, then you might as well separate it.
- saghm 9y agoFrom the example of FOSI in the article, it looks like the SGML elements aren't directly contained within the elements they style but refer them them from attributes (gi="h1", gi="h2", etc.), which is actually more similar in functionality to having external CSS stylesheets than inline CSS (which is what I think you're referring to).
- tarikjn 9y agoYes I saw this and though you might be referring to this, but it's still roughly the same, by defining these attribute names and selectors, you are still defining a language, you don't save much to learn. There is not much else to the CSS language.
- saghm 9y agoI think that tannhaeuser was just stating a preference that we use the same syntax for both the content (HTML) and the style markup (FOSI vs. CSS)
- tannhaeuser 9y agoFWIW, SGML also has LINKTYPEs (in addition to DOCTYPEs) for declaring presentation properties using normal attribute declaration syntax. A LINKTYPE can contain a state automaton assigning link attribute values to content elements and for transitioning to other states, but, unlike CSS, doesn't use regular patterns. This system makes sense for print, where a standard task is to assign different horizontal margins on even and odd pages. Using SGML LINK, this can be implemented by declaring two states transitioning to one another over page elements. A regular expression pattern language like CSS, OTOH, can't express the necesssary logic, hence CSS has a large number of extra predicates.
- Sharlin 9y agoWell, if CSS actually supported full regular expressions in selectors, even/odd wouldn't need custom predicates.
- tannhaeuser 9y agoYes, but only if grouping of subexpressions or non-terminals in grammar productions are allowed (they aren't in CSS). To elaborate, the problem at hand is to assign different properties to the even and odd elements, resp., of a sequence using just the sequence, alternation, and Kleene star operators in two rules. For example, the rules for the first few items (as) are as follows: even -> a a | a a a a | .. odd -> a | a a a | .. A solution using grouping of subexpressions/non-terminal symbols in grammar rules: even -> ( a a )* odd -> even a
- marcosdumay 9y agoThat's a full logic language (like prolog) for selecting things. It's very easy to mess up a prolog program and destroy its performance, so it's not a good thing to have on a web standard. Maybe something more functional instead of logic would be better.
- tannhaeuser 9y ago
- inopinatus 9y agoI sure do miss DSSSL, I taught myself Scheme especially to use it. But that's how I also recognized it would never be huge: learning curve too steep. Nevertheless I don't think it's wrong to have a separate styling language. HTML already makes it easy to wobble off the tightrope we walk between content and layout.
- keymone 9y agotechnically if we wrap each css rule in a set of parens it is already 99% clojure syntax (or whichever other lisps have curly braces for maps). i wish LISPy languages caught on, we'd never needed things like SASS/LESS.
- olavk 9y agoYou can express any kind of information with HTML/XML tags and attributes but that doesn't mean you should. CSS is a much nicer and more readable syntax for its purpose.