<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Benjamin on Medium]]></title>
        <description><![CDATA[Stories by Benjamin on Medium]]></description>
        <link>https://medium.com/@benjamin_5704?source=rss-9ff68465cd3b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6NmWX5baYr8JDklnzlVaAw.png</url>
            <title>Stories by Benjamin on Medium</title>
            <link>https://medium.com/@benjamin_5704?source=rss-9ff68465cd3b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:30:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@benjamin_5704/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to create a custom passbolt theme with the UI Kit]]></title>
            <link>https://medium.com/passbolt/how-to-create-a-custom-passbolt-theme-with-the-ui-kit-661f3b19a21b?source=rss-9ff68465cd3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/661f3b19a21b</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[password-management]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[storybook]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Benjamin]]></dc:creator>
            <pubDate>Thu, 18 Aug 2022 09:42:14 GMT</pubDate>
            <atom:updated>2023-03-30T09:47:16.069Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eoIFQTH3izAjHQOq" /></figure><h4>With the recent availability of the UI kit, it is now easier than ever to customize your passbolt. We will demonstrate it in this step by step tutorial by explaining how you can create your own custom passbolt theme.</h4><p>Note that this tutorial covers only the theme creation inside the UI Kit. The part II of this tutorial will follow soon and will explain how to import and integrate the new theme inside the passbolt UI.</p><p>Let’s go!</p><h3>Step 1: Install and launch the StoryBook UI kit</h3><h3>Prerequisites</h3><p>Before launching the UI Kit, node with npm must be installed on the machine.</p><p>Node: <a href="https://nodejs.org/en/download/">download</a> (LTS version)</p><h3>UI Kit installation</h3><p>Open a terminal and follow the instructions to setup Storybook:</p><p>First, install Grunt’s command line interface (CLI) globally:</p><pre>sudo npm install -g grunt-cli</pre><p>Then, clone the repository:</p><pre>git clone <a href="https://github.com/passbolt/passbolt_styleguide.git">https://github.com/passbolt/passbolt_styleguide.git</a></pre><p>And access to the folder:</p><pre>cd passbolt_styleguide</pre><p>Now we copy the file needed to start the creation of a custom theme:</p><pre>cp src/less/abstractions/colors_custom.sample.less src/less/abstractions/colors_custom.less</pre><p>Then, install all dependencies:</p><pre>npm run dev:storybook:install</pre><p>And build all CSS files:</p><pre>npm run dev:build:custom-theme</pre><p>Finally, run storybook:</p><pre>npm run dev:storybook:start</pre><p>Storybook should normally be available from your browser at the following url: <a href="http://localhost:6006/">http://localhost:6006/</a></p><p>Open another terminal in the passbolt_styleguide project directory and execute the command:</p><pre>npm run dev:watch:custom-theme</pre><p>This command will watch for any change and continuously build the updates.</p><p>To see the change in Storybook, reload the page or go to another story (note: a story is a storybook section).</p><h3>UI Kit structure and usage</h3><p>To make it easier to list the color palettes during the creation of a theme, a theme story that contains all the useful variables is present. You can find it under the “Foundations &gt; Theme &gt; Default” section.</p><p>All the theme variables have a name and description to provide a bit of context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3EDfmTDBhr333ykI" /><figcaption><em>Fig. Colors on Storybook (source: </em><a href="https://passbolt.github.io/passbolt_styleguide"><em>Storybook</em></a><em>)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HAFmOkwmkCDFKezA" /><figcaption><em>Fig. Password workspace on Storybook (source: </em><a href="https://passbolt.github.io/passbolt_styleguide"><em>Storybook</em></a><em>)</em></figcaption></figure><h3>Two brand new “Solarized” themes</h3><p>You will notice that two new themes have appeared in the UI Kit which are not available yet in passbolt: <a href="https://passbolt.github.io/passbolt_styleguide/?path=/story/workspaces-resource--pro-version&amp;globals=themes:solarized_light">Solarized light</a> and <a href="https://passbolt.github.io/passbolt_styleguide/?path=/story/workspaces-resource--pro-version&amp;globals=themes:solarized_dark">Solarized Dark</a>.</p><p>These themes are based on the solarized themes, inspired by the work of Ethan Schoonover, you’ll find more information about his color palette <a href="https://ethanschoonover.com/solarized/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y9GqFAnAjjd6a8T2" /><figcaption><em>Fig. Password workspace with the Solarized light theme on Storybook (source: </em><a href="https://passbolt.github.io/passbolt_styleguide"><em>Storybook</em></a><em>)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oq4OSBLiJiCkQa56" /><figcaption><em>Fig. Password workspace with the Solarized dark theme on Storybook (source: </em><a href="https://passbolt.github.io/passbolt_styleguide"><em>Storybook</em></a><em>)</em></figcaption></figure><p>Do you like these 2 new “Solarized” themes? If yes, let us know in <a href="https://community.passbolt.com/c/themes/12">the community forum</a>. The most popular themes will become eligible to be integrated in the future versions of passbolt.</p><h3>Step 2: Create your custom theme</h3><h3>Use the “custom” playground theme as a base</h3><p>To simplify the creation of a custom theme, a ready-to-use-and-customize custom theme is already provided in the storybook UI Kit. To edit the “custom” theme, you will need to work directly on the source files with the IDE of your choice. <strong>Note that it is currently not possible to edit a theme from inside the storybook itself.</strong></p><p>The “custom” theme is mostly composed of one Less file located in <strong>src/less/abstractions/colors_custom.less. </strong>The file is mainly composed of color variables but also includes some variables referring to other visual aspects such as svg images. It is primarily this file that you need to modify in order to customize the theme.</p><p>When a color has been updated in <strong>src/less/abstractions/colors_custom.less</strong>, you will need to choose the theme “custom” in the storybook so that it reflects the changes, as illustrated below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/0*26umfpekRy8-JKWK" /><figcaption><em>Fig. Custom theme selection in Storybook (source: </em><a href="https://passbolt.github.io/passbolt_styleguide"><em>Storybook</em></a><em>)</em></figcaption></figure><h3>Palette explanations</h3><p>The Less theme file uses a color palette where colors are named according to the <a href="https://www.color-name.com/">color-name website</a>.</p><pre>/* palette */</pre><pre>@main-color: hsl(44,87%,98%);</pre><pre>@text-icon-main-color: hsl(194,81%,14%);</pre><pre>@workspace-bar: hsl(194,81%,14%);</pre><pre>@workspace-text: hsl(194,81%,40%);</pre><pre>@primary-color-1: hsl(194,100%,25%);</pre><pre>@primary-color-2: hsl(194,100%,20%);</pre><pre>@primary-color-3: hsl(194,100%,15%);</pre><pre>@primary-color-4: hsl(194,100%,10%);</pre><pre>@success-1: hsl(68,100%,30%);</pre><pre>@success-2: hsl(45,100%,35%);</pre><pre>@warning-1: hsl(18,80%,54%);</pre><pre>@warning-2: hsl(18,80%,64%);</pre><pre>@warning-3: hsl(18,80%,74%);</pre><pre>@warning-4: hsl(18,80%,44%);</pre><pre>@alert-1: hsl(1,71%,52%);</pre><pre>@alert-2: hsl(1,71%,62%);</pre><pre>@alert-3: hsl(1,71%,72%);</pre><p>You will notice that the custom theme is, by default, composed of a few primary colors that are later declined in various shades with the use of the <a href="https://www.w3schools.com/colors/colors_hsl.asp">hsl</a> (hue, saturation and lightness) magic. This means that it is possible to create an entire and consistent theme by just modifying a few variables, the rest of the colors will be calculated automatically.</p><p>Of course, it’s also possible to go old school and edit all the variables by hand with an hexadecimal value. This takes more time but has the advantage of providing more control.</p><h3>Specific variables</h3><p>In the file, the variables for the logo must remain unchanged.</p><pre>/* logos */</pre><pre>@logourl: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/logo_white.svg%E2%80%99);</pre><pre>@passbolt-icon-without-badge: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-without-badge.svg%E2%80%99);</pre><pre>@passbolt-icon-badge-1: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-badge-1.svg%E2%80%99);</pre><pre>@passbolt-icon-badge-2: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-badge-2.svg%E2%80%99);</pre><pre>@passbolt-icon-badge-3: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-badge-3.svg%E2%80%99);</pre><pre>@passbolt-icon-badge-4: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-badge-4.svg%E2%80%99);</pre><pre>@passbolt-icon-badge-5: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-badge-5.svg%E2%80%99);</pre><pre>@passbolt-icon-badge-5-plus: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-badge-5+.svg%E2%80%99);</pre><pre>@passbolt-icon-inactive: url(https://medium.com/%E2%80%98@%7Bimages%7D/logo/icon-inactive.svg%E2%80%99);</pre><p>The shadow opacity variables can be changed at will:</p><pre>/* box shadows */</pre><pre>@shadow-opacity-hover-black: 0.5;</pre><pre>@shadow-opacity-hover-white: 0.25;</pre><pre>@shadow-opacity-active-white: 0.25;</pre><pre>@shadow-opacity-active-black: 0.5;</pre><pre>@shadow-opacity-dropdown: 0.5;</pre><pre>@shadow-opacity-select: 0.5;</pre><pre>@shadow-opacity-info-panel: 0.75;</pre><p>The checkbox uses a svg image for the check and it’s only available in white and black.</p><pre>/* controls */</pre><pre>@controls-check:url(https://medium.com/%E2%80%98@%7Bimages%7D/controls/check_black.svg%E2%80%99);</pre><pre>@controls-check:url(https://medium.com/%E2%80%98@%7Bimages%7D/controls/check_white.svg%E2%80%99);</pre><h3>Custom theme example: Black Midgar</h3><p>To illustrate a new theme creation, let’s first try to remake a darker version of Midgar which we will call Black Midgar 🤘.</p><p>For this theme we’ll go old school and edit all the color variables by hand.</p><p>As you already know, a new section with workspaces has been added to visualize most of the colors at one glance. Let’s switch to the “Custom” theme and edit the colors_custom.less file.</p><p>Each of the palette variables can be directly replaced with CSS colors and can be specified by the following usual methods:</p><ul><li>Hexadecimal colors</li><li>Hexadecimal colors with transparency</li><li>RGB colors</li><li>RGBA colors</li><li>HSL colors</li><li>HSLA colors</li></ul><p>The process is quite straightforward, each time the colors_custom.less is saved, the modifications are visible on Storybook after you refresh a component.</p><h3>Let’s do it</h3><p>Alright, here it is. Our black midgar theme can be created with the following color combination, available as a <a href="https://gist.github.com/kevinmuller/ae58ac595bfd2919b89b4bd7fecdd8e9">Github Gist</a> for better readability.</p><p>Download the gist and replace the content of the <em>src/less/abstractions/colors_custom.less</em> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FmZr8uztIwXuVlGW" /><figcaption><em>Fig. Custom palette variables for the Black Midgar theme, in our IDE (source: </em><a href="https://code.visualstudio.com/"><em>Visual Studio Code</em></a><em>)</em></figcaption></figure><p>Then save it and refresh the storybook to see the magic. You should be able to see a screen similar to the one below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NSvWUoAXEcNaH5mU" /><figcaption><em>Fig. Password workspace with the custom theme “Black Midgar” on Storybook (source: </em><a href="https://passbolt.github.io/passbolt_styleguide"><em>Storybook</em></a><em>)</em></figcaption></figure><p>That’s it! Our “Black Midgar” theme is now ready in the UI Kit.</p><h3>Disclaimer</h3><p>You may experience some limitations due to the lack of variables for the font color.</p><p>For example if the font is set to @white as well as its context background (like @input-background), the text will not be visible.</p><p>This issue will be fixed in a future release.</p><h3>Naming your theme</h3><p>Once you are happy with the colors combination for your new theme, it is now time to name it. For this example, we’ll stick to the “Black Midgar” name which we enthusiastically went for above.</p><h3>Create the theme files</h3><p>Copy-paste the colors_custom.less into colors_black-midgar.less.</p><p>Then, copy-paste the directory src/less/themes/custom and all its content into src/less/themes/black_midgar</p><p>It should contain the following files:</p><p>src/less/themes/black_midgar/api_authentication.less</p><p>src/less/themes/black_midgar/api_main.less</p><p>src/less/themes/black_midgar/api_reports.less</p><p>src/less/themes/black_midgar/ext_app.less</p><p>src/less/themes/black_midgar/ext_authentication.less</p><p>src/less/themes/black_midgar/ext_in_form_cta.less</p><p>src/less/themes/black_midgar/ext_in_form_menu.less</p><p>src/less/themes/black_midgar/ext_quickaccess.less</p><p>Modify all these files and make sure that they import the colors_black-midgar.less file instead of colors_custom.less</p><pre>@import “../../abstractions/colors_black-midgar.less”;</pre><h3>Reference the new theme</h3><p>Then, add the new theme in the Gruntfile.js to build the css:</p><pre>theme_custom: {</pre><pre>expand: true,</pre><pre>flatten: true,</pre><pre>cwd: “src/less/themes/black_midgar”,</pre><pre>src: “*.less”,</pre><pre>dest: “src/css/themes/black_midgar”,</pre><pre>ext: “.css”</pre><pre>},</pre><p>Additionally, add the new theme in Storybook in the preview.js file in the themes object:</p><pre>items: [</pre><pre>{ value: ‘default’, title: ‘Default’},</pre><pre>{ value: ‘midgar’, title: ‘Midgar’},</pre><pre>{ value: ‘black_midgar’, title: ‘Black Midgar’}</pre><pre>],</pre><p>Note: a simpler way to customize the theme is in the roadmap, stay tuned.</p><h3>Publishing your new theme</h3><p>Note: It is currently not possible to publish directly a newly created theme in passbolt.</p><p>If you’d like to see your theme integrated in a future release of passbolt, we invite you to submit a merge request with your proposal directly on the style guide github repository, and create a thread in the <a href="https://community.passbolt.com/c/themes/12">community forum</a> to discuss it. If there are enough votes for it, we’ll integrate it first in the official style guide, and perhaps in a release later on (we can’t promise but we’ll definitely consider it).</p><h3>Share your thoughts</h3><p>Did you enjoy this post? Or maybe you would like us to go further and explore more possibilities for the community to create their own themes? As usual, let us know in the community forum.</p><p>❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661f3b19a21b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/passbolt/how-to-create-a-custom-passbolt-theme-with-the-ui-kit-661f3b19a21b">How to create a custom passbolt theme with the UI Kit</a> was originally published in <a href="https://medium.com/passbolt">passbolt</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>