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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user