How to access css variables in custom theme

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
PedroLópezAndradas
Posts: 22
Joined: 16 Jan 2023, 11:30

How to access css variables in custom theme

Post by PedroLópezAndradas » 17 Jan 2023, 13:03

I have created a new theme through an extension.

I see the css variables hardcoded in 'aimeos.css', but I would like to use the custom ones in the admin panel.

How can I get and use those values?

Thanks!

User avatar
aimeos
Administrator
Posts: 7918
Joined: 01 Jan 1970, 00:00

Re: How to access css variables in custom theme

Post by aimeos » 18 Jan 2023, 10:24

The available CSS variables can be configured in the ./config/client.php file of your theme extension like in the ai-client-html extension: https://github.com/aimeos/ai-client-htm ... #L285-L301

There, you can tell the Aimeos backend, which variables are available and what their default values are. Then, the variables are injected into the page where you have access to them in your CSS:
https://github.com/aimeos/aimeos-larave ... hp#L22-L28
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
PedroLópezAndradas
Posts: 22
Joined: 16 Jan 2023, 11:30

Re: How to access css variables in custom theme

Post by PedroLópezAndradas » 18 Jan 2023, 11:06

Thank you so much!

I was moving around the solution without finding it. :D

Post Reply