Dynamic Layout / create .css

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
rider
Posts: 497
Joined: 05 Mar 2010, 13:17

16 Mar 2023, 13:01

Hi,

My idea is to create for each user on my application the possibility to change the layout (especially the color for topbar etc.) on his own needs.
In my application I´ve designed an Entity to store different color like:

$primaryLightColor: #69BE85 !default;
$primaryColor: #3C9462 !default;
$primaryDarkColor: #2B7F58 !default;
$primaryDarkerColor: #1E6A4E !default;
$primaryTextColor: #f8fafc !default;

Instead of create physically the .css files, I would like to store the generated .css in a string.
This string will be used at a @SessionScoped and include in my .xhtml - file.

My question is now:
- How can I generate the custom .css file?
I have not that experience, but I guess I need to use the scss file which in provided from Rain Layout?

Process is like:
1) Load entity which has some parameters like color
2) create css file as string
3) use this string in the <h:head> as your css file.

I´ve tried this already, with search / replace from the css and created my own .css file with
The approach was working. But I have to create for every primefaces rain version again such file - which I would like avoid.

How can i do this?
Primefaces 12.0, WildFly 21

olgubasak
Posts: 98
Joined: 05 Jan 2023, 11:05

23 Mar 2023, 10:37

Hi,

We'll check and get back to you.

Regards

rider
Posts: 497
Joined: 05 Mar 2010, 13:17

23 Mar 2023, 10:47

Thanks - I found a API for that...

<dependency>
<groupId>de.larsgrefer.sass</groupId>
<artifactId>sass-embedded-host</artifactId>
<version> 1.13.0</version>
</dependency>

This solved my issue and it works great.
Primefaces 12.0, WildFly 21

olgubasak
Posts: 98
Joined: 05 Jan 2023, 11:05

23 Mar 2023, 10:51

Hi,

Thank you for the update.

Best regards

villagetunic
Posts: 1
Joined: 12 Mar 2024, 12:49

12 Mar 2024, 12:50

Regarding the matter, I am grateful that yougeometry dash have kept me informed.

Post Reply

Return to “Rain - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest