The copy and paste function now supports backgrounds with linear gradients.
Figma has the option to move and resize gradients as you like, but in CSS we only have 0 to 100%.
For it to work correctly I recommend that point a and b of the figma gradients touch the start and end of the frame:

You can also use background images and linear gradients:
