Best practice is to keep the design separate from the content. Move the inline style to a css file.

Comments

lonelyrobot’s picture

StatusFileSize
new1.66 KB

And the patch.

lonelyrobot’s picture

Status: Active » Needs review
tr’s picture

I 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.

RikiB’s picture

same here, its very bad to have it inline for me.

tr’s picture

Status: Needs review » Needs work

@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.

RikiB’s picture

I 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.

tr’s picture

Issue tags: +Ubercart theme layer

Tagging.

tr’s picture

Tagging.

tr’s picture

Version: 6.x-2.2 » 7.x-3.x-dev
Priority: Normal » Minor

No 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.

longwave’s picture

Title: Move inline style of div#line-items-div of payment pane to css file » Remove inline CSS

#line-items-div has been fixed, but some inline CSS remains.

ryan.davis’s picture

I am in need of projects to learn from, I'd like to tackle this one if nobody else wants it.

longwave’s picture

Please 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.

ryan.davis’s picture

Assigned: Unassigned » ryan.davis

@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!

longwave’s picture

Also 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.

ryan.davis’s picture

Ah, 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 :)

ryan.davis’s picture

StatusFileSize
new1.26 KB

Submitting first patch, removing inline CSS from uc_product_pack.admin.inc.
EDIT: Need to change this patch, please ignore.

ryan.davis’s picture

Status: Needs work » Needs review
StatusFileSize
new1.55 KB

Submitting patch to remove inline CSS from uc_credit module.
#EDIT: Need to change this patch, please ignore.

ryan.davis’s picture

Status: Needs review » Needs work
tr’s picture

Issue tags: +Novice

@ryan.davis: Are you going to work on this some more?

longwave’s picture

Assigned: ryan.davis » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.46 KB

This patch removes inline CSS from the payment pack and cart settings forms, reusing a uc_product theme function and simplifying that CSS as well.

longwave’s picture

StatusFileSize
new3.03 KB

This patch removes inline CSS from the credit card and PayPal methods.

longwave’s picture

StatusFileSize
new11.3 KB

This replaces #20, and removes theme_uc_product_inline_form entirely in favour of a pure CSS solution.

longwave’s picture

Status: Needs review » Active

Committed #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

longwave’s picture

http://drupalcode.org/project/ubercart.git/commitdiff/796a5c0 removed 6 inline style attributes from the order pane icons.

longwave’s picture

http://drupalcode.org/project/ubercart.git/commitdiff/bc881ca removed inline CSS from the product remove icon.

longwave’s picture

http://drupalcode.org/project/ubercart.git/commitdiff/e8313b7 removed inline CSS from the order status update pane.

yashadev’s picture

Is 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

longwave’s picture

Not 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.

yashadev’s picture

Alright. Are the css elements (classes, ids, etc) defined somewhere or do I have to install the module and inspect the webpage to find them?

longwave’s picture

None of this is documented, you will have to figure out classes and IDs from inspecting the output and the existing CSS files.

longwave’s picture

Status: Active » Fixed

All 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.

Status: Fixed » Closed (fixed)
Issue tags: -Ubercart theme layer, -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.