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

Is there a way to make the CSS outline always visible? #47

Closed
matatk opened this issue Feb 14, 2017 · 2 comments · Fixed by #158
Closed

Is there a way to make the CSS outline always visible? #47

matatk opened this issue Feb 14, 2017 · 2 comments · Fixed by #158
Assignees
Labels
Milestone

Comments

@matatk
Copy link
Owner

matatk commented Feb 14, 2017

Sometimes, due to the CSS already on a page, the outline of the current landmark is not visible. Whilst this seems like a simple problem, there are several challenges. The current approach is very simple and robust (even if it doesn't catch every possible scenario), so will need to think about this one.

  1. Sometimes the outline does not appear. There could be a few reasons for this (incomplete list).
    1. Outlines may not appear because they're outside of the page. Solution is to use the outline-offset property and set it negatively, so that the outline will be within the box. Ref Set and correctly restore both CSS outline and outline-offset #54.
    2. Where the outline may appear could be obscured by other elements. Solutions may be to either try to display the outline 'on top' or to display it within the visible element: https://www.google.co.uk/search?&q=z-index+of+css+outline
    3. Suspect this unlikely, but CSS may override CSS outline. Looks like !important could help https://css-tricks.com/when-using-important-is-the-right-choice/
  2. Size of containing landmark element can be much smaller than the contained elements. Not sure how much of a problem this one may be; worth taking time to get an idea of this, as any solutions seem to take us far from current implementation.
    1. Getting contained elements' sizes: https://www.google.co.uk/search?q=javascript+get+size+of+container+with+contained+elements
    2. Having got the real size, the current method of showing the landmarks' outline via the CSS outline property wouldn't work.
  3. Sometimes the CSS colour used by Landmarks (red) matches the website, so it is unclear. Currently seems difficult to work around. Ideas would be, if it's possible to reliably determine the colour the user sees (which may not be the background/colour of the landmark element) then a secondary outline colour could be used instead, which is designed to contrast more.
@matatk matatk added this to the 2.0.7 milestone Feb 14, 2017
@matatk matatk self-assigned this Feb 14, 2017
@matatk matatk modified the milestones: 2.1.0, 2.0.7 May 4, 2017
@matatk
Copy link
Owner Author

matatk commented May 9, 2017

The most promising things to address, from the above comment, are:

Currently attempting to address 1ii, 1iii and 2 papers to run up against the law of diminishing returns.

@matatk matatk modified the milestones: 2.1.0, 2.0.7 May 9, 2017
@matatk
Copy link
Owner Author

matatk commented Sep 4, 2017

Need to check out the ARIA Landmarks Example page approach to this, as per #1.

The key part is that Element.getBoundingClientRect() is used to figure out exactly where to put the outline, and an overlay is created to provide the outline (and that's also where the label with more info, such as tagName or landmark label, goes).

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

Successfully merging a pull request may close this issue.

1 participant