Validating the thickbox.css file gives the errors below. How many of these can be placed in conditional comments? Is it possible to have a fully valid thickbox?
Sorry! We found the following errors (15)
URI : /sites/all/modules/thickbox/thickbox.css
29 #TB_overlay Parse Error opacity=75)
30 #TB_overlay Property -moz-opacity doesn't exist : 0.75
31 #TB_overlay Property opacity doesn't exist in CSS level 2.1 but exists in [css3] : 0.75
38 * html #TB_overlay Value Error : height Lexical error at line 38, column 81. Encountered: "?" (63), after : "" ? document.body.scrollHeight : document.body.offsetHeight + 'px');
39 * html #TB_overlay Value Error : height Parse error - Unrecognized }
55 * html #TB_window Value Error : margin-top Lexical error at line 55, column 105. Encountered: "&" (38), after : "" && document.documentElement.scrollTop | document.body.scrollTop) + 'px');
56 * html #TB_window Value Error : margin-top Parse error - Unrecognized }
127 * html #TB_load Value Error : margin-top Lexical error at line 127, column 105. Encountered: "&" (38), after : "" && document.documentElement.scrollTop | document.body.scrollTop) + 'px');
128 * html #TB_load Value Error : margin-top Parse error - Unrecognized }
137 #TB_HideSelect Parse Error opacity=0)
138 #TB_HideSelect Property -moz-opacity doesn't exist : 0
139 #TB_HideSelect Property opacity doesn't exist in CSS level 2.1 but exists in [css3] : 0
146 * html #TB_HideSelect Value Error : height Lexical error at line 146, column 81. Encountered: "?" (63), after : "" ? document.body.scrollHeight : document.body.offsetHeight + 'px');
147 * html #TB_HideSelect Value Error : height Parse error - Unrecognized }
154 #TB_iframeContent Property _margin-bottom doesn't exist : 1px
Comments
Comment #1
psynaptic commentedAfter moving all the hacks to a conditional stylesheet for IE6 we're left with the following:
Parse Error opacity=75)
Property -moz-opacity doesn't exist : 0.75
Property opacity doesn't exist in CSS level 2.1 but exists in [css3] : 0.75
I removed them but it stops the overlay from being transparent. I don't know any work around for this. It seems like lightbox2 also has these properties but still works if you remove them.
Comment #2
Damjan Dvorsek commentedI'm also interested in solution of this Issue
Comment #3
psynaptic commentedI ended up using Lightbox2 for the strict client. I removed the hacks to a conditional stylesheet and deleted the opacity stuff. Seemed to work just fine without it.
Still, I love thickbox and would love to be able to use it for those projects where clients need 100% valid CSS.
Comment #4
CraigBertrand commentedYea please move the hacks to a conditional css file and just get rid of the first 2 errors
I don't think that the 3rd error is a problem because it is not an error but css3
I am trying to start a web design company and want my site to have valid css! since I am using that as a selling point :) {dont want to be a css hypocrite} ha ha
Comment #5
CraigBertrand commentedPs
Thick box rocks
THANKS soooo much :)
Comment #6
scottrigbyHi– Thanks for these posts... but... 2 Qs:
1. Which hacks – can you post which styles should go in the IE6 conditional stylesheet?
2. And – has anyone found a solution for the remaining errors in psynaptic's first comment above?
Thanks in advance–
:) Scott
Comment #7
frjo commentedA separate thickbox_fix-ie.css with conditional comments would be good. The problem is how to add it automatically from a module. You can't use the standard drupal_add_css().
I guess you could insert it with drupal_set_html_head() but that feels a bit crud.
What do you think?
Comment #8
scottrigbyI know it's a holiday in the us, but just thinking this is kinda important for others besides myself
also... going out on a limb here... perhaps the priority mi8 be higher than 'minor'?
:) Scott
Comment #9
maria_zk commentedI found some suggestions: http://matteogallinucci.it/web/2008-02-04/thickbox-css-code-validation-f...
But I agree with scottrigby, priority should be higher than minor...
Comment #10
vivianspencer commentedI found a solution to fix the css errors that seems to work perfectly, just follow these steps
1. Download the plugin here: http://www.contezero.net/sites/contezero/index.php/2008/12/14/thickbox-fix-plugin/
2. Upload the files within the zip file to your thickbox module folder (note: this will replace the thickbox.css file in the module folder so make sure you back it up before uploading)
3. add the following line to your thickbox.module file at the end of the _thickbox_doheader() function: drupal_add_js($path .'/tb_css_fix.js'); // fixes css errors
That's it
I've tested this in ie6/7 and Firefox and it works fine, also I'm using version 6 of Drupal so I'm not sure if this fix will work in version 5 but I see no reason why it shouldn't.
Comment #11
armourymedia commentedWorks like a charm on the Toronto Yoga Guide site. Thanks, Vivian!
Comment #12
armourymedia commentedWorks like a charm on the Toronto Yoga Guide site. Thanks, Vivian!
Comment #13
AltoRetrato commentedThanks for your contribution! But could you tell us for which Thickbox version this patch was produced?
I'm using thickbox 6.x-1.2 and applied your patch. Now there's a javascript error in Firefox's error console:
The error goes away if I insert the line below at the start of thickbox.js:
... but I'm not sure if this is the right solution.
Also, a CSS error appears when I open a thickbox image:
On the Internet Explorer, now there is the following error:
Any suggestions to fix these problems?
Comment #14
frjo commentedThickbox for Drupal 6 has now a separate CSS file for Internet Explorer.
Comment #16
grendzy commentedCould the IE stylesheet be made conditional?
Comment #17
grendzy commentedwhoops, sorry about the .info fuzz.
Comment #18
Thoor commentedHi there,
I am using THICKBOX in 6.x-1.5 with Drupal 6.15 .... When I checked the CSS Code of a new Website, the W3C CSS Validator found 13 errors - all because of the css files in the Thickbox Module ... will this be fixed?
i.e.: CSS Validation Check
Comment #19
frjo commentedAs I mentioned in #14 Thickbox now have a separate CSS files for IE fixes. Check "Do not include special CSS for Internet Explorer" in the Thickbox settings (admin/settings/thickbox) if you want to.
This will of course remove support for Internet Explorer.
The validator will continue to complain about the Firefox specific "-moz-opacity" but that I don't see as a problem.
Comment #20
grendzy commentedWould you mind reviewing the patch in #17? It places the stylesheet in a conditional comment so it only loads on IE. This method is consistent with Drupal core, for example Garland puts fix-ie.css in a conditional comment.
Comment #21
YK85 commentedsubscribing