[wp-trac] [WordPress Trac] #20570: Tidying Admin CSS, bringing it up to CSS Code Standards (work in progress)
WordPress Trac
wp-trac at lists.automattic.com
Sun Apr 29 18:31:51 UTC 2012
#20570: Tidying Admin CSS, bringing it up to CSS Code Standards (work in progress)
------------------------------+------------------------------
Reporter: georgestephanis | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.4
Severity: minor | Resolution:
Keywords: work-in-progress |
------------------------------+------------------------------
Comment (by azaozz):
Some of the so proposed "coding standards" seem pretty weird imho. Keep in
mind that most people look at the CSS code through Firebug and friends,
making the formatting somewhat redundant:
- "Properly indenting top: left: right: bottom: attributes...". Why? It's
not more readable.
- "Alphabetizing css properties". What's the point? We don't alphabetize
function names/placement in PHP and JS...
- "Removing unnecessary browser prefixes". Sounds good as long as no
currently user browser is left behind.
- "Placing browser prefixed css properties before the non-browser prefixed
versions". This is more of a requirement than code style. As far as I
remember there was a case when this didn't work properly.
- "Removing extraneous spaces". As long as that doesn't impact
readability. Perhaps leaving two empty lines between sections.
- "Applying a consistent ordering of browser-prefixed properties". Meaning
`-moz-` should always go above `-webkit-`? Same as alphabetizing, don't
see the point.
Also thinking there should be another one: "Each selector should be on a
new line".
As far as I understand it "Coding Standards" means "to make the code
readable in a consistent way". Alphabetizing usually goes against that. It
seems better if the css properties are grouped by functionality rather
than alphabetized. For example `top:` and `left:` should be right after
`position:`, `padding:` should be next to `margin:`, etc.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20570#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list