User tests: Successful: Unsuccessful:
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...
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):
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...)
PS there should be some QA for the scss of the template, the code is nowhere near beta state, just saying
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Templates (admin) JavaScript Repository |
Labels |
Added:
?
|
Labels |
Added:
Conflicting Files
|
Labels |
Removed:
Conflicting Files
|
Installed your branch. There is no vendor
directory.
Yes, both npm i
and npm ci
. Still no go.
Testing locally with XAMPP on Windows 10 Home.
It is still an issue. Please let me know when to test again. Thanks.
Did you run npm I
and cleaned the browser cache? Works fine here...
what's your browser?
Tested with Firefox 69.0.3 and Chrome 77.0.3865.120. Icons with class icon-
don't display properly.
FontAwesome 5 now requires a font-weight of 900 on the pseudo class. Try adding the following to the start of the _icons.scss ...
[class*=" icon-"]::before,
[class^="icon-"]::before,
.btn::after {
font-weight: 900;
}
hmm
I can't get npm ci to work here
Internal Error: File to read not found or unreadable: /Applications/MAMP/htdocs/newfolder/joomla40/administrator/templates/atum/scss/vendor/minicolors/minicolors.scss
sh: line 1: 25356 Segmentation fault: 11 node build.js --compile-css
If I redo, then I get
Internal Error: File to read not found or unreadable: /Applications/MAMP/htdocs/newfolder/joomla40/administrator/templates/atum/scss/vendor/choicesjs/choicesjs.scss
sh: line 1: 25484 Segmentation fault: 11 node build.js --compile-css
Category | Administration Templates (admin) JavaScript Repository | ⇒ | Administration Templates (admin) JavaScript Repository NPM Change |
I have tested this item
apply patch
run npm i
some icons are missing
Labels |
Added:
NPM Resource Changed
|
I hope this is the right file you want to see:
https://gist.github.com/nadjak77/cc199b47dc8309c16341a3776c817048
this is the template.css with your patch
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
I have tested this item
I have tested this item
Status | Ready to Commit | ⇒ | Pending |
Labels |
Removed:
?
|
need more details, what exactly problem
what you do and what you get?
@Fedik should be easy to replicate:
using the 4.0-Dev branch, In the atum/css folder create create a folder vendor/fontawesome-free. In this newly created folder create a css file named font awesome.css with some dummy content. The expected behavior is that the newly created css should be delivered instead of the media/vendor/fontawesome-free/...
But it isn’t
All libs from /media/vendor
has strict path in its own asset, see /media/vendor/joomla.asset.json
{
"package": "@fortawesome/fontawesome-free",
"name": "fontawesome-free",
"version": "5.9.0",
"css": [
"media/vendor/fontawesome-free/css/fontawesome.min.css"
]
},
(btw it should be "name": "fontawesome",)
It can be overridden by overriding the asset.
that why you had:
{
"name": "fontawesome",
"css": [
"fontawesome.min.css"
]
}
in the template. This override asset "fontawesome" to use another file(s).
There are still two instances of choices.css
loaded.
There are still two instances of choices.css loaded.
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
I try to update that PR some time later, or I will do another one, will see
I have tested this item
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-30 21:41:13 |
Closed_By | ⇒ | wilsonge |
Thanks!
@dgrammatiko
Looks like atum specific choice.css is not loaded in com_associations.
@infograf768 are the tags ok in that page?
@infograf768 in the atum/component.php
add
after line 17
$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
$wa->enableAsset('fontawesome-free');
all you need:
$wa->enableAsset('fontawesome-free')->enableAsset('choices');
Please resolve conflicting files so this PR can get tested at Worldwide Pizza, Bugs & Fun, October 19th