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:
13
README.md
13
README.md
@@ -709,7 +709,18 @@ void setup() {
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user