-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gradient backgrounds should be set with background-image
instead of background
#32787
Comments
Agreed.
IMHO it's bad practice to use shorthand properties in inline styles alltogether. |
Hi all I have started this but it seems that that change the background to background-color(or backgroundColor in js) if it is a straight color and to background-image(backgroundImage) if gradient this change is in 100's of files so I what to reach back to make sure that me removing all the shorthand background is what you need/want note: the only shorthand background have left is here is the branch I have started https://github.com/pbearne/gutenberg/tree/%2332787_replace_background_css_with_background-(type) |
PR for this is also at #35036 |
@ajlende Is this is something you could take on... ? |
@devanshijoshi9 - I believe this needs to be fixed in the Style Engine. It's not just a fix in the CSS files. Specifically, this ticket deals with presets and other values set on a block as a background gradient. |
I've added this to the task list for background image block supports: |
I have been attempting some work with
background-clip: text
like so:To create a gradient effect on text like this:
However, this does not work when using either gradient presets or a custom gradient. Both use
background: $gradient
instead ofbackground-image: $gradient
in the CSS output. By changing those to usebackground-image
, the effect works.I'm not sure if there are any historical reasons for going with
background
, but I'd love to see us move to only targetingbackground-image
.The text was updated successfully, but these errors were encountered: