[GH-ISSUE #625] Suggestion: custom CSS themes #443

Open
opened 2026-03-02 15:58:48 +03:00 by kerem · 3 comments
Owner

Originally created by @nitodico on GitHub (Sep 11, 2021).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/625

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

Originally created by @nitodico on GitHub (Sep 11, 2021). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/625 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](https://user-images.githubusercontent.com/49000973/132939938-0b19b8ed-8f8e-4801-b0c6-0c79c9f7c088.png)
Author
Owner

@tapmeppe commented on GitHub (Jun 22, 2024):

The same goes for custom.js .

<!-- gh-comment-id:2183987239 --> @tapmeppe commented on GitHub (Jun 22, 2024): The same goes for **custom.js** .
Author
Owner

@tapmeppe commented on GitHub (Jun 22, 2024):

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

<!-- gh-comment-id:2183988347 --> @tapmeppe commented on GitHub (Jun 22, 2024): I could do a pull request of both. Would that be okay?
Author
Owner

@elektrischerwalfisch commented on GitHub (Apr 9, 2025):

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.

<!-- gh-comment-id:2788782062 --> @elektrischerwalfisch commented on GitHub (Apr 9, 2025): 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#443
No description provided.