Skip to content
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] [a11y] Contrast of Drop down chevron #28680

Closed
wants to merge 2 commits into from

Conversation

astridx
Copy link
Contributor

@astridx astridx commented Apr 14, 2020

Draft for Issue #28673.

Edit: To test this draft, it is necessary to use the npm ci command, as SCSS files need to be compiled.

Summary of Changes

I made it possible, that the drop down chevron on success and danger drop downs is white (not black).
For the red danger background the Contrast Ratio is even worse. It is 3.71.

When editing a module, the white arrow also fits better with the calendar symbol at start publishing.
Modules  Breadcrumbs   test   Administration

Next you see the white chevron on a drop down with the green success background while editing a plugin. Note: The chevrons on the drop downs with the gray background are still black.

Plugins  Action Log   Joomla   test   Administration

I made this as a draft, because I am not sure, if I understand the way we want to handle multiple background elements. Perhaps someone like to teach me?

@Quy
Copy link
Contributor

Quy commented Apr 14, 2020

See #28463 for hint to solve the issue.

@richard67 richard67 changed the title [4.0] [a11y] Conrast of Drop down chevron [4.0] [a11y] Contrast of Drop down chevron Apr 14, 2020
color: theme-color("success");
background-color: theme-color("success");
border-color: theme-color("success");

[dir=rtl] & {
background: $custom-select-background-light-rtl;
color: theme-color("success");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to redefine these color properties in RTL (color, bg and border)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ciar4n, but I need color, bg and border for rtl, as it is set for the variable
$custom-select-background-light-rtl and I have to override it.

Without
ماژول ها  مسیر سایت   test   مدیریت

With
ماژول ها  مسیر سایت   test   مدیریت(1)

I could set the properties in the variable $custom-select-background-light-rtl differently. But in my opinion, this would make a bigger mess because it would be very different from $custom-select-background-rtl.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I see why you might need background-color as you are re-setting the color to transparent with background: $custom-select-background-light-rtl;. The border and color should be fine without but maybe I'm missing something.

color: theme-color("danger");
background-color: theme-color("danger");
border-color: theme-color("danger");

[dir=rtl] & {
background: $custom-select-background-light-rtl;
color: theme-color("danger");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to redefine these color properties in RTL (color, bg and border)

@brianteeman
Copy link
Contributor

I dont understand why there is a new image. I though the whole point of using an svg is that you can change its colour using css eg fill: white

@ciar4n
Copy link
Contributor

ciar4n commented Apr 15, 2020

I dont understand why there is a new image. I though the whole point of using an svg is that you can change its colour using css eg fill: white

Because it is a background image, it is not part of the DOM and therefore, to my knowledge, can't be changed via css. The svg will need to be added inline. Eg. https://chriswrightdesign.github.io/customforms/select-box-svg/

@brianteeman
Copy link
Contributor

Thanks @ciar4n I didn't know about the background image but that makes total sense

@astridx
Copy link
Contributor Author

astridx commented Apr 15, 2020

Does anyone know the reason why we sometimes use FontAwesome and sometimes SVG images?
Modules  Breadcrumbs   test   Administration(1)

@ciar4n
Copy link
Contributor

ciar4n commented Apr 15, 2020

In a perfect world, they should be all the same. My preference would be inline svg. If you look deep enough, you will even find some css chevrons in the mix.

@astridx
Copy link
Contributor Author

astridx commented Apr 16, 2020

@ciar4n In a perfect world, they should be all the same. My preference would be inline svg. If you look deep enough, you will even find some css chevrons in the mix.

How would you do it exactly? If we enter the svg directly in the markup, we can not reuse things, right?

  1. If you save the SVG in a file and load it with <?php echo file_get_contents("my.svg"); ?>, you could reuse things.

  2. Or we can put the svg on the end of a page like this:

<svg>
<symbol viewBox="0 0 32 32" id="myid1"><title>youtube</title><path ../>
</symbol>
<symbol viewBox="0 0 32 32" id="myid2"><title>youtube</title><path ../>
</symbol>
</svg>

Then we can use it like this

<svg role="img" class="myclass" aria-labelledby="">
<use xlink:href="#myid1"></use>
</svg>

@ciar4n
Copy link
Contributor

ciar4n commented Apr 16, 2020

There have been a couple of recent PRs for the frontend views on this (#28262 & #28351)... a somewhat contentious issue.

@infograf768
Copy link
Member

What is the advantage of using svg vs icons? As I see it, it rather makes things more complex than necessary.

@ciar4n
Copy link
Contributor

ciar4n commented Apr 18, 2020

Size... with SVG you just load what you need rather than an entire library (css & font). Also SVG allows us to drop in custom fonts rather than been restricted to a set library.

Regardless I think Font Awesome is fine for the backend as it is just one template that will likely be ever used. The frontend is a slightly different matter.

For this PR I think ideally we change the choices icon to Font Awesome, bringing it inline with the majority of the admin. If that is not possible, then this PR as it is fixes the issue.

@adj9
Copy link

adj9 commented Apr 18, 2020

I have not tested this item.

With and without patches, the field state arrow is always black.
This is in the plugin and in the articles.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28680.

@astridx
Copy link
Contributor Author

astridx commented Apr 18, 2020

@adj9 Thanks for your test. May I ask you: How did you test? Did you use the patch tester?

@astridx
Copy link
Contributor Author

astridx commented Apr 18, 2020

@ciar4n @infograf768 Thanks for your opinion. I'll look at that tomorrow.

@Quy
Copy link
Contributor

Quy commented Apr 22, 2020

Please test PR #28755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants