Problem/Motivation
Was looking through the CSS and would like to suggest some tweaks.
Proposed resolution
-
Remove browser prefixes, they aren't needed and can be a pain to maintain.
http://caniuse.com/#feat=css-boxshadow
http://caniuse.com/#search=border-radius - 0px is shorter and saves a few characters as 0.
- display: inline + margin doesn't work. Change to inline-block if you want to effect margin.
- Group the properties together that are related (position, box model, text, styles, etc)
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | css_update-2413317-12.patch | 3.29 KB | joelpittet |
| #9 | css_update-2413317-9.patch | 3.86 KB | joelpittet |
| #9 | interdiff.txt | 2.49 KB | joelpittet |
| #6 | interdiff.txt | 494 bytes | joelpittet |
| #6 | css_update-2413317-6.patch | 2.18 KB | joelpittet |
Comments
Comment #1
joelpittetComment #2
joelpittetShould be no visual difference with that.
Comment #3
joelpittetI see why you are being explicit here, likely should use a data attribute for the JavaScript interaction and make the two classes unique to the items they are styling.
Also, there are a couple of background: that could be much simpler just using background-color: properties.
Comment #4
subhojit777Thank you very much for the suggestions joelpittet++
I was testing the css code with http://csslint.net/ and I found other warnings beside your proposed resolution. Could you please update the css code according to your suggestions and tool's suggestions. And I think using a unique class for the close (a.add-to-cart-close) will be the best approach here, whats your opinion? Waiting for the patch :)
Comment #5
joelpittet@subhojit777 the csslint items are for the adjoining classes for IE6? Unless you had some other settings set in it, otherwise I wouldn't worry about it. IE8 is on the chopping block.
I'd avoid removing or changing CSS classes on a full release because likely someone has already forked your CSS/templates and we should try not to break those sites. Which is always the no-fun part of maintaining stuff:P
So I'll leave the class name refactoring out of this so we don't break peoples CSS intentionally. And hopefully we don't unintentionally either;)
Comment #6
joelpittetWhoops, missed a semicolon, classic:P
Comment #7
subhojit777No I did not had any other settings in csslint.
You have not included these styles.
Regarding the css refactoring thing, I understand your concern that it might break existing sites. Actually I have did something similar here #2365599: Pass cart render array to template. , I have changed the templates rendering shopping cart block. So it will break existing sites if they update it. But this change is important, and it cannot be avoided. Any suggestions on what would be the best thing to do in this situation? Can I release this as 2.x release, and write about this in module page. Thanks :)
Comment #8
joelpittetOh I thought the real properties where there already, I guess not.
I'd suggest using a data-attribute for the JS to interact with instead of a class. And then two classes for the elements.
Comment #9
joelpittetSomething like this.
Comment #10
subhojit777top, right, left, background-color have unrelated changes. Only the position of the styles have changed. Please undo them.
cursor, margin-right, width are unrelated changes.
Unrelated changes.
Why are we chaging the color here.
Why are we changing the color.
Please undo this.
Comment #11
joelpittetI changed the order of properties because I believe my linter did that to have like properties grouped together and ordered correctly. TBLR for example.
Comment #12
joelpittetThe color is just moved from the span tag to the a tag so that the styling of those two buttons would be consistently applied to the same type of element.
Here's most of the moves removed so it's easier to review.
Comment #13
joelpittetBump
Comment #15
subhojit777Committed thanks!