Why isn't the sprite/CSS from custom theme used if the theme is applied for a user?

Operating System & Version
CentOS 7
cPanel & WHM Version
11.96.0

sangeeths

Active Member
May 25, 2021
25
7
78
India
cPanel Access Level
Root Administrator
I work on an integration for cPanel and we use a common dev server and multiple themes to work on different requirements. However, I noticed today that even though I selected a different theme while creating a user account, and the URL in the browser's address bar rightfully reflects as such:

Code:
# cPanel URL
https://internal.company.com:2083/cpsessXXXX/frontend/custom_theme/index.html?login=1

# Sprite URL
https://internal.company.com:2083/styled/current_style/sprites/icon_spritemap.png

# Expected sprite URL
https://internal.company.com:2083/frontend/custom_theme/styled/current_style/sprites/icon_spritemap.png
It's not really pulling the sprite/icons/CSS from the corresponding theme's styled directory. Is this the intended behavior? I dug through the docs and found that customizations related to icons/CSS is applied via /var/cpanel/customizations directory. The default directory here seems to be linked to paper_lantern theme's directory. Here's the ls -l output:

Code:
[root@cpanel102 styled]# pwd
/var/cpanel/customizations/styled
[root@cpanel102 styled]# ls -l
total 0
lrwxrwxrwx 1 root root 58 Dec  6  2018 default_style -> /usr/local/cpanel/base/frontend/paper_lantern/styled/basic
My question is: am I doing something wrong or is this working as intended? My expectation was that sprites and such are associated with the theme associated with the user account. But the only way I seem to get icons changed is by directly modifying paper_lantern theme's contents. II'm guessing this is not the case cause otherwise, this wouldn't make sense:

Code:
/usr/local/cpanel/bin/sprite_generator --theme custom_theme
TLDR; I would like the sprites/icons/CSS associated with the custom theme's directory to be reflected when I login with a user account which has this theme selected.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! sorry for the delayed reply, but I wanted to reach out to our user experience team before I replied here to make sure I had all the correct information.

I confirmed that it is normal and expected for the theme name to not show up in the request URL.

We also don't believe the data inside /var/cpanel/customizations to be related to the issue, since that area would be specific to customizing Paper Lantern itself, and not related to one of the custom themes.

The targets of the symlinks for current_style and default_style will depend on where the sprites ended up. If you completely copied Paper Lantern to create their custom theme, the images would likely be in base/frontend/custom_theme/styled/basic/icons to get it to work. The spritesheet generator should then create the sprites in base/frontend/custom_theme/styled/basic/sprites

If you need more details than that, it would likely be best to open a ticket so we can check the theme implementation directly on the server.
 

sangeeths

Active Member
May 25, 2021
25
7
78
India
cPanel Access Level
Root Administrator
The targets of the symlinks for current_style and default_style will depend on where the sprites ended up. If you completely copied Paper Lantern to create their custom theme, the images would likely be in base/frontend/custom_theme/styled/basic/icons to get it to work. The spritesheet generator should then create the sprites in base/frontend/custom_theme/styled/basic/sprites
This is correct. And it works just fine, as in the sprites get generated in the right folder. Except the spite file and the CSS from these theme directories don't end up getting used. Here's what's shown for CSS when I use "View Source" after logging in as a cPanel user for whom the theme custom_theme was chosen during account creation:

1622827690635.png

The URL for this page is something like:

Code:
https://internal.company.com:2083/cpsessXXXXX/frontend/custom_theme/index.html?login=1&post_login=XXXXX
And I can verify the theme the CSS belongs to by modifying the sprite CSS and adding a comment on top in both paper_lantern and custom_theme directories. The one that gets loaded is the paper_lantern one.

Is there a step I'm missing, beyond selecting a custom theme from the select menu during account creation for the correct sprites to be picked up?
 
Thread starter Similar threads Forum Replies Date
H Developer Experience 3
N Developer Experience 1