Closed Bug 1770534 Opened 2 years ago Closed 2 years ago

Only use the zap gradient on the setup card and colourway closet expiry blurb in Firefox View with default themes

Categories

(Firefox :: Firefox View, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: sfoster, Assigned: aminomancer)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-2022-mr1-firefox-view] [Interface])

The "zap-gradient" (which gets added to the sync setup card in bug 1770499 - its the purple -> pink -> orange gradient border) clashes terribly with a lot of non-built-in themes. We use a check for a :-moz-lwtheme pseudo to fall back to a normal solid color in places like the separator under the FxA main menu item. AFAICT this approach is not currently available for in-content stylesheets & elements however, so we need another solution.

Component: Sync → Firefox View
Whiteboard: [fidefe-2022-mr1-firefox-view]
Severity: S4 → S2
Priority: P3 → P2
Assignee: nobody → sclements
Status: NEW → ASSIGNED

Dao, Yasmin mentioned that colorways might have hit this same problem. If so, did you come up with a solution?

Flags: needinfo?(dao+bmo)
Severity: S2 → S3

(In reply to Sam Foster [:sfoster] (he/him) from comment #0)

We use a check for a :-moz-lwtheme pseudo to fall back to a normal solid color in places like the separator under the FxA main menu item. AFAICT this approach is not currently available for in-content stylesheets & elements however, so we need another solution.

You can use the lwt-newtab attribute.

(In reply to Sarah Clements [:sclements]|away till 30th from comment #1)

Dao, Yasmin mentioned that colorways might have hit this same problem. If so, did you come up with a solution?

No, the colorways modal only supports light and dark mode where the gradient sort of works, and it also only uses it for the expiry pill where the border isn't hugely important in terms of marking a section (e.g. a card) that needs visual separation from the rest of the page.

Flags: needinfo?(dao+bmo)
Blocks: firefox-view

Morphing this to include the same issue for the other use of the zap, namely the colourway collection expiry blob, as noted in bug 1788274.

See Also: → 1788274
Summary: Only use the zap gradient in Firefox View with default themes → Only use the zap gradient on the setup card and colourway closet expiry blurb in Firefox View with default themes
Keywords: perf:frontend

Not a performance issue.

Keywords: perf:frontend
Whiteboard: [fidefe-2022-mr1-firefox-view] → [fidefe-2022-mr1-firefox-view] [Interface]

(In reply to Dão Gottwald [::dao] from comment #2)

(In reply to Sam Foster [:sfoster] (he/him) from comment #0)

We use a check for a :-moz-lwtheme pseudo to fall back to a normal solid color in places like the separator under the FxA main menu item. AFAICT this approach is not currently available for in-content stylesheets & elements however, so we need another solution.

You can use the lwt-newtab attribute.

That doesn't work. All of the in-content themes have the lwt-newtab attribute on body thanks to the contentTheme.js script.

Emilio, I see that the moz-lwtheme selector was removed from in-content pages last year in bug 1740230. Would it be possible to get that selector to work in in-content pages and give those pages access to it again?

Flags: needinfo?(emilio)

I removed it from content but it never matched before, so it's not particularly simple. Also, do you really want moz-lwtheme? It seems to me that'd match on the default light and dark themes, which probably is not what you want for comment 0?

Flags: needinfo?(emilio)

Maybe we should just add an attribute in contentTheme.js that reflects the theme's computed frame saturation. Since the zap doesn't necessarily look bad on all custom themes, it mostly seems to look bad on colorways and other themes that have very bold colors. Something like :is(:root, body)[lwt-newtab-vibrant] {...}

Otherwise, aren't we using theme experiment properties to control the appearance of the zap gradient in the chrome now? I think it should be possible to add that to the content styles with contentTheme.js.

See Also: → 1792736

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

I removed it from content but it never matched before, so it's not particularly simple. Also, do you really want moz-lwtheme? It seems to me that'd match on the default light and dark themes, which probably is not what you want for comment 0?

Well, we want to have the zap gradient for all Mozilla themes - default, light, dark, alphenglow and colorways. But not the third-party/user created themes (since we have no idea if the clashing would occur).

Maybe we should just add an attribute in contentTheme.js that reflects the theme's computed frame saturation. Since the zap doesn't necessarily look bad on all custom themes, it mostly seems to look bad on colorways and other themes that have very bold colors. Something like :is(:root, body)[lwt-newtab-vibrant] {...}

I don't think we want to start tweaking the colors like that for colorways (if we ever needed to, maybe the zap_gradient property at the manifest level is the way to go).

Otherwise, aren't we using theme experiment properties to control the appearance of the zap gradient in the chrome now? I think it should be possible to add that to the content styles with contentTheme.js.

This would work. The default-theme, light, dark and alphenglow theme manifests all have a zap_gradient property that's exactly the one we're using for Firefox View but colorways themes do not. So I could modify contentTheme.js to utilize that zap_gradient property if it exists and if it doesn't, then use the lwt-newtab attr in order to add the zap-gradient for colorways themes, leaving third party themes without it (just a default border color).

(In reply to Sarah Clements [:sclements] from comment #8)

This would work. The default-theme, light, dark and alphenglow theme manifests all have a zap_gradient property that's exactly the one we're using for Firefox View but colorways themes do not. So I could modify contentTheme.js to utilize that zap_gradient property if it exists and if it doesn't, then use the lwt-newtab attr in order to add the zap-gradient for colorways themes, leaving third party themes without it (just a default border color).

Hi Sarah, I actually submitted a patch to expose that property to Fx View. Let me know if this works for you, thanks!

Depends on: 1792736
See Also: 1792736

(In reply to Shane Hughes [:aminomancer] from comment #9)

(In reply to Sarah Clements [:sclements] from comment #8)

This would work. The default-theme, light, dark and alphenglow theme manifests all have a zap_gradient property that's exactly the one we're using for Firefox View but colorways themes do not. So I could modify contentTheme.js to utilize that zap_gradient property if it exists and if it doesn't, then use the lwt-newtab attr in order to add the zap-gradient for colorways themes, leaving third party themes without it (just a default border color).

Hi Sarah, I actually submitted a patch to expose that property to Fx View. Let me know if this works for you, thanks!

From what I can tell, that completely fixed this bug.

Flags: needinfo?(sclements)

(In reply to Shane Hughes [:aminomancer] from comment #9)

(In reply to Sarah Clements [:sclements] from comment #8)

This would work. The default-theme, light, dark and alphenglow theme manifests all have a zap_gradient property that's exactly the one we're using for Firefox View but colorways themes do not. So I could modify contentTheme.js to utilize that zap_gradient property if it exists and if it doesn't, then use the lwt-newtab attr in order to add the zap-gradient for colorways themes, leaving third party themes without it (just a default border color).

Hi Sarah, I actually submitted a patch to expose that property to Fx View. Let me know if this works for you, thanks!

Ok, thanks but... I'm confused why you submitted a patch when I was assigned to this bug?

Edit: I see that was a patch for bug 1792736, but included also changes to Firefox View...

Assignee: sclements → shughes
Flags: needinfo?(sclements)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

(In reply to Sarah Clements [:sclements] from comment #11)

Ok, thanks but... I'm confused why you submitted a patch when I was assigned to this bug?

Edit: I see that was a patch for bug 1792736, but included also changes to Firefox View...

Sorry about that, it was just supposed to illustrate my previous suggestion for your feedback. I think Dão thought it was just part of the needed changes, so went ahead and landed it.

You need to log in before you can comment on or make changes to this bug.