Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[typhoon] Color Logo dark/light #413

Open
jfouret opened this issue Feb 17, 2024 · 2 comments
Open

[typhoon] Color Logo dark/light #413

jfouret opened this issue Feb 17, 2024 · 2 comments
Assignees
Labels
typhoon Typhoon theme

Comments

@jfouret
Copy link

jfouret commented Feb 17, 2024

Hi,

Is there a way to define specific colors for dark and light mode in the logo ?
Maybe by modifying the style section of the svg code ?
If yes could you provide me with a simple example with the grav logo with 2 colors for light and 2 alternative colors for dark ?

thx,

@jfouret jfouret added the typhoon Typhoon theme label Feb 17, 2024
@rhukster
Copy link
Member

probably the simplest way to do this is to simply have 2 logos.. one for light and on for dark. keep them the same size of course, just change the colors in each.

Assuming you have a custom theme created based on Typhoon, you can simply replace the contents of the templates/partials/logo.html.twig with your custom logo solution. Something like:

<div class="block dark:hidden">
  <svg class="logo__light">....</svg>
</div>
<div class="hidden dark:block">
  <svg class="logo__dark>...</svg>
</div>

This method of showing/hidding based on light/dark will work equally as well for PNG or JPG type logos, you are not restricted to SVGs.

While you could try to get manipulating the colors in the SVG itself changing via Tailwind classes, it's going to be complicated by a number of factors. How complex is the SVG? does it have multiple different colors, can you target them with CSS? etc. This is a much more advanced approach, and I don't recommened it for the average user. Try the approach I outlined above.

@jfouret
Copy link
Author

jfouret commented Feb 23, 2024

Sorry for the lack of info.

I am using the typhoon premium theme using the admin graphical interface only. https://getgrav.org/premium/typhoon.

My logo is attached. For now, I found out that the "style strip option" does not strip color gradients. For me it's fine since my gradient colors are ok in both dark and light mode and the text colors are still edited with the "style strip option".

Since I found this alternative solution that is fine looking it's okay we can close.

Thanks,

Nexomis_small_page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typhoon Typhoon theme
Projects
None yet
Development

No branches or pull requests

2 participants