-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
[A11Y] Add focus ring mixin to restore ring to elements which no longer have it #2814
Conversation
These mixins allow us to restore default browser focus rings on elements which no longer have them.
It doesn't seem like these are actually being used right now, unless I'm misunderstanding something? |
No, but I'm writing some improvements for the Notifications styles which will require this. I felt that putting it in its own PR made a bit more sense than combining it with the current almost whole rewrite of the styles. (Grid and flex!) |
wouldn't it be easier to remove any |
Removing This is intended to be a temporary fix anyway -- I hope to get as many of our mixins removed as possible so we don't have border radius repeated 5 times when only one of them does anything :P It could also allow for easier customisation of outlines if, for whatever terrible reason, someone wanted to do so. |
that shouldn't be the case by default, what you're seeing locally (in the image) is most likely because you also technically have the button However you make a good point about customization! how does that work here, by overriding mixins ? I don't think that's possible in less 🤔, we might have to move the outline value to |
In Less, mixins get merged together, with the later mixins taking precedence. Though, saying that, moving it to a variable might be a good idea. Should the variable be the entire value? I'm leaning towards that instead of splitting it into 3 separate ones. |
Actually, we can't move it to a variable as we have two values to make it work. Leaving it as a mixin might be our only choice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Less, mixins get merged together, with the later mixins taking precedence.
Aha, interesting that's the case indeed!
Let's leave it as is then.
…x mixin name I just learned that Less has namespaces! https://lesscss.org/features/#mixins-feature-namespaces
Just added a quick comment about how to override the outline styles, and switched to using a I'll give both of you a few mins to note any objections to that. I think core should have probably used a namespace for its own mixins from the start, and we should probably recommend extensions do the same. |
neat, no objections!
I like the idea, I think it'd be worth implementing that when we get to refactoring more of the frontend code. I think it'd be good to have an issue about it. |
I've created a docs issue -- hopefully I'll get the chance to write a small bit about it before stable releases, and we can note that we strongly recommend switching to that: flarum/docs#322 |
Changes proposed in this pull request:
These mixins allow us to restore default browser focus rings on elements which no longer have them.
Reviewers should focus on:
I chose to make the styles mixin "private" as it shouldn't be used manually elsewhere in core -- we should instead use the other available mixins in the file. Is this the right choice?
Screenshot
This screenshot uses:
Confirmed