Page 1 of 1

Custom Text Device - align text to left

Posted: Saturday 25 January 2025 16:02
by sloeber70
Hi,

I have been searching the custom.css and done some try and error, investigations, so that a text box entry would start on the left side instead of being aligned to the right. That would solve a lot of things for me since I use a lot of those textboxes.

custom.css extraction: altering these settings does not change anything - I do clear browser cache each time I alter the css.

.item #status,
.item .status {
color: var(--main-text-color);
grid-area: status;
align-self: center;
justify-self: right;
text-align: right;

padding-right: 20px;
max-height: 60px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--main-blue-color) var(--main-bg-color);

Any suggestions?

Re: Custom Text Device - align text to left

Posted: Sunday 26 January 2025 13:06
by RonkA
Maybe this helps?

For my dzVents text devices i use a monospace font like Consolas to get a fixed width of the texts, Very important!

Define the maximal length of the line of text; this is tricky because there is a difference between desktopview and tabletview and even between the tabs for dashboard and utility so choose wise.. for me its 38 characters on a single line for desktop/dashboard.
Count the characters in the text, substract this number from the maximal length and use this value to add 'empty' characters(Not use space!)

I use: string.rep(' ', segment_empty) to start the line and then add the text i want to display.

Look at this for some inspiration: viewtopic.php?p=317501#p317501 and viewtopic.php?p=317029#p317029