1
0
mirror of https://github.com/s00500/ESPUI.git synced 2026-01-16 18:46:21 +00:00

add example of using setCustomCSS + setPanelClass

This commit is contained in:
Mike Burton
2025-11-29 09:53:38 -08:00
parent f990016623
commit c8c41aa077

View File

@@ -709,7 +709,18 @@ void setup() {
The custom CSS is served at `/css/custom.css` and is automatically included in the `index.htm` file. The custom CSS is served at `/css/custom.css` and is automatically included in the `index.htm` file.
This can be used in conjunction with `setPanelClass` to apply custom CSS styles to controls. This can be used in conjunction with `setPanelClass` to apply custom CSS styles to controls. For example:
```cpp
// Make the value span of the panel red on error
ESPUI.setCustomCSS(".err span { color: red; }");
// Set the panel class to 'err' to make its value red
ESPUI.setPanelClass(<id>, "err");
```
For simpler styles without using classes, you can use `setElementStyle` or `setPanelStyle` instead.
# Notes for Development # Notes for Development