Branding
Logos
If you open core_components.ex you will find some functional components for your logo. You can use them in your templates like so:
<!-- Will adapt to the user's color scheme (light/dark) -->
<.logo variant="light" />
<.logo variant="dark" />
<.logo class="h-20" />
<!-- Display the icon part of your logo -->
<.logo_icon variant="light" />
<.logo_icon variant="dark" />
<.logo_icon class="h-20" />
For this to work with your own logo, you will need to replace the Petal logos:
-
/priv/static/images/logo_dark.svg -
/priv/static/images/logo_light.svg -
/priv/static/images/logo_icon_dark.svg -
/priv/static/images/logo_icon_light.svg -
/priv/static/images/favicon.svg -
/priv/static/images/open-graph.png
Using Figma to create your assets quickly
We created a Figma file to easily create and import these assets. Just replace the icon and text with your own brand, and Figma will export all 6 files for you to place straight into your /priv/static/images folder.
There are more detailed instructions inside the Figma file for you.
Colors
Petal Pro and Petal Components expects you to define a primary and secondary color. These typically represent your brand.
In /assets/css/colors.css you will see the primary and secondary colors defined as Tailwind v4 theme variables:
@theme {
--color-primary-50: var(--color-blue-50);
--color-primary-100: var(--color-blue-100);
/* ... through 950 ... */
--color-primary-950: var(--color-blue-950);
--color-secondary-50: var(--color-pink-50);
/* ... through 950 ... */
--color-secondary-950: var(--color-pink-950);
}
To change your brand colour, point every stop at another palette, e.g. swap blue for indigo. Keep it a plain @theme block, not @theme inline, or some utilities silently fall back to gray.
By default the primary color is blue, and the secondary is pink. You can check out a list of Tailwind color options here. If you want a custom color, you can check out tailwind.ink.