[4.0] Fix the vendor css for the template#26077
[4.0] Fix the vendor css for the template#26077wilsonge merged 28 commits intojoomla:4.0-devfrom dgrammatiko:scss_fix
Conversation
|
Please resolve conflicting files so this PR can get tested at Worldwide Pizza, Bugs & Fun, October 19th |
|
@Quy do you have the css file |
|
Installed your branch. There is no |
|
@Quy Did you run |
|
Yes, both |
|
@Quy what's your OS? |
|
Testing locally with XAMPP on Windows 10 Home. |
|
@Quy thanks, I'll check why the build tools are failing to generate the css for winDOS |
|
@Quy can you give it another try? |
administrator/templates/atum/scss/vendor/fontawesome-free/fontawesome.scss
Outdated
Show resolved
Hide resolved
|
@Quy thank you, should fine now |
I know! The problem is that the original is loaded with webAssets, that for some reason doesn't pick up the override. If I try to override the css then the JS ends up not loading. I think @Fedik already has a PR that gives more granular access but till that PR is merged the original (from media) css file is also loaded here. |
|
well, it sounds like it better to allow to override vendor files in "old way" also, for j4 |
|
@wilsonge is there any interest on this one or should I move on? |
|
I have tested this item ✅ successfully on ab05717 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26077. |
1 similar comment
|
I have tested this item ✅ successfully on ab05717 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26077. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26077. |
|
Thanks! |
|
@dgrammatiko |
|
@infograf768 are the tags ok in that page? |
|
@infograf768 in the $wa = $this->getWebAssetManager();and after line 30 // Enable assets
$wa->enableAsset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr'));
$wa->enableAsset('fontawesome-free');
// TODO: remove the following line whenever the assets are fixed to respect the ovverides
HTMLHelper::_('stylesheet', 'vendor/choicesjs/choices.css', array('version' => 'auto', 'relative' => true));On a more serious note the assets for the iframes need some attention (eg the component.php needs to reflect the index.php) |
|
@infograf768 check #27187 |
all you need: $wa->enableAsset('fontawesome-free')->enableAsset('choices'); |
|
@Fedik this didn't work as it expects me to override both the css and the javascript. I wanted only the css from the choices to be overriden |






Pull Request for Issue # .
Joomla has a very well established pattern for overridding CSS and JS assets. You place the override file in the template specific folder and magic happens.
For some reason, instead of promoting modularity and the core functionality we end up making the css of the template a huge garbage bin, where anyone can append some css.
This should stop as the produced css is not maintainable and is spaggetti code that nobody could figure out where could be the source of a bug (cascading is already hard let's not make it even harder). Not to mention that performance also has a negative impact but that's minor in this case...
Summary of Changes
All the files that are loaded through an HTMLHelper should NOT be overridden with code internally to the template. This PR reverts it for the following external resources (vendor folder):
Testing Instructions
Check if anything is broken in the backend
(it shouldn't be as I'm still importing the original css, I know but then this PR is becoming a major refactor...)
Expected result
Actual result
Documentation Changes Required
PS there should be some QA for the scss of the template, the code is nowhere near beta state, just saying