lat9 / one_page_checkout

One-Page Checkout for Zen Carts v1.5.7a and later.
GNU General Public License v2.0
15 stars 11 forks source link

css loading... #413

Open proseLA opened 6 months ago

proseLA commented 6 months ago

if i have a payment module that has its own styling, ie, i created some elements in a file called checkout_payment.css would it not be nice if that styling could be incorporated into this module without having someone merge css elements into checkout_one.css.

or is that already possible and i am just ignorant of it.

drbyte commented 6 months ago

Could load it via output generated from a custom jscript_mymodule.php file in include/modules/pages/checkout_one

On Apr 28, 2024, at 11:16 PM, proseLA @.***> wrote:

 if i have a payment module that has its own styling, ie, i created some elements in a file called checkout_payment.css would it not be nice if that styling could be incorporated into this module without having someone merge css elements into checkout_one.css.

or is that already possible and i am just ignorant of it.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

lat9 commented 6 months ago

Could load it via output generated from a custom jscript_mymodule.php file in include/modules/pages/checkout_one On Apr 28, 2024, at 11:16 PM, proseLA @.***> wrote:  if i have a payment module that has its own styling, ie, i created some elements in a file called checkout_payment.css would it not be nice if that styling could be incorporated into this module without having someone merge css elements into checkout_one.css. or is that already possible and i am just ignorant of it. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

... or copy the checkout_payment.css file to checkout_one_mypayment.css. "Standard" CSS loads load page_name.css and then any pagename{.*}.css files found.

proseLA commented 6 months ago

i am just ignorant of it.

thank you both for the enlightenment!

proseLA commented 6 months ago

... or copy the checkout_payment.css file to checkout_one_mypayment.css. "Standard" CSS loads load page_name.css and then any pagename{.*}.css files found.

this is either wrong; or i am doing something wrong. and the examples are a bit confusing.

i am not sure what 'standard' means. if by standard you mean template_default or something else, i am confused.

i am using the new standard, ie the bootstrap template. as far as i can tell, the page specific css would get loaded in this section of code.

and neither, checkout_one_mypayment.css gets loaded, nor checkout_one_.mypayment.css, nor checkout_one.mypayment.css.

if the first example is correct, why would checkout_one_confirmation.css not get loaded on the checkout_one page?

while i am sure chris' example could be done, i currently do not have the energy to explore.

drbyte commented 6 months ago

Your observation is correct: page_name{_.*}.css auto-loading is not a thing. There is no wildcard on the page name.

https://docs.zen-cart.com/user/template/stylesheet/

drbyte commented 6 months ago

include/modules/pages/checkout_one/jscript_mymodule.php would work though. And that could either render an HTML <link href="/path/to/file.css" rel="stylesheet"> tag or just directly render inline <style>....</style>. And it's handled still within the <head> section like other CSS ... just slightly later in the flow, after the default CSS handling.