Fix scrim styles for code blocks in Duo chat

What does this MR do and why?

Ensure the background gradient for the top and bottom scrims on scrollable code blocks match the user's code highlighting theme.

Also fixes a positioning problem with scrims caused by markdown styles.

References

Screenshots or screen recordings

Code theme GitLab dark mode Before After
code light mode light

Screen Recording 2025-08-28 at 13.05.29.mov

Screen_Recording_2025-08-28_at_12.49.10

code dark mode light

Screen_Recording_2025-08-28_at_13.01.09

Screen Recording 2025-08-28 at 13.10.28.mov

code light theme dark

Screen Recording 2025-08-28 at 13.09.03.mov

Screen Recording 2025-08-28 at 13.07.52.mov

code dark theme dark

Screen Recording 2025-08-28 at 13.04.21.mov

Screen Recording 2025-08-28 at 13.06.40.mov

solarized light light

Screen Recording 2025-08-28 at 13.12.49.mov

Screen Recording 2025-08-28 at 13.11.44.mov

solarized light dark

Screen Recording 2025-08-28 at 13.12.29.mov

Screen Recording 2025-08-28 at 13.12.02.mov

solarized dark light

Screen Recording 2025-08-28 at 13.16.48.mov

Screen Recording 2025-08-28 at 13.17.27.mov

solarized dark dark

Screen Recording 2025-08-28 at 13.17.06.mov

Screen Recording 2025-08-28 at 13.17.45.mov

monokai light

Screen Recording 2025-08-28 at 13.19.26.mov

Screen Recording 2025-08-28 at 13.19.05.mov

monokai dark

Screen Recording 2025-08-28 at 13.19.44.mov

Screen Recording 2025-08-28 at 13.18.41.mov

none light

Screen Recording 2025-08-28 at 13.21.05.mov

Screen Recording 2025-08-28 at 13.21.26.mov

none dark

Screen Recording 2025-08-28 at 13.20.47.mov

Screen Recording 2025-08-28 at 13.21.45.mov

How to set up and validate locally

  1. Check out this branch
  2. in the GDK, ask Duo to generate a code snippet for you that is longer than at least 20 lines (just to make sure it will be scrollable)
  3. observe the scrollable code block in Duo's response in all of the gitlab color theme + gitlab code theme combinations. You will see that the scrim coloring at the bottom and top always matches the code block's background. and the positioning of the top and bottom scrims is properly absolute.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #548836 (closed)

Edited by Chad Lavimoniere

Merge request reports

Loading