Discussion:
Massively beneficial CSS programming paradigm shift...
chris at seberino.org ()
2010-07-17 01:12:05 UTC
Permalink
I was naively creating and defining all my CSS classes globally.

When you are first learning web programming, it is enough accomplishment just
to get a CSS class working.

However, I tried to emulate what I saw in Google's CSS code and now I'm hooked.

They are very good about nesting classes and ids and even using multiple
classes on an HTML element. For example, often in their
CSS code you'll see stuff that only applies to a specific div inside a specific
id contained in yet another div and id....etc.

My old way has all the problems as using globals in other programming
languages. Google's method has all the benefits we've come to love from
encapsulation in other languages.

I don't know if everyone else knew this already but I was amazed how much
easier it was to code my web app and how much cleaner the logic was.

cs
Chuck Esterbrook
2010-07-17 01:23:36 UTC
Permalink
"Google's method"? Do you think CSS selectors are something from Google?

-Chuck
--
http://chuckesterbrook.com/
chris at seberino.org ()
2010-07-17 01:47:19 UTC
Permalink
Post by Chuck Esterbrook
"Google's method"? Do you think CSS selectors are something from Google?
I was just calling it Google's because that was first place I noticed it. :)
I guess they unfairly are getting all my admiration.

cs
jackie3 at cox.net ()
2010-07-17 13:00:58 UTC
Permalink
Post by chris at seberino.org ()
They are very good about nesting classes and ids and even using multiple
classes on an HTML element. For example, often in their
CSS code you'll see stuff that only applies to a specific div inside a specific
id contained in yet another div and id....etc.
My old way has all the problems as using globals in other programming
languages. Google's method has all the benefits we've come to love from
encapsulation in other languages.
I don't know if everyone else knew this already but I was amazed how much
easier it was to code my web app and how much cleaner the logic was.
cs
Do you have a small example you can share?
Thanks, Jack
Bob La Quey
2010-07-18 00:30:13 UTC
Permalink
Post by chris at seberino.org ()
I was naively creating and defining all my CSS classes globally.
When you are first learning web programming, it is enough accomplishment just
to get a CSS class working.
However, I tried to emulate what I saw in Google's CSS code and now I'm hooked.
They are very good about nesting classes and ids and even using multiple
classes on an HTML element. For example, often in their
CSS code you'll see stuff that only applies to a specific div inside a specific
id contained in yet another div and id....etc.
My old way has all the problems as using globals in other programming
languages. Google's method has all the benefits we've come to love from
encapsulation in other languages.
I don't know if everyone else knew this already but I was amazed how much
easier it was to code my web app and how much cleaner the logic was.
cs
What Chick said ... next look at JQuery's use of CSS selectors to give you
some insights into what people are doing with Javascript and the DOM these
days.

http://jquery.com/
http://api.jquery.com/category/selectors/

BobLQ
Bob La Quey
2010-07-18 00:31:12 UTC
Permalink
Post by Bob La Quey
What Chick said ...
Bob La Quey
2010-07-18 00:31:50 UTC
Permalink
Damn. Screwed up editing the fix.

s/Chick/Chuck/

BobLQ
Post by Bob La Quey
What Chick said ...
Loading...