The Custom CSS Loader Plugin automatically loads custom CSS files from assets/custom/css/ for osTicket's Staff Panel and Client Portal based on filename patterns.
Perfect for teams that want to customize osTicket's appearance without modifying core files or managing complex theme systems.
What makes this plugin essential:
assets/custom/css/ and they're loaded automaticallystaff load in Admin Panel, files with client load in Client Portal?v=<timestamp> parameter ensures browsers load updated CSS| Requirement | Version | Notes |
|---|---|---|
| osTicket | 1.17+ | Uses output buffering for CSS injection |
| PHP | 8.1+ | Required for readonly classes and modern type system |
custom-css-loader folder to /include/plugins/ on your osTicket serverFinal path: /path/to/osticket/include/plugins/custom-css-loader/
cd /path/to/osticket/include/plugins
git clone https://github.com/markus-michalski/osticket-custom-css-loader.git custom-css-loader
The plugin automatically creates the CSS directory (assets/custom/css/) and copies demo files on first enable.
<osticket-root>/assets/custom/css/staff β Admin Panelclient β Client PortalNavigate to Admin Panel β Manage β Plugins β Custom CSS Loader β Configure
| Setting | Description | Default |
|---|---|---|
| Enable CSS Loading | Toggle CSS loading on/off | ON |
The plugin requires minimal configuration - simply enable it and add your CSS files.
Place your CSS files in:
<osticket-root>/assets/custom/css/
| Pattern | Where it loads | Examples |
|---|---|---|
*staff* |
Admin Panel (Staff) | custom-staff.css, wide-layout-staff.css |
*client* |
Client Portal | custom-client.css, branding-client.css |
Note: Files without staff or client in the name are ignored.
Security Note: Filenames must contain only alphanumeric characters, hyphens, and underscores (e.g., my-staff-theme.css). Files with special characters are blocked for security reasons.
The plugin includes demo CSS files in assets/demo/ with commented examples:
| Demo File | Purpose |
|---|---|
custom-staff.css |
Basic Admin Panel styling examples |
custom-client.css |
Basic Client Portal styling examples |
wide-layout-staff.css |
Expand container to 95% width (max 1800px) |
Copy the demo files you want to <osticket-root>/assets/custom/css/ and customize them.
Create assets/custom/css/wide-layout-staff.css:
/* Expand container from 960px to 95% width */
#container {
width: 95%;
max-width: 1800px;
margin: 0 auto 20px auto;
}
/* Blue header with corporate branding */
#header {
background-color: #1E3A5F !important;
background-image: none !important;
}
/* White logo and links */
#header a,
#header #info {
color: #FFFFFF !important;
}
Create assets/custom/css/branding-client.css:
/* Primary button color */
.btn-primary,
button.blue {
background-color: #3498db !important;
border-color: #3498db !important;
}
/* Link color */
a {
color: #2980b9 !important;
}
You can have multiple CSS files for each context. They are loaded in alphabetical order:
assets/custom/css/
βββ 01-variables-staff.css # Loaded first (Staff Panel)
βββ 02-layout-staff.css # Loaded second (Staff Panel)
βββ 03-branding-staff.css # Loaded third (Staff Panel)
βββ custom-client.css # Client Portal
βββ wide-layout-staff.css # Staff Panel
Symptoms:
Check:
Plugin enabled?
Plugin configured?
Files in correct directory?
ls -la /path/to/osticket/assets/custom/css/
Filename contains staff or client?
custom-staff.css β Loads in Admin Panelmy-client-theme.css β Loads in Client Portalcustom.css β Ignored (no pattern match)Filename valid?
my-staff-theme.css β Valid (alphanumeric, hyphens, underscores)staff theme.css β Blocked (contains space).hidden-staff.css β Blocked (starts with dot)File readable?
chmod 644 /path/to/osticket/assets/custom/css/*.css
Symptoms:
Check:
CSS syntax errors?
Specificity issues?
!important where needed:#header {
background-color: #1E3A5F !important;
}
Browser cache?
Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)?v=<timestamp> for cache-busting, but browser may still cacheSymptoms:
assets/custom/css/ doesn't exist after enabling pluginSolution:
Create manually:
mkdir -p /path/to/osticket/assets/custom/css
chmod 755 /path/to/osticket/assets/custom/css
Symptoms:
assets/custom/css/ exists but is empty after enabling pluginCheck:
Solution:
cp /path/to/osticket/include/plugins/custom-css-loader/assets/demo/*.css \
/path/to/osticket/assets/custom/css/
Plugin Structure (v2.0.0+):
custom-css-loader/
βββ plugin.php # Plugin metadata
βββ class.CustomCssLoaderPlugin.php # Main plugin class
βββ config.php # Plugin configuration
βββ src/ # Modern PHP 8.1+ architecture
β βββ Context/ # Context detection (Staff/Client)
β βββ Discovery/ # CSS file discovery
β βββ Rendering/ # HTML link tag rendering
β βββ Injection/ # Output buffer injection
β βββ CssLoaderOrchestrator.php # Main orchestrator
βββ assets/demo/ # Demo CSS files
βββ tests/ # PHPUnit tests (73 tests)
The plugin includes comprehensive security measures:
realpath()htmlspecialchars()The plugin uses output buffering to inject CSS:
<link> tags injected before </head>| Context | Detection Method |
|---|---|
| Staff Panel | OSTSCPINC constant OR /scp/ in URL path |
| Client Portal | OSTCLIENTINC constant OR .php file (not /scp/ or /api/) |
| API | /api/ in URL path β No CSS injected |
| CLI | No SCRIPT_NAME β No CSS injected |
Each CSS file gets a version parameter based on file modification time:
<link rel="stylesheet" href="/assets/custom/css/wide-layout-staff.css?v=1702483200">
Q: Does this plugin modify osTicket core files?
A: No! The plugin uses output buffering to inject CSS. No core files are modified.
Q: Can I disable the plugin temporarily without losing my CSS files?
A: Yes! Simply Disable the plugin in Admin Panel. Your CSS files remain in assets/custom/css/.
Q: Does this work with osTicket 1.17 or older?
A: Yes, the plugin is designed for osTicket 1.17+. It uses output buffering which is compatible with older versions.
Q: Can I have multiple CSS files?
A: Yes! All CSS files matching the pattern (*staff* or *client*) are loaded. They load in alphabetical order.
Q: Is it compatible with PHP 8.x?
A: Yes! The plugin requires PHP 8.1 or higher. It uses modern PHP features like readonly classes and union types.
Q: Does this work with custom osTicket themes?
A: Yes! The plugin simply adds CSS files after the theme's CSS. Your custom styles can override theme styles.
Q: Can I use this with other plugins?
A: Yes! The plugin uses a non-invasive injection method. It should work alongside any other plugin.
Q: What happens if I put a file without staff or client in the name?
A: The file is ignored. Only files matching the patterns are loaded.
Q: Does this affect API responses?
A: No, CSS is not injected for API requests.
Q: Why are my styles not applying?
A: Most likely a CSS specificity issue. osTicket's default styles may override yours. Use !important to ensure your styles take precedence.
Q: Where should I put the CSS directory?
A: CSS files go in <osticket-root>/assets/custom/css/, not in the plugin folder. This ensures your custom CSS survives plugin updates.
This Plugin is released under the GNU General Public License v2, compatible with osTicket core.
See LICENSE for details.
For questions or issues, please create an issue on GitHub:
Issue Tracker: https://github.com/markus-michalski/osticket-custom-css-loader/issues
When reporting issues, please include:
php -v)Developed by Markus Michalski
Contributions welcome!
See CHANGELOG.md for version history.