Custom Text Device - align text to left

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
sloeber70
Posts: 23
Joined: Wednesday 08 July 2020 10:59
Target OS: Linux
Domoticz version: latest
Location: Bruges
Contact:

Custom Text Device - align text to left

Post 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?
Attachments
textbox.jpg
textbox.jpg (22.51 KiB) Viewed 431 times
Kind regards,
Sloeber70

Linux 12 Bookworm standard edition
Domoticz latest beta
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: Custom Text Device - align text to left

Post 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
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest