Best practice is to keep the design separate from the content. Move the inline style to a css file.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 658176-inline-css-forms-22.patch | 11.3 KB | longwave |
| #21 | 658176-inline-css-payment.patch | 3.03 KB | longwave |
| #20 | 658176-inline-css-forms.patch | 4.46 KB | longwave |
| #16 | uc_payment_pack-658176.patch | 1.26 KB | ryan.davis |
| #17 | uc_credit-658176.patch | 1.55 KB | ryan.davis |
Comments
Comment #1
lonelyrobot commentedAnd the patch.
Comment #2
lonelyrobot commentedComment #3
tr commentedI think this is a fine idea. Any chance you could roll a patch that eliminates *all* the inline styles in Ubercart, not just this one?
I suggest you make the patch relative to the ubercart install directory, rather than the webroot, because ubercart isn't always installed in sites/default/modules. I use sites/all/modules, for instance, so the patch won't apply. However, I was able to modify the path and test the patch, and it worked for me.
Comment #4
RikiB commentedsame here, its very bad to have it inline for me.
Comment #5
tr commented@RikiB: Are you willing to look through the Ubercart code and find all the places that need fixing? That's what we're waiting on right now - someone to do the work.
Comment #6
RikiB commentedI wouldnt mind doing it at all, however I dont trust my coding skills at all, I usually brute force everything and learn as i go. If you could write up some detailed instructions I can give it a try.
Comment #7
tr commentedTagging.
Comment #8
tr commentedTagging.
Comment #9
tr commentedNo participation here - I guess it's just not that important to anyone.
Anyway, here's a list of Ubercart files with embedded style tags:
payment/uc_payment_pack/uc_payment_pack.admin.inc
payment/uc_credit/uc_credit.module
payment/uc_payment/uc_payment_checkout_pane.inc
payment/uc_google_checkout/uc_google_checkout.module
payment/uc_paypal/uc_paypal.module
payment/uc_2checkout/uc_2checkout.module
shipping/uc_ups/uc_ups.admin.inc
uc_cart/uc_cart.admin.inc
uc_order/uc_order.admin.inc
uc_order/uc_order.module
uc_order/uc_order.order_pane.inc
uc_store/uc_store.admin.inc
If you want to help out and get this fixed, please roll a patch that removes the inline styles from these places and adds the necessary replacement CSS to Ubercart's style sheets. Moving this to the 7.x-3.x queue.
Comment #10
longwave#line-items-div has been fixed, but some inline CSS remains.
Comment #11
ryan.davis commentedI am in need of projects to learn from, I'd like to tackle this one if nobody else wants it.
Comment #12
longwavePlease do - and feel free to contribute to any issue in the queue that you think you can help with, whether it's fixing bugs, adding features or testing or reviewing existing patches.
If you do intend to spend time working on a patch for an issue, it's worth setting the "assigned" field to yourself so we can try not to duplicate effort.
Comment #13
ryan.davis commented@longwave
As usual, thank you for your advice! The open and helpful nature of this community reminds me everyday how awesome open source development can be!
Comment #14
longwaveAlso worth noting that you don't have to tackle this all in one go; incremental patches that fix just some of the files listed in #9 are just as valuable, and in fact are easier to test.
Comment #15
ryan.davis commentedAh, right on. That makes sense. I have some time set aside tonight to start working on this issue. We'll see what I can get accomplished :)
Comment #16
ryan.davis commentedSubmitting first patch, removing inline CSS from uc_product_pack.admin.inc.
EDIT: Need to change this patch, please ignore.
Comment #17
ryan.davis commentedSubmitting patch to remove inline CSS from uc_credit module.
#EDIT: Need to change this patch, please ignore.
Comment #18
ryan.davis commentedComment #19
tr commented@ryan.davis: Are you going to work on this some more?
Comment #20
longwaveThis patch removes inline CSS from the payment pack and cart settings forms, reusing a uc_product theme function and simplifying that CSS as well.
Comment #21
longwaveThis patch removes inline CSS from the credit card and PayPal methods.
Comment #22
longwaveThis replaces #20, and removes theme_uc_product_inline_form entirely in favour of a pure CSS solution.
Comment #23
longwaveCommitted #21 and #22.
Remaining files:
payment/uc_2checkout/uc_2checkout.module
payment/uc_google_checkout/uc_google_checkout.module
shipping/uc_shipping/uc_shipping.admin.inc
uc_order/uc_order.admin.inc
uc_order/uc_order.customers.inc
uc_order/uc_order.order_pane.inc
uc_stock/uc_stock.admin.inc
Comment #24
longwavehttp://drupalcode.org/project/ubercart.git/commitdiff/796a5c0 removed 6 inline style attributes from the order pane icons.
Comment #25
longwavehttp://drupalcode.org/project/ubercart.git/commitdiff/bc881ca removed inline CSS from the product remove icon.
Comment #26
longwavehttp://drupalcode.org/project/ubercart.git/commitdiff/e8313b7 removed inline CSS from the order status update pane.
Comment #27
longwaveRemoved more inline CSS in the following commits
http://drupalcode.org/project/ubercart.git/commitdiff/1eb5f45
http://drupalcode.org/project/ubercart.git/commitdiff/6580acc
http://drupalcode.org/project/ubercart.git/commitdiff/a0c75ac
http://drupalcode.org/project/ubercart.git/commitdiff/fec0210
http://drupalcode.org/project/ubercart.git/commitdiff/1e06a77
http://drupalcode.org/project/ubercart.git/commitdiff/b853e72
Comment #28
yashadev commentedIs this issue still active? If so, which of the following files need to be cleaned?
payment/uc_2checkout/uc_2checkout.module
payment/uc_google_checkout/uc_google_checkout.module
shipping/uc_shipping/uc_shipping.admin.inc
uc_order/uc_order.admin.inc
uc_order/uc_order.customers.inc
uc_order/uc_order.order_pane.inc
uc_stock/uc_stock.admin.inc
Comment #29
longwaveNot sure any more; if you are offering to work on this then I have been finding inline CSS and similar things that should be fixed by grepping the codebase for things like "style", "align", "valign", etc.
Comment #30
yashadev commentedAlright. Are the css elements (classes, ids, etc) defined somewhere or do I have to install the module and inspect the webpage to find them?
Comment #31
longwaveNone of this is documented, you will have to figure out classes and IDs from inspecting the output and the existing CSS files.
Comment #32
longwaveAll major user-facing parts of the site now use true CSS rather than inline styles as far as I can see; the remaining parts are admin-facing only, so I pretty much consider this fixed. If anyone finds something they need to override but can't, please reopen this issue with details.