tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

Suggestion: custom CSS themes

Open nitodico opened this issue 4 years ago • 3 comments

The idea gettting custom CSS themes is possible? i was doing some testing and somewhere on line 3652 i just added

if(file_exists(__DIR__."/custom.css")) echo file_get_contents("custom.css");

Adding a single line could lead to designers to submit custom CSS themes

image

nitodico avatar Sep 11 '21 07:09 nitodico

The same goes for custom.js .

tapmeppe avatar Jun 22 '24 11:06 tapmeppe

I could do a pull request of both. Would that be okay?

tapmeppe avatar Jun 22 '24 11:06 tapmeppe

Are there any new developments on this subject?

I would also find a custom css extremely usefull especially for things like setting a max-width for the main layout so that the filemanager does not spread across the whole browser-window (More user-friendly in some cases).

I'd love to propose official support for an optional custom stylesheet that:

  • is registered in $external only if it exists,
  • and can be safely printed via print_external('custom-css') in the template.

Example Implementation

Add below line 166:

// Uncomment & modify the following line to add support for custom stylesheet
// $customCssPath = 'theme/custom-style.css';
if (file_exists(__DIR__ . '/' . $customCssPath)) {
    $external['custom-css'] = '<link href="' . $customCssPath . '" rel="stylesheet">';
}

Add below line 3829 and 3993:

<?php print_external('custom-css'); // add optional custom-css if it exists ?>  

This keeps things clean and avoids breaking anything if no custom style is provided.

elektrischerwalfisch avatar Apr 09 '25 08:04 elektrischerwalfisch