New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Template Atum - Change Alerts styling - Space saving #28974
[4.0] Template Atum - Change Alerts styling - Space saving #28974
Conversation
btw can you match the border radius of the input fields? This is way too aggressive |
Ah I was blind - also the joomla-alert.scss was not existing there :-) thanks a lot!!! Will change it in the next commit :-) |
yes, will do, thanks! |
Use this as your guide (it's the old code before moving to inline): https://github.com/joomla/joomla-cms/blob/08b27e74737f859c6a873c661df268ca4a7f148b/administrator/templates/atum/scss/vendor/joomla-custom-elements/joomla-alert.scss |
how do I compile it @dgrammatiko ? npm run build:css and npm ci does not work... |
You need to re add the file in the build tools: I shouldn't have asked @ciar4n to remove it in the first place 😂 |
Add scss to the building process
@dgrammatiko thank you for your fast help on this, now the PR can be tested :-) |
Should this styling extend to all alerts (e.g.. sample data plugin). If yes then would make more sense to have these changes upstream on the custom elements repo, |
On a wide screen with a short message the close x is a long way from the text where the eye is focused - as I type this I realise that this is true in J3 as well - still this is an opportunity to change that |
@infograf768 I'm just trying to make the point that we don't need multiple different styles of alerts. Whatever styling is chosen should be the same for all alerts unless there is good reason for otherwise. |
Why are not all Alerts in the same styling? Thought the backend template would be the right place? Can you give me an advise what to do? I think styling should be done by the template... |
@infograf768 thank you will test with RTL with the next changes too.
@brianteeman - How about a close text right after the message in a new line? Additionally not instead of the close icon at the top right? |
I think you will need to check that with the accessibility team |
It is done by the template, the file you just created affects only this template. The reasons why the css should not be inside the template.css are:
If you update the other repo styles it means that every template will get these styles, (eg cassiopeia and every other front end or back end template [given that they're not utilising an override]). I think leaving the default look as a close resemblance of the BS alerts will be the expected (eg most front end templates are, sadly, still based on BS)
You don't need the text visible, the text exists for the screen readers but is not visible for the rest. Kinda expected behaviour |
Fair point. In that case, I'd suggest not importing the CSS from the custom elements repo. Otherwise, you are largely styling the same element twice. |
Your CSS is only been applied to the system alerts so all other alerts are using the custom-element repo CSS.
Sure. I'd suggest removing the import from the custom element repo (https://github.com/joomla/joomla-cms/pull/28974/files#diff-eb1f14c7c40e114d5c452c3f49b97355R2) and instead copy it to the template. Edit as needed instead of overriding. |
Sorry there was a misunderstanding, with "by the template" I meant inside atum, no matter if separate file or not. I think we are on the same track here :-)
yes, agree on that, that's why I asked - I asked the question because I wondered why the styles I created where not applied to the other alerts. Since clarification from Ciaran I understand now :-)
No I meant to add a close Link or Button right after the message as an alternate way to close the alert. Additionally to the cross at upper right. That's how some modals also are displayed these days... |
I'm getting that before patch. I can't reproduce the "before" styling shown in this PR. |
@coolcat-creations Your 'before' screenshot is incorrect. You will need to run |
Changes are looking quite good so far, but some space might be needed between the X and the content. Centering the left headline vertically would be nice, too. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28974. |
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28974. |
@coolcat-creations
to center "Message" or "Warning", etc., I suggest:
Give some space around the close button
|
BTW, I also found the reason why the message displayed in the login page is not similar (the alignment of the text value) to the ones in admin general. I'm pretty sure there is a simpler way than modifying the message.es6 to fit, i.e.
to
That would be for another PR but calling |
hm, why we have a |
@Fedik |
see https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/system/message.php#L51 and except for login.php, it is that layout which is used |
I think upd: it can be as in j3, a div with some class joomla-cms/layouts/joomla/system/message.php Lines 23 to 30 in 6e84eb7
|
Ok. this means modifying both the layout and the es6 file first before a refactoring of this PR here as css have to be changed. |
yeap, that should be easy I think and your code for js also looks correct for // Add messages to the message box
typeMessages.forEach((typeMessage) => {
messageWrapper = document.createElement('div');
messageWrapper.innerHTML = `<div class="alert-message">${typeMessage}</div>`;
messagesBox.appendChild(messageWrapper);
}); |
I think it also can be part of this PR |
yep. easy. will keep the div instead of the H4 in the layout |
@coolcat-creations
|
@infograf768 thank you so much for your help on this. In the moment I am very occupied in teaching a class of kids and I have no clue how to merge your diff. Can you create a new PR and I will close this one? That would help me very much. Thanks a lot!!! |
Thanks @coolcat-creations here is the PR to test: #30294 |
Summary of Changes
Changed the Header of the message to be next to the message to save space
Decreased paddings
Changed colors
Testing Instructions
See if you like the new style and if not, tell me what you would prefer instead.
Before:
After:
thank you @dgrammatiko for the hints where to change everything :-)