-
Notifications
You must be signed in to change notification settings - Fork 29
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
joomla-alert [a11y] #99
Comments
tagging @wilsonge as I am not sure anyone is looking at this repo |
I can easily do a pr for this if agreed and then someone will have to do a release |
I will take the "challenge" and work on it. Or you (@brianteeman) want to work on it and I will learn to do the release. The keyword "icon" can be as a stand alone name or with predefined names (like "info" etc.) or the name / path of an image... |
No you don't have to write the code or do the release all you have to do is to confirm or deny that it is an a11y improvement. You can't do the release anyway because you don't have the access. |
I don't understand the "configurable" statement. It is all CSS so it is already configured and like all CSS can be overridden. |
@brianteeman Think he means |
Yes ... if we use custom elements I think it should be as much as possible configurable BUT keep it simple. |
BTW - to your first question about A11y - as a blind color it is essential. I am not sure if it is expressed in the standard BUT the standard is focusing on blind people... |
NO - that would be wrong as it would be creating non-accessible content. If a user wants to do that then they can create css or replace the element. I am not going to be creating code that does that
That is complete garbage |
I will not argue with you ... you know everything better than other - enjoy! |
It is really sad that as accessibility team leader you think that the accessibility standards are focussed only for the blind. |
That not what I am saying - BUT regarding blind-color only few remarks.... |
I am not fighting - maybe your english let you down. As for the standards please see It is a basic principle of accessible design to make sure that colors are not your only method of conveying important information. |
thanks |
@C-Lodder do you have time to check my css and convert it to less? I am still learning less. |
@brianteeman - Yeah sure. Ping me when you're ready |
From my perspective the code on the codepen is as good as I will be able to make it. |
Just below: https://github.com/joomla-projects/custom-elements/blob/master/src/scss/_variables.scss#L61 add the following:
These are the encoded icon SVG's Then replace the this mixin: https://github.com/joomla-projects/custom-elements/blob/master/src/scss/alert/alert.scss#L41 with this:
Then finally in the same file at the very bottom, add the following which will loop though the array of icons:
I haven't tested this at all, so if the loop doesn't work, then try replacing |
it was $value ;) Thanks for the help |
dam hit a js problem We seem to have two different uses of the element When it is a "pop-up" and when it is "inline" When it is a "pop-up" there is a block in core.js that adds an h4 to the element eg But I cannot find what is the condition in the code that triggers that. What this means is that the css I have is great for when there is no title BUT when there is a title that css is no good. :( any suggestions? |
@brianteeman Can you send me the HTML markup from the browser inspector for both alerts in the screenshot above? |
Don't worry, got it from our fork where the docs actually work. The issue is that the You have a few options here.
|
Were you able to see what the condition was that decided if core.js should add the h4 tag |
Thank you, @brianteeman , for raising this issue. Of course, you are right. Color should not be the only way to convey information. Adding icons is a good solution. Thanks to this, the visually impaired and those who do not differentiate between colors will know the meaning of the messages. |
Doesn't this code already do that I presumed that type=warning role=alert was sufficient as I was told this had already been approved by a11y tea |
If that is not correct then once I find out the condition for the current js it should be easy to make it so that there is either a visible or a sr-only class on the h4 |
Brian, the h4 depends on whether or not the "title" has been passed |
that's what I thought but I couldnt see where the title was being passed from - i thought that it |
No, these attributes do not inform the user about the type of alert. |
My mistake for believing that when I was told these custom elements had all been approved by the a11y team that it wasn't true :( I will work out a way to do it once I get my head around the javascript. I dont want to have to update hundred of instances of the php code |
@brianteeman - it is not necessary, but it would be good :) |
it is necessary because when there is no title the colour is still being used to convey a meaning and you should never rely on colour alone |
Of course, you are right. However, in this case, apart from the color, we also have the content of the message. And it is the content that contains the meaning. Color is an additional information. The information is not given only in color. |
that depends if you are cognitively able to understand the text of the message. WCAG 2.1 is much more strict on cogntivie ability |
Full agreement. |
as soon as i work out the js I will ping you again - I have taken note of the comment about the h4 as well - thanks |
I am closing this - the alerts need a massive rewrite as they are being used completely wrong. It's not if this code is accessible or not but it is where it is being used in the cms. A modal alert is a style it is not necessarily a role=alert - they are not the same thing at all |
re-opening issue |
In J4 we currently have two types of alert. One uses a custom element and is a "popup" the other is a regular div or "inline". This PR is to improve the accessibility of the popup messages/alerts. Currently we make use of color which conveys no meaning for a color blind user. Accessibility golden rule is to never rely on just one visual indicator so this PR adds an icon. This also makes the popup alerts consisten with the inline alerts updated joomla#25116 Finally the title of the popup used an H4. @zwiastunsw requested here joomla-projects/custom-elements#99 (comment) that this was not good for accessibility as the headings may not be nested correctly. So I have changed the H4 to a class=alert-heading (I have not customised the style of that class as it would be a waste of time as the admin template would change it) It can always be styled later This is based on the discussions joomla-projects/custom-elements#99
@brianteeman Will you make the PR with changes suggested by C-Lodder, or shall someone else do that? |
In some places we are passing an icon to the alert eg
But in most places we don't and we rely on the colour of the alert to convey a meaning
For colour blind users this colour has no meaning and so we should always include either a title OR another visual indicator such as an icon.
To avoid rewriting joomla to pass an icon everytime we can simply do it with some css here and remove the calls to the icon (in the few places they exist) from the code.
Before
After
Example code
https://codepen.io/brianteeman/pen/zJMNGK
The text was updated successfully, but these errors were encountered: