1
0
mirror of https://github.com/s00500/ESPUI.git synced 2026-03-15 14:20:48 +00:00

Implement setCustomCSS for custom CSS injection

This commit introduces `setCustomCSS` to the ESPUI class, allowing users to inject custom CSS into the web interface, analogous to `setCustomJS`.

Changes include:
- Added `setCustomCSS` method to `ESPUI.h` and `ESPUI.cpp`.
- Added `/css/custom.css` route handler in `ESPUI.begin`.
- Updated `src/dataIndexHTML.h` to include the link to `/css/custom.css` in both `HTML_INDEX` and `HTML_INDEX_GZIP`.
This commit is contained in:
google-labs-jules[bot]
2025-11-22 22:08:37 +00:00
parent a20fe6a4d6
commit 41c75cc41e
3 changed files with 28 additions and 2 deletions

View File

@@ -206,6 +206,11 @@ public:
// This is intentionally not a String to avoid dynamic memory allocation.
void setCustomJS(const char* js);
// Set optional user-defined CSS to be included in the UI.
// css: CSS code as a C-string. Must remain valid for the lifetime of the ESPUIClass instance.
// This is intentionally not a String to avoid dynamic memory allocation.
void setCustomCSS(const char* css);
// Variables
const char* ui_title = "ESPUI"; // Store UI Title and Header Name
Control* controls = nullptr;