4 ms·
Random question, CSS is a style language, but the intent was that there could be others, are there any other style languages that are alternatives?
by nickpeterson 3y ago
Random question, CSS is a style language, but the intent was that there could be others, are there any other style languages that are alternatives?
- Waterluvian 3y agoLESS and SASS but I imagine you mean significantly different and not just “dialects.”
- nickpeterson 3y agoI was under the impression that those were tools to generate css (I get the practicality), but is there even another one that has been proposed but never added to browsers?
- remexre 3y agoDoes https://gss.github.io/ https://gss.github.io/ count?
- Yiin 3y agoIgnoring XML based languages (XSL, PGML), some of the early ones, that never made it to browsers, were DSSSL and FOSI. There was also JSS (JavaScript Style Sheets, 1996). Mobile app development (e.g. Flutter) have their own APIs for styling, but they're still quite similar to CSS. There might be other languages used in areas I'm not familiar with.
- firecall 3y agoThe same was true of JS. But AFAIK, there is only CSS and JS. You used to have to declare the Script tag as JS, but you don’t anymore since HTML5. Because all scripts are JS. I don’t think SASS and LESS count, as are not supported by browsers natively, and require pre compilation. :-)
- qup 3y ago> You used to have to declare the Script tag as JS, but you don’t anymore since HTML5. Because all scripts are JS. I wonder how much data transfer was wasted to this.
- Maxion 3y agoLess than the unholy mess which is JS dependencies.
- bawolff 3y ago> Because all scripts are JS. Rip vbscript You can also declare style types (even an http header for it if i recall) but nobody bothered as nobody ever implemented anything else (not counting xslt but that was attached to documents differently and had a really different model)
- el_nahual 3y agoIt's actually right there in the name: Cascading Style Sheets. Css was never meant to be a style language (if by language we understand "a syntax with logical constructs"). It was simply meant go be the stylesheet for a given website. Headers look like this. Body looks like that. Except, they cascade: headers look like this, but headers that are emphasized look like so. The idea was that one could define a stlesheet for screens, a stylesheet for print, a stylesheet for screenreaders, and so on. As such, no programming "language" logic was considered, except "how do styles cascade" (ie, how do we resolve which style "wins" when there are multiple candidates). The alternative to css was inline styles; styling but without the sheet part.
- djxfade 3y agoI think you misunderstood the question. Yea, there definetly was competing ideas for how to do styling on the web. JSSS (JavaScript style sheet) was proposed by Netscape back in '96. (Funny how we now have gone full circle). https://en.m.wikipedia.org/wiki/JavaScript_Style_Sheets https://en.m.wikipedia.org/wiki/JavaScript_Style_Sheets
- smaudet 3y agoThe problem was three-fold: 1. Everyone trying to build a do-all-the-things-junk-ware-drag-and-drop system. Turns out fixed styles are a pain with complex widgets that are supposed to talk to one-another. 2. Turns out that designing something for just desktops was a mistake - media queries sort-of came to the rescue for print/mobile. But opening the door for extensions like this made it all-to-easy to want to simplify/re-use stuff. 3. Semantic HTML was too light-weight. Everyone building single page apps wanted views, html turned into a sort of weird GUI structure language with semantic sprinkled on top, and it was incredibly tempting to see CSS as a main driver of that view (inline styles were awkward but CSS allowed you to sort-of-obviate that). So we grew weird CSS/HTML extensions that turned into (DSL) languages that got folded back into CSS in a lot of cases. If we could start over I'd scuttle CSS/HTML separation, styling would just be part of html and html would have first class support for templates. You wouldn't need to cascade anything, because the HTML would just know what it was supposed to look like, and practically auto-cascade. If there were any "style sheets", they would be just default value lists, and again, they would be a part of the html standard, not a separate "standard". Which I think is practically what CSS used to be, lists of values that applied to various elements. This made it easy e.g. for early web to allow per-user customization by providing access to those lists, or in-browser modification of those values for quick feedback cycles. The mistake was calling it CSS and HTML's shortcomings, not how it functioned.
- LegionMammal978 3y agoIt looks like there was DSSSL, which was designed to work with any SGML document, including HTML 3.2 documents. Curiously, the syntax was all written in s-expressions! [0] has some working links to materials on it. Though it appears to have required an external processor, rather than being an alternative to "text/css" handled by the user agent. For that, you'd want to look elsewhere on Wikipedia's list [1]; one partial candidate is JSSS (JavaScript Style Sheets) in Netscape Communicator, which were JavaScript snippets that could actually be placed in <style type="text/javascript"> tags. [0] http://xml.coverpages.org/dsssl.html http://xml.coverpages.org/dsssl.html [1] https://en.wikipedia.org/wiki/List_of_style_sheet_languages https://en.wikipedia.org/wiki/List_of_style_sheet_languages