CSS custom gradients appearing only in editing mode

My added gradients do not appear when clicking the preview button, they only appear when editing.
A screenshot of my code is below.