Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
drupal.css
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2006 at 08:24 UTC
Updated:
6 Jun 2006 at 10:02 UTC
Jump to comment: Most recent file
CSS selectors on dimensioning with a value 0 should have no unit.
Examples:
padding: 0px;
should change to
padding: 0;
border: 10px 3em 0px 0px;
should change to
border: 10px 3em 0 0;
What this change achieves:
- code brevity: 0 is 0 in any unit
Note: this change pertains to all css files in all core installs / themes / theme engines.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | css-cleanup.patch | 7.71 KB | rstamm |
| #8 | pushbutton_no_zero_units.patch.txt | 1.69 KB | pfaocle |
| #6 | drupalcss_no_zero_units.patch.txt | 1.13 KB | pfaocle |
Comments
Comment #1
pfaocleThis is, AFAIK, standard practice for CSS. The downside, I guess, is remembering to put a unit back in if the value changes from 0...
Opinions? Will roll some patches if people think this is a worthwhile tidy up.
Comment #2
figaro commentedI'd like to reverse the argument: it is not about remembering to put something back in which is needless in the first place, it is about leaving something out. http://www.w3.org/TR/REC-CSS1#units
Comment #3
figaro commentedFor the record, I have applied the aforementioned changes in the bluemarine theme and the friendselectric theme. I do not have CVS clients installed, but if agreeable, I can send the files or leave a link to those files.
Comment #4
heine commentedUnits on zero values are optional. This doesn't translate into "shouldn't".
To create patches, check the chapter Patches in the handbook. Hope that helps.
Comment #5
pfaocleAgreed, but squeezing out some 'optional' bytes from the various CSS files wouldn't hurt, either :)
Comment #6
pfaocleHad a quick gander - most 0 values in drupal.css are already specified without a unit. Here's a patch which removes the few 0 values with a unit.
Comment #7
drummCommitted to HEAD.
Please close if this is all, or add patches for the other CSS files.
Also please document where appropriate (if anywhere).
Comment #8
pfaoclePushbutton CSS.
Comment #9
pfaocleI think that is all.
Comment #10
drummCommitted to HEAD.
Comment #11
rstamm commentedSorry to open this again but i found more in the css files.
The patch
Comment #12
pfaocleLooks good to me. Patch applies cleanly to current HEAD, all changes look fine. No adverse affects in core themes, as far as I can see.
Comment #13
drummCommitted to HEAD.
Comment #14
killes@www.drop.org commentedalso to 4.7
Comment #15
(not verified) commented