13 ms·
Languages Which Almost Became CSS
- limeblack 9y agoSurprised it didn't talk about how the box models worked orginally. IE 5 did the box model differently including margin and padding in the width. Made CSS very difficult to use.
- lojack 9y agoYou can switch to that model using "box-sizing: border-box", and thats the default for bootstrap and a lot of frameworks these days. I actually much prefer that to what ended up being the default, but maintaining a stylesheet that had to account for the two different models was a big pain.
- freshyill 9y agoIt was wrong, and required stupid workarounds, but it was better. I hated those old IEs as much as anybody, but I admitted even back then that IE's broken box model was much saner. We had to do stupid things with widths and percentages just to make the browsers that worked correctly work. The fact that everybody uses box-model: border-box now is pretty much an admission that the original box model was a bad idea.
- wwweston 9y agoAgree with everything... except the idea that IE was wrong in this case. I hated Microsoft as much as anybody during the overlong era of IE6, but even back then, I had to admit that the W3C were the ones who got the box model wrong. The funny thing is that I've never heard any rationale -- much less a convincing rationale -- for the choice in the spec.
- freshyill 9y agoWell only wrong in that they weren't following the W3C box model spec. That single inconsistency was responsible for at least 50% of the extra work caused by IE.
- freshyill 9y agoEdit: I meant box-sizing.
- freshyill 9y agoEdit: I meant box-sizing.
- ue_ 9y agoI am very interested in the s-expression stylesheet format. I think it would be preferable for me at least to CSS, especially the code for alternating rows; I imagine that people write programs in this language might have well done away with the need for CSS preprocessors that we have today. This also makes me ask a question - why are there no Lisp-like CSS preprocessors? I am reminded of the proposal to markup webpages with s-expressions rather than XML, though there are packages available (actually just macros) in CL that let you write websites this awy.
- pcwalton 9y agoBe careful what you wish for. The fact that CSS can be so easily declaratively analyzed is the reason why it can be made reasonably fast at all. CSS has some key restrictions—for instance, that attributes always inherit top-down and never bottom-up—that makes it amenable to parallelism (which is no longer a theoretical concern, as parallel CSS implementations are starting to ship). Adding a full programming language would have the potential to make styling much slower than it already is.
- littlestymaar 9y ago> as parallel CSS implementations are Is someone else outside mozilla ready to ship a parallel CSS engine any time soon ?
- pcwalton 9y agoNot that I'm aware of.
- minikomi 9y agoYou might want to check out Garden [0], a meta-css library for clojure(script). [0] https://github.com/noprompt/garden https://github.com/noprompt/garden
- juki 9y agoThere is also LASS[1] for Common Lisp. You use it either as a library for generating CSS, or as a standalone preprocessor. [1]: https://github.com/Shinmera/LASS https://github.com/Shinmera/LASS
- tannhaeuser 9y agoThe 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)
- zbraniecki 9y agoI strongly believe that we're currently in the early stage of the same cycle with localization formats. The most popular ones, like gettext, xliff, .properties are very limited, while the most sophisticated one - MessageFormat - is stopping a few steps short of having all needed capabilities and is very hard to read/write by hand. I'm very excited for the next 3-5 years where I believe we'll see more development in this field and hopefully we'll end up with a good equivalent of CSS for Web Localization. Full disclosure: I work on a project that my team believes to be a good contender for that - Project Fluent ( http://projectfluent.io/ http://projectfluent.io/ ) I also work within TC39 on ECMA402 on APIs that will make coming up with new localization APIs much easier (PluralRules API, language negotiation and selection etc.).
- seanwilson 9y ago> I strongly believe that we're currently in the early stage of the same cycle with localization formats. I was looking into this recently and I'm amazed how many different but very similar formats there are. For example, Django uses gettext, JavaScript has several different JSON formats (e.g. i18next, polyglot) and Go has its own JSON/TOML/YAML format. Each format seems so similar I don't understand why they didn't use an existing one. Usually you want your translators to use a web interface to edit translations so different formats make this troublesome.
- tarikjn 9y agoI started doing web development around 1999 or a bit earlier, NotePad.exe was my first text editor. By 2003 I was building websites in strict XHTML and CSS, and always avoided using presentation markup, OpenWeb.eu.org was one of my favorite resources, along with W3C specs. Most developers I knew in person didn't care about CSS or didn't 'get' it. Things have come a long way since, in term of browser compatibility and tooling, but it always feels like a large portion of people who do web dev don't 'get' the web, for example, I am always surprised at the usage of frameworks such as Bootstrap in tech teams, you're basically redefining what you want your elements to look like using a combination of class names, which means you lose style separation and selectors. It's like a circle repeating itself. People will always want to use the web to build their 'visual' or 'app' to look like they want to just as if they are designing a business card, but the web at its core is a web of knowledge, for it to be linked by other pages, browsed by bots, and is worth little without traffic or way to catalog that knowledge in the grand scheme of things. And that's why a bunch of people like me have always been pushing to have a semantic definition of the knowledge in your document, separate, and to be considered before its presentation. Now we can make rich apps, and get pretty much pixel exact renders, but all the underlying philosophy remains: accessibility, context, semantics, and still should come before the styling in order of priority, and all the bells and whistles should ideally be implemented as an augmentation of the semantics.
- sopooneo 9y agoBut for most human beings: the icing is the cake. We hurt ourselves by thinking that "content is king" outside our own beautiful wonderful nerdy circles.
- ajarmst 9y ago"Rather than using repeated selectors to handle the nesting, PWP used a parenthesis system which is evocative of the indentation systems used by languages like Stylus and SASS which are preferred by some developers to CSS today.." Heh. So, do nested parentheses remind you of any other languages?
- 65827 9y agoUnfortunately the idea that you would just restyle the content a bit as needed and viola website is redesigned never really worked. At any point in history. I just wish you could get through a redesign without learning three new languages nowadays.
- cel1ne 9y agoCheck out tachyons and you'll never use anything else again: http://tachyons.io/ http://tachyons.io/
- adrianratnapala 9y agoYes in my experience, we got the worst of both worlds. We have people with a religion of separating style from content, so they introduce the complexities necessary to do that. But because it is merely a religion, they don't actually do it in a way that makes it possible to actually change styling just through CSS.
- seanwilson 9y ago> We have people with a religion of separating style from content, so they introduce the complexities necessary to do that. Yeah...I've seen lots of code review arguments where one developer refuses to alter the HTML to make the styling easier (e.g. order of elements, wrapping elements in certain ways) and then the CSS styling requires all sorts of complex tricks. If Google or screen readers won't see any difference, striving to separate styling from content like that is a waste of time in my opinion and you should make compromises. People complain about e.g. Bootstrap's "text-center" and column classes as well because they're not semantic but they can save time when used appropriately.
- strictfp 9y agoI agree. And if you view HTML as presentation there is absolutely nothing wrong with embedding styles. The CSS separation only makes sense if you consider HTML data, which some people might do but I think is misguided.
- tannhaeuser 9y ago
- 13of40 9y agoI'm sure there's an article out there about "languages that almost became html". Anyone have a link to it?
- jccalhoun 9y agoThis is not quite what you want but The History of the Web is a newsletter that does stories on various topics. Here's the site with archives: http://thehistoryoftheweb.com/ http://thehistoryoftheweb.com/
- otto_ortega 9y agoI love CSS, I wonder why it is not an universal standard used to define GUIs in other contexts like native mobile apps, or desktop apps. Why did Android creators decided to define its own way to describe GUIs, when CSS existed and could be used for that purpose? Every time I have tried to create a decent GUI for the desktop I get disappointed by the insane difficulty of the task, as with CSS you can make something look good in a few minutes.
- spondyl 9y agoI'm no Android developer but I was recently doing some of Google's basic courses and I have to say, I'd take Android's positioning system anyday. I think a mix of both would be best but just being able to specifically say put x "toLeftOf="@id/y" was very nice. Mind you, I'm someone who plays "CSS Whack-a-mole" rather than actually truly understanding how it's positioning works.
- zackbloom 9y agoPerhaps not surprisingly there's a just as large cohort of people who love how GUIs are defined in desktop and mobile applications and despise CSS. I've seen someone go so far as to redefine the entire browser rendering system, drawing every button and control onto one big HTML canvas element. They're very different ways of building a UI, and it's hard to find people with a ton of experience in both to provide perspective, much less an answer as to which is 'better'.
- deleted 9y ago[deleted]
- pjmlp 9y agoBecause the way of native GUI programming is much more productive than the mess of trying to make piles of <div>, <span> and tags designed for text like <li> to do something meaningful.
- adrianratnapala 9y agoCorrect. Of course if you are trying to lay out something document like (like those things we had back in the '90s called web pages), then HTML is much easier than native GUI programming.
- gattilorenz 9y ago> It also includes one of the best nonsensical infographics to ever exist on the web While technically flowcharts could be defined infographics in the broad/original sense, I still don't see why this is so nonsensical. It is obviously targeted to someone who knows the subject and terminology involved, but apart from that it looks OK to me. /nitpick
- kelvich 9y agoDSSSL is actually not that dead. Postgres documentation was built with use of DSSSL until 2017. https://github.com/postgres/postgres/blob/REL9_6_STABLE/doc/src/sgml/stylesheet.dsl https://github.com/postgres/postgres/blob/REL9_6_STABLE/doc/...
- smitherfield 9y agoSounds kinda dead then.
- Fifer82 9y agoTo be honest, I still find CSS a mess. I really dislike it. I feel like JS and HTML are pretty solid, then you have this CSS hacky shit with no decent docs and I just didn't get it. Recently I wanted to use Material Components, and the whole BEM thing makes my eyes cry. `custom-on-dark .mdc-icon-toggle.mdc-ripple-upgraded::before` `custom-on-dark .mdc-icon-toggle.mdc-ripple-upgraded::after` `mdc-toolbar__section mdc-toolbar__section--align-start` I just am not going to work with that in my code and it screams to me something is wrong.
- blauditore 9y agoI'm not a fan of BEM either. It terribly feels like over-engineering and ignores certain principles of CSS. Often, much better clarity could be achieved simply with better naming and structuring of elements.
- coldtea 9y ago>I'm not a fan of BEM either. It terribly feels like over-engineering and ignores certain principles of CSS. It's actually under-engineering (a brute force, hacky solution), and it ignores those principles of CSS (cascading for one) on purpose because they have been historically found to be more harm than good.
- Fifer82 9y agoSomething about it reminds me of being new to programming. var the_first_left_menu_item_animation_enter var the_second_left_menu_item_animation_enter What causes this problem? Does CSS not have any modular capability and that is why? Is it global by definition? Not really sure what I am trying to say.
- coldtea 9y ago>What causes this problem? Does CSS not have any modular capability and that is why? Is it global by definition? It has crappy scoping and modularity rules.
- amelius 9y agoI wonder if any of the alternative languages, in contrast to CSS in the beginning, did provide a simple way to center content along the x and y axes.
- k__ 9y agoI kinda dig the current CSS in JSX hype. I think I never have been that fast building UIs. I get the convenience of writing inline-styles like HTML attributes and not a style string and in the background it gets compiled to CSS classes, with deduplication and everything. Since Flexbox and CSS-Grid, most CSS frameworks I used in the past also don't have much value for me anymore.
- cwmma 9y agoIf you want more information, somebody wrote a PhD thesis on this very topic http://wiumlie.no/2006/phd/ http://wiumlie.no/2006/phd/
- odammit 9y agoIf CHSS with its percentage ownership had become CSS desk flipping would have been invented way earlier.
- bhaak 9y agoMinor nitpick: "As you may know, HTML as we know it was originally based on a pre-Internet language called SGML." It's "pre-world-wide-web". The internet was already alive and quite busy in the 80s.