Would like to have the ability to override the mobile.css like we can with opac.css. Mabye something like SetEnv OPAC_CSS_OVERRIDE_MOBILE <CSS file>
Isn't this what the OPACMobileUserCSS system preference is for?
The problem with OPACMobileUserCSS from my understanding is a global change. In my case I have 15 organizations that are sharing one Koha instance but each want there own look. We the opac.css override I am able to do that for the average computer use and but now need a way to do this for mobile as well. I did come up with my own modifications to solve this problem but do not know enough on how to submit it for inclusion into the Koha code. Changed Auth.pm Around line 412 to add support for multiple css for mobile devices opac_css_override_mobile => $ENV{'OPAC_CSS_OVERRIDE_MOBILE'}, Changed doc-head-close.inc Around line28 [% IF ( opac_css_override_mobile ) %] <link rel="stylesheet" type="text/css" media="screen and (max-width:700px)" href="[% themelang %]/css/[% opac_css_override_mobile %]" /> [% END %] These are my productions examples http://vassar.koha.senylrc.org http://hhs.koha.senylrc.org http://nki.koha.senylrc.org/
Created attachment 18218 [details] [review] Bug 9558 - Customize CSS for mobile It is possible to use an environment variable to specify a custom stylesheet for different libraries in a multi-library system: $ENV{'OPAC_CSS_OVERRIDE'}. This patch adds an additional option to override the CCSR theme's mobile stylesheet. To test: - Create a custom stylesheet and add it alongside CCSR's other CSS files. - Add a simple CSS rule which will be obvious in testing. For example: form#searchform { background-color: red; } - Modify the configuration file for your OPAC to add a line specifying a new custom stylesheet: SetEnv OPAC_CSS_OVERRIDE_MOBILE <name of CSS file> - Restart Apache. - Switch the OPAC theme to 'CCSR' - Clear your browser cache - View any page in the OPAC. If you browser is wider than 700 pixels the OPAC should appear normal. Below 700 pixels wide you should see your custom CSS applied (a red background on the search bar if you used the above example. The changes in this patch are courtesy Zachary Spalding as described in Bug 9558. Patch and test plan created by Owen Leonard.
Created attachment 18637 [details] [review] [SIGNED-OFF] Bug 9558 - Customize CSS for mobile It is possible to use an environment variable to specify a custom stylesheet for different libraries in a multi-library system: $ENV{'OPAC_CSS_OVERRIDE'}. This patch adds an additional option to override the CCSR theme's mobile stylesheet. The changes in this patch are courtesy Zachary Spalding as described in Bug 9558. Patch and test plan created by Owen Leonard. Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
I really like this, but I think there is a small issue. It seems to me that the opac_css_override_mobile link should be after the opac_css_override link so it has precedence. The other alternative would be to have opac_css_override only be triggered for screen width of greater than 700px, such that the two are mutually exclusive. If my concerns are invalid please reset the status to "Signed Off"
CCSR is now deprecated.