T4: where should my own CSS go so a template update does not wipe it?
J
Asked by jamesdd
Pro + Launch ·6 October 2026
·Last activity 1 week ago
I changed a few styles directly in template.css and lost them after the last template update. What is the T4 way to keep my CSS?
- Product
- PX University 1.0.0
- Joomla
- 6.x
Solution
P
Phinb ThePixel team Solution
1 week ago · #110
Put it in templates//local/css/custom.css (create the folders if they are missing). T4 looks for a file in local/ first, then in the template, then in the framework's base theme – and it loads custom.css after template.css, so your rules win without !important. Template updates never ship a local folder, so nothing in there is overwritten. Two tips: - Use the theme colors instead of hex values, so a change in the Theme tab still applies: /* local/css/custom.css */ .course-card .btn { background: var(--color-primary); } .site-footer a:hover { color: var(--footer-link-hover-color); } - The Theme tab writes those variables to media/t4/css/