CSS code from the user.css is nog efffective

  • Posts: 34
  • Thank you received: 0
  • Hikashop Business
5 hours 46 minutes ago #369879

-- HikaShop version -- : 6.1.1
-- Joomla version -- : 5.3.4
-- PHP version -- : 8.4.15
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : none

Hi,

I prefer to overwrite hikashop css with my own code from the user.css.
Unfortunately the code from the user.css is overwritten by other hikashop css code.

Since I don't know how the different hikashop css files are used (also relating to the css files in the CSS Options in the configuration section), I was hoping you could supply me with the right way to (preferably) use the user.css file or how I can find more information about the different css files that are in the configuration area.

Hope I can get some help here!

Thanks in advance and all the best wishes for 2026!

Last edit: 5 hours 44 minutes ago by W13ear.

Please Log in or Create an account to join the conversation.

  • Posts: 84872
  • Thank you received: 13824
  • MODERATOR
2 hours 26 minutes ago #369880

Hi,

The browser is loading the CSS one file after the other based on the order of the files in the head of the page:
i.imgur.com/jGdQuAV.png
If you check that with your browser's inspector tool, you can see that the user.css file is listed before the HikaShop CSS files.
So, if you have some CSS code on an HTML element in your user.css and then some other CSS code on that same element in HikaShop's CSS files, the code in HikaShop's CSS file will take priority.

One solution is to use !important in your CSS code to override that ordering:
developer.mozilla.org/en-US/docs/Web/CSS...nce/Values/important

Another solution would be to have HikaShop's CSS file before the template's.
For example, this extension should do it:
extensions.joomla.org/extension/style-a-...emplating/customcss/

Another solution might be to configure HikaShop User synchronization plugin via the Joomla plugins manager to load HikaShop on all the pages. It should hopefully load HikaShop's main helper before the template is loaded and thus it would be placed before the template's CSS files in the head of the pages. However, this can add a bit of resources utilization (marginal most of the time) on your website since HikaShop will be loaded on all the pages, even the ones where it doesn't display anything.

Ideally, the Joomla template should be modified to add the user.css file at the end of the head, just before the rendering of the end. This way it would simplify customization for users, not just for HikaShop but for any extension.

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum