Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange style behavior #34

Open
DetlefR opened this issue Sep 20, 2024 · 1 comment
Open

Strange style behavior #34

DetlefR opened this issue Sep 20, 2024 · 1 comment

Comments

@DetlefR
Copy link

DetlefR commented Sep 20, 2024

Hello,

I'm not sure is this a problem from CSS, Node-red or whatever.
I observe a strange behavior of style properties if I automatically format.
For example: I want to set the colors of numbers in a gauge.
<style> /* Zahlen */ #{{'gauge_'+$id}} .g-num:nth-child(n+0) {color: #dc080899;} #{{'gauge_'+$id}} .g-num:nth-child(n+4) {color: #101ed499;} #{{'gauge_'+$id}} .g-num:nth-child(n+6) {color: #1f940099;} #{{'gauge_'+$id}} .g-num:nth-child(n+9) {color: #101ed499;} #{{'gauge_'+$id}} .g-num:nth-child(n+11) {color: #dc080899;} </style>

Screenshot 2024-09-20 101817

If I format the code (or copy it to another gauge) the code looks like this
`<style>
/* Zahlen */
#{{'gauge_'+$id}
}

.g-num:nth-child(n+0) {
    color: #dc080899;
}

#{{'gauge_'+$id}
}

.g-num:nth-child(n+4) {
    color: #101ed499;
}

#{{'gauge_'+$id}
}

.g-num:nth-child(n+6) {
    color: #1f940099;
}

#{{'gauge_'+$id}
}

.g-num:nth-child(n+9) {
    color: #101ed499;
}

#{{'gauge_'+$id}
}

.g-num:nth-child(n+11) {
    color: #dc080899;
}

</style>`
and the gauge like this. ???

Screenshot 2024-09-20 102306

Any idea what do I wrong.

Best regards
Detlef

@DetlefR
Copy link
Author

DetlefR commented Sep 20, 2024

`<style>

/* Zahlen */

#{{'gauge_'+$id}} .g-num:nth-child(n+0) {color: #dc080899;}

#{{'gauge_'+$id}} .g-num:nth-child(n+4) {color: #101ed499;}

#{{'gauge_'+$id}} .g-num:nth-child(n+6) {color: #1f940099;}

#{{'gauge_'+$id}} .g-num:nth-child(n+9) {color: #101ed499;}

#{{'gauge_'+$id}} .g-num:nth-child(n+11) {color: #dc080899;}

</style>`
Sorry

the working code looks like this without empty lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant