

Normalize.css: An alternative to CSS resets - necolas
http://necolas.github.com/normalize.css/

======
jsdalton
Philosophically, I think I prefer this approach to resetting everything.

I'm not sure, however, I'm on board with the idea that you tweak this for
every project you work. That would make merging future evolutions of these
styles (e.g. when new browser versions are released) a real pain.

It's also a bit disconcerting that the project authors went their separate
ways and there are now two projects? Hm.

~~~
necolas
We both collaborate on this repo and much of it was pulled into Jonathan's
original repo (which also contains some of his personal preferences and an
additional metrics file).

~~~
jsdalton
Different people forking it for their own preferences is one thing, but not
having a canonical resource for the project is -- well, like I said,
disconcerting. But maybe it's just me.

Don't mean for this minor nitpick to overshadow the rest of the work you guys
have put into this, by the way. It's good stuff.

------
andrejpavlovic
I think a combination of CSS reset[1] and CSS base[2] is the best way to go.
Use CSS reset to remove all styles, and then use a standard CSS base to set a
new set of defaults. That way you can easily distinguish between what styles
are used for resetting, and which are actually meant for styling.

YUI does a really good job with this.

[1]<http://developer.yahoo.com/yui/3/cssreset/>
[2]<http://developer.yahoo.com/yui/3/cssbase/>

------
ez77
Random question: I was looking at [1], linked by Normalize. How come the
element HTML element "A" has no default values? It sure seems to always be
blue/purple and underlined...

Thanks in advance.

[1] [http://css-class.com/test/css/defaults/UA-style-sheet-
defaul...](http://css-class.com/test/css/defaults/UA-style-sheet-defaults.htm)

------
astrofinch
"The normalize.css file is not intended to be a mysterious "black box" that is
included in a project and then ignored."

Is there anything that is? I think I'd prefer to use that, if it existed.

~~~
joshfinnie
I think this was in referrence to adding "reset.css"[1] as your first css
file. It is very "black box," as it is something that you add but never
modify.

[1] <http://meyerweb.com/eric/tools/css/reset/>

~~~
code_duck
Wellll.... Meyer says right there "In other words, this is a starting point,
not a self-contained black box of no-touchiness.".

I understand a lot of people treat it like that, though. I modify the reset to
set defaults for each layout myself.

------
brian_c
Why? Write your CSS. Test it in browsers. If something doesn't look right, fix
it. Resets are bloat.

~~~
davidwparker
"Test it in browsers"

That's the reason for resets. Because "browsers" could mean one of a million
different browsers and it would take forever to tweak each of them, since CSS
isn't the same across the board. I'd like to see some CSS that isn't using a
reset that looks perfect across IE 6, 7, 8, 9, Opera X-Z, Chrome X-Z, Firefox
X-Z, and Safari. Additionally, I'm guessing such CSS could probably be done
faster with a reset.

~~~
rimantas
Any competently written CSS will give you that without the resets and
normalizers nonsense. Just normalize elements you want to normalize, without
polluting your inheritance chain and making yourself pain to debug it. I've
been writing CSS for god-knows-how-many years and never ever saw the need for
it. And yes, I do cross-browser sites (and that even includes Opera).

~~~
gnaritas
> Just normalize elements you want to normalize

In other words, manually do a reset. You can't say reset is unnecessary and
then say first thing, just do a reset.

~~~
rimantas
"Manually doing reset" means that you do "reset" only on needed elements (and
you target them by id or class).

~~~
gnaritas
That's just too much manual work that's the same over and over again. We
already know what elements are different between browsers, and reset fixes
that, without requiring manual labor; it's a better approach.

~~~
rimantas
Not sure who those "we" are, but reseting every damn element is far from
demonstrating knowledge. Especially if it is separate stylesheet. There is
nothing better in that approach at all.

------
dylanrw
Awesome approach. Whenever I start out a project, I always reset, then
normalize it back up to a common standard, then apply the additional style.
It's good to accelerate the first two steps with this.

------
MatthewPhillips
Can anyone explain how this differs at all from resets? The only difference I
see on the page is:

> Preserves useful defaults

and I don't know what a "user default" is.

~~~
there
when a user has a different default font and/or size selected in their
browser?

~~~
tealtan
Not user defaults, useful defaults.

Some css resets strip out bullet styles for lists, or focus styles on selected
text boxes. I assume this keeps things like that intact instead of nuking
everything.

~~~
MatthewPhillips
Yeah, sorry, obviously I can't read. I would like to downvote myself right
now.

------
kilian
This is very similar to what I've been doing since 2008 with
<http://sencss.kilianvalkhof.com>, except I also provide a good vertical
rhythmn. I should probably start promoting it more again ;)

That said, the form stuff in normalise.css takes a very different approach
that I'm definitely gonna try out.

------
tcdent
They've taken some liberties in correcting (arguable) flaws in standard
stylesheets, ex. setting cursor:pointer on form buttons, but I like all that
they've chosen to include. Never been a fan of full reset stylesheets, but
there's a really good chance I'll take advantage of this, and the research
they put in, for future projects.

------
SkyMarshal
Any particular reason you linked to your fork instead of the original?

------
arapidhs
I like that it preserves some normals but either way almost always there will
be some overrides so staying with reset.

~~~
jwecker
Looking through it I don't see it as a replacement for reset except in a few
cases. In particular, most of the stuff in there (great documentation, btw)
seems to be oriented toward fixing strange browser quirks not covered by
reset. For example, things like "Remove Android and iOS tap highlight color
[from html-tag] to prevent entire container being highlighted..." Seems like a
very natural add-on to reset to me.

------
username3
> Chrome, Firefox 3+, Safari 4+, Opera 10+, Internet Explorer 6+

No version for Chrome?

~~~
paulirish
Since Chrome auto-updates all its users every 6 weeks, specifying the version
number isn't necessary most of the time.

~~~
boucher
And version 1 of Chrome already had most of the things people consider as
modern anyway.

------
ck2
Looks nice and clean but is github needed for a 3k text file?

(plain text)
[https://raw.github.com/necolas/normalize.css/master/normaliz...](https://raw.github.com/necolas/normalize.css/master/normalize.css)

~~~
mcrittenden
I don't see why not; it's the goto place for open source code nowadays, no
matter how larger or small the project may be.

