I would like to have a warning free CSS-validation of drupal.css. Although it makes the css-file a bit larger the result is:
http://jigsaw.w3.org/css-validator/validator?uri=http://www.narres.com/m...

diff -r1.1 drupal.css
32a33
>   color: inherit;
39a41
>   color: inherit;
73a76
>   background-color: inherit;
75a79
>   color: inherit;
85a90
>   color: inherit;
103a109
>   background-color: inherit;
106a113
>   background-color: inherit;
112a120
>   background-color: inherit;
116a125
>   background-color: inherit;
155a165
>   background-color: inherit;
179a190
>   background-color: inherit;
251a263
>   color: inherit;
254a267
>   color: inherit;
305c318
<   padding: 1em 0 0 3em;
---
> /*  padding: 1em 0 0 3em; */
333a347
>   color: inherit;
373a388
>   color: inherit;
376a392
>   color: inherit;
482a499
>   color: inherit;
485a503
>   color: inherit;
488a507
>   color: inherit;
491a511
>   color: inherit;
494a515
>   color: inherit;
497a519
>   color: inherit;
500a523
>   color: inherit;
503a527
>   color: inherit;
521a546
>   color: inherit;
531a557
>   color: inherit;
533c559,561
<   border: 1px solid #bbb;
---
>   border-left: 1px solid #bbb;
>   border-right: 1px solid #bbb;
>   border-top: 1px solid #bbb;
536a565
>   color: inherit;
609a639
>   color: inherit;
615a646
>   color: inherit;
661a693
>   color: inherit;
664c696
<   border-top-width: 0;
---
> /*  border-top-width: 0; */
CommentFileSizeAuthor
#2 drupal.css_3.patch4.43 KBnarres
drupal.css.txt11.92 KBnarres

Comments

beginner’s picture

Title: Warning free » W3C compliant CSS
Version: 4.7.2 » x.y.z
Status: Needs review » Needs work

can you provide a patch against head (cvs)?
http://drupal.org/patch

narres’s picture

StatusFileSize
new4.43 KB

Here's the patch

beginner’s picture

Status: Needs work » Needs review
Stefan Nagtegaal’s picture

Status: Needs review » Needs work

Why do you want the drupal.css to be warning free?
It makes the CSS-file bigger, and I don't see anything that really need to be there.
It works without it, and it validates (which is IMO the most important part).

What are the advantages of this?

narres’s picture

It "blows up" the css from 11491 to huge 12206 bytes ;)

In order of relevance, validation is defined by:
- HTML/XHTML
- CSS
- W3C WCAG P1/P2/P3 or Section 508

So, as you cannot really validate CSS without "Markup Validation", you are not able to design high quality portals without error- and warning-free techniques.

In my opinion Drupal is a synonym for "high quality". That's the reason for this wish.
Or do you like results as;
- http://validator.w3.org/check?uri=http://drupal.org/
- http://www.istyledthis.nl/ ?

Indeed you are right: It's not neccessary for working, but important for image. IMO: It's the difference between a working- and a professional-service.

beginner’s picture

Status: Needs work » Needs review
webchick’s picture

I seem to remember the inherit property having troubles with older browsers (I'm specifically thinking of NN4 which tried to interpret 'inherit' as an actual colour and came up with bright, neon green... though that wouldn't apply since we import style sheets with @import which that browser ignores...). Anyone have access to like Internet Explorer 3/4 to test, or do we not care?

I support this patch. When debugging a CSS problem it's nice to be able to eliminate -any- funny business that may have indirectly arose from something like a warning. Further, one of Drupal's claims to fame is standards support; I think it makes sense to completely support said standards. Any arguments about how it "bloats" the size are kind of moot... first because the file only gets downloaded once per visitor and is from then on cached... but secondly because it's not by _that_ much.

No time to test right now, unfortunately, but I'll add it to my queue.

dries’s picture

I'm a fan of (warning free) 100% standards compliant CSS/XHTML.

Steven’s picture

Status: Needs review » Needs work

The warnings in the CSS validator are merely recommendations which may point to errors. That does not mean the CSS is any less valid or standards compliant!

Adding rules such as color: inherit is completely useless because it is the default property for color already. It does not do anything about the reason for the warning, which is not giving a matching color for background-color (or vice versa). You are only tricking the validator into not throwing that particular warning with a decoy rule.

The only change that makes sense is in the following rule, where the earlier padding is completely overridden by the later definition:

.forum-topic-navigation {
padding : 1em 0 0 3em;
border-top : 1px solid #888;
border-bottom : 1px solid #888;
text-align : center;
padding : 0.5em;
}

(and in this case, the style should be removed, not just commented out)

The other cases of redefinition are perfectly legal uses of a specific rule overriding part of a generic rule (e.g. border-bottom after border) and help keep the code compact and readable.

narres’s picture

Code needs work and we some opinions and finally a decision. So I've started a thread at http://groups.drupal.org/node/874

Stefan Nagtegaal’s picture

Status: Needs work » Reviewed & tested by the community

Then, this is ready to go in..

Stefan Nagtegaal’s picture

Status: Reviewed & tested by the community » Needs work

Damn, wrong threat because of multiple tabs.. Sorry..
Setting back to previous status.

LAsan’s picture

Version: x.y.z » 7.x-dev

Bringing it back to discussion.

Moving to current dev version.

dvessel’s picture

Status: Needs work » Closed (works as designed)

I don't think CSS validators should be taken too seriously unless it flags anything as an errors. As Steven mentioned, it's a recommendation and it's old issue.. closing.

mgifford’s picture

Issue tags: +CSS

Just wanted to state that having the last line in this thread being "I don't think CSS validators should be taken too seriously" is a good thing.

Dries and others have stated that valid, warning free, 100% standards compliant CSS/XHTML should be standard in Drupal. And really, it's not that hard to accomplish.

With stark it will be that much easier to find css put out by modules vs the themes. However Drupal Core itself should stick to what standard browsers can read reliably. At this point that's CSS 2.1.

Unfortunately, Drupal 7 has three CSS3 tags, so fails when running it without special options:
http://jigsaw.w3.org/css-validator/#validate_by_uri+with_options

I'd like to keep more experimental CSS in optional modules and out of Garland. That being said, maybe when D7 is released CSS 3 will be more standard.

If this is what we're betting on, then we should state this. Will be good to keep watching for adoption though - http://www.css3.info/modules/selector-compat/