w3c / w3c/csswg-drafts

[css-images] symmetrical/mirrored css gradients

Open
#7,534 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-images-5
Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Description

There is usually an option for symmetrical gradients in images editors. We do not have this functionality in CSS gradients (https://www.w3.org/TR/css-images/).

SVG gradient spreadMethod already has a reflect option:

Reflect the gradient pattern start-to-end, end-to-start, start-to-end, etc. continuously until the target rectangle is filled.

https://svgwg.org/svg2-draft/pservers.html#LinearGradientElementSpreadMethodAttribute

Could allow devs the ability to write half the code and get the same result:

current:

linear-gradient(transparent, red, red, transparent)

propsed:

reflect/symmetrical/mirror?-linear-gradient(transparent, red 50%)
repeating-linear-gradient(transparent, red, reflect?)

Ana Tudor's example from twitter:

https://twitter.com/anatudor/status/1273657268106600449

https://codepen.io/thebabydino/pen/BajpyXV?editors=1100

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the CSS Images specification and the linked SVG gradient spreadMethod reference, then compare the proposed syntax with the current linear-gradient and repeating-linear-gradient examples. Done means resolving the syntax and behavior for mirrored gradients in a standards proposal; no repository files or tests are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.