Issue with display of promoted labels #7573
-
|
Using the Trilium (Dark) theme, the promoted labels are arranged in a single row, but with the Legacy (Dark) theme, and any other theme I've tried, they form a column with as many rows as labels, and they are much taller than just a row of text. Worse, on my phone, the scrolling region for these is only tall enough to show one at a time, and is very difficult to scroll such a small area. I would much prefer if I could make them sort horizontally (and be a bit smaller). The fact that this was theme dependent led me to believe that I could fix this by tweaking the theme. I downloaded the "Midnight" theme and asked CoPilot for some code to control this. Unfortunately, nothing it proposed had any effect on this at all. Unfortunately, while I have about 40 years of experience in programming, most of that was in (Delphi) Pascal, and that ended years ago. I've done some Python since then, and a little CSS/HTML since then, I really don't know what I'm doing, so I need some guidence. Help will be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Hi @SESummers3! I'm Dosu and I’m helping the Trilium team. The difference in promoted label layout between Trilium themes is due to each theme's CSS rules—some use a horizontal row, others stack labels vertically. You can override this by adding custom CSS in Trilium. The recommended way is to create a new note, set its type to "code" and language to "CSS", add the .promoted-attributes-container {
display: grid !important;
grid-template-columns: repeat(auto-fit, minmax(200px, max-content)) !important;
gap: 8px !important; /* adjust spacing between labels */
align-items: center !important;
}
.promoted-attribute {
font-size: 0.95em !important; /* make labels a bit smaller */
padding: 2px 8px !important;
min-width: 0 !important;
max-width: 100% !important;
box-sizing: border-box !important;
}To apply:
If you want to improve mobile scrolling, you can add: .promoted-attributes-container {
overflow-x: auto !important;
-webkit-overflow-scrolling: touch !important;
}This approach works across themes and is the recommended way to customize layout and size of promoted labels in Trilium. There’s no built-in UI setting for this—CSS overrides are the way to go. If the changes don’t show up, double-check the note setup and reload the frontend. More details and examples are available in community discussions and how-to threads. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@SESummers3 , what version of Trilium are you using? |
Beta Was this translation helpful? Give feedback.
What’s happening is that Trilium’s promoted labels widget injects its own internal
<style>tag directly into the DOM, which sets properties likedisplay: tableandmax-height: 400pxon.promoted-attributes-container. This internal CSS is loaded after your theme and #appCss, so it overrides your changes—even with!important—unless your selector is more specific or you use a trick to increase its priority. There’s no Shadow DOM, but this embedded style tag acts like a high-priority CSS layer (see code reference).To override it, you need to use a more specific selector and
!important. Try this in your #appCss note: