-
Notifications
You must be signed in to change notification settings - Fork 920
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
Fixup :visited:focus specificity #15838
Conversation
I'm deploying this to a demo instance so we can be more confident this fix works before merging. |
This seems to work now on demo for me, but can you also confirm @janbrasna? https://www-demo1.allizom.org/en-US/ |
One additional thought: I wonder if adding more link state psudeo styles to |
I'm actually writing that up to the issue ^^. This was the last pseudo combo not having enough specificity to override the former protocol base (didn't do the math exactly as to why, it had to do something with how SASS→CSS compiled the nested rules, &-appending in what order etc.), I also checked those that get picked up from CTA styles (because otherwise the :active would also not apply) — so I'm actually thinking the opposite: Whether the base color overrides should not be self sufficient, and not rely on following selectors to match — i.e. whether it would be more resilient to also set the other :active or :focus-visible on the base elements (checking that as we speak…) |
OK, basically it needs to wholesale redefine these, exactly: https://github.com/mozilla/protocol/blob/121dec9f988c8b8bef5962155ef6f6841244e0bc/assets/sass/protocol/base/elements/_links.scss#L33-L40 So I'm adding the :active there for the exact same reasons. (Whenever used outside of CTAs, for good measure.) |
Hmm yeah, there are multiple layers of overrides here now with each written a little differently. I actually wonder why we need to load |
Hrm, digging into this file, there's a LOT of redundant CSS in here that the new site doesn't use. But I can't be confident other things wouldn't break if we just removed it. I think it's worth filing a followup issue to investigate more cleanly separating the new / old site. |
Pushing your latest commit to demo ^ |
I'm afraid that's above my paygrade, it all comes from the point where rebrand, nav refresh, type refresh, and layout/pages refresh were planned to be launched separately, behind distinct switches, so there was a LOT of overlap once all the pieces started to come together — but yeah, it should all be in theory self-standing today(?), at least as per #15120…? (However as e.g. #15790/files shows, there's a lot of little differences between the two… so yea, it's a bit wild;D) |
Yes, this is a larger issue that our internal team needs a discussion on first, as it also likely depends on our longer term plan for Protocol 🙂 |
BTW there's also this bit #15569/files to complicate specificity at times, too;) So that's all the places one has to take into account, when touching similar rules. |
@alexgibson Thanks for the deploy trigger, appreciate it. It does indeed look fixed to me, (although the Cloud Run might also have different bfcache behavior compared to other envs, I can positively reproduce on other demos but not on demo1, so that looks resolved). I'll leave that to you whether you'd like Daniel to also confirm fixed on demo1 first, or push that to dev and have it confirmed there. (I'm just quickly trying to infer the impact of the added :active change, but my feeling is there should be no adverse effects, quite the opposite — if there were any more gaps, this should help rectify that.) |
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.
Let's merge this to www-dev and Daniel can test from there. Agree this should be pretty safe, since the changes increase specificity 👍
👍 OK, hopefully the four-keys queue will start moving at some point, it seems stuck at a rev from yesterday. |
It looks like our last deploy failed from yesterday, but this latest one seems to be running fine so far. Should be up soon |
Confirmed. It slowly propagates but seems to start serving f5193cd in response. Thanks for the assistance Alex. 🚀 |
Notes:
|
One-line summary
Follows up from #15802
Significant changes and points to review
Anchor brand colors are not inverted in
@mixin invert-colors
for dark theme, and the blues and greens end up not readable on dark backgrounds. That is mostly overridden to blacks=whites, but here and there some of the original rules end up being higher specificity (or serving a newer color with css variable, but the older via hardcoded values); so this combination needs a tweak.Only fixing this for css variables should not be an issue, as the dark theme inversion is also done via css variables — so UAs only using hex colors instead of vars won't use dark theme anyways.
Issue / Bugzilla link
Fixes #15800
Testing
http://localhost:8000/
http://localhost:8000/about/
(doesn't reproduce locally 🤷 so pasted the generated m24-base into www-dev to test there…)
https://www-demo1.allizom.org/
https://www-demo1.allizom.org/about/