r/programming • • Jun 24 '14

Simpsons in CSS

http://pattle.github.io/simpsons-in-css/
2.2k Upvotes

371 comments sorted by

View all comments

66

u/moopet Jun 24 '14

Very pretty. But this tendency to refer to adding a bucketload of DIVs and calling it "pure CSS" needs to die.

30

u/ericanderton Jun 24 '14

May as well use SVG at that point.

0

u/[deleted] Jun 24 '14

[deleted]

11

u/ericanderton Jun 24 '14

That and you can edit it in software, using a mouse, like Inkscape or Illustrator. It's like people already thought this stuff through!

Edit: not to knock OP's submission here, which is really just a CSS techdemo. I can see exercises like this yielding lots of perfectly good CSS stuff like typography and creative layout.

7

u/YourMatt Jun 24 '14

Over 10 years ago, I was convinced SVG would completely replace HTML. I don't really believe it anymore, but the browser support is getting to the point that I wouldn't be terribly surprised to see a pure SVG site come around.

→ More replies (5)

3

u/jrkirby Jun 24 '14

First thought when I saw this: Isn't this what SVG is for?

→ More replies (2)

78

u/RICHUNCLEPENNYBAGS Jun 24 '14

CSS pretty much works by styling HTML elements; how are you gonna do it in CSS without HTML elements

36

u/lowleveldata Jun 24 '14

while that's true I feel it was pretty much writing HTML for CSS at this point. Might as well use some sweet canvas if you gonna do that HTML work

→ More replies (8)

25

u/moopet Jun 24 '14

You're not. But if something was "pure CSS" then you could apply it to whatever HTML you wanted and it'd be good to go. If you're going to go this route, you might as well make a massive grid of pixels out of divs and just colour them in.

20

u/skztr Jun 24 '14

"pure CSS" would mean being able to define the common elements and style them appropriately using only CSS, no manipulation of the document structure.

They all have hair, eyes, a nose, a mouth, ears, which are all parts of a head. Define only those elements, exactly the same way for each character, and style them differently based on their parent (eg: .homer .head), and I will be impressed.

Failure to admit where structure ends and style begins is a major reason behind a lot of needless wasted time when implementing anything on the front-end. This is the reason I stick to back-end / interfaces as much as possible.

5

u/RICHUNCLEPENNYBAGS Jun 24 '14

Well nothing I've seen really meets that definition.

10

u/skztr Jun 24 '14

that's because all front-end developers are horrible people

2

u/RICHUNCLEPENNYBAGS Jun 24 '14

I'm happy to let someone else do it.

→ More replies (1)

2

u/kryptobs2000 Jun 25 '14

That wouldn't scale though.

7

u/elsyx Jun 24 '14

I was pretty impressed by this display of CSS drawings using only a single DIV element for each one: http://lynnandtonic.github.io/a-single-div/

4

u/siegfryd Jun 24 '14

Probably could've used psuedo elements to get the number of divs down, but that doesn't really make a big difference in the end.

6

u/BadgerRush Jun 24 '14

Yes it does. Try opening that page with CSS disabled, or with a user defined accessibility CSS, or with a screen reader.

The HTML content of that page makes no sense, it is just a mumble of senseless divs.

6

u/cybercobra Jun 24 '14

Harsh reality: Unless lawsuits are involved, almost nobody except government [contractors] care about Web accessibility. *Slurps down more div soup*

4

u/Nickoladze Jun 24 '14

Yeah no shit, buddy. This isn't an example of a corporate website, it's some dude recreating The Simpsons using CSS transforms. Nobody should care about a mess of DOM elements when all he cares about is the end result.

Try opening that page with CSS disabled, or with a user defined accessibility CSS

You're completely missing the point.

6

u/BadgerRush Jun 24 '14

I don't care about messy DOM, just don't call it "pure CSS" because it is very far from it.

It is like a photographer claiming his photos are "100% natural" when in fact he uses all the Photoshop effects/filters/brushes available.

→ More replies (1)
→ More replies (1)

16

u/RenaKunisaki Jun 24 '14

pure CSS

requires Javascript

2

u/fecal_brunch Jun 24 '14

I wonder if it could be achieved with :after elements...

1

u/larsga Jun 25 '14

Not to mention calling it programming...

→ More replies (1)