Skip to content
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

Fix syntax for svg stop-related features #36885

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

skyclouds2001
Copy link
Contributor

@skyclouds2001 skyclouds2001 commented Nov 20, 2024

Description

  1. SVG <stop> element also accept <script> & <style> as children, see spec and the following sample code
  2. the syntax for stop-color is only <color> (currentcolor is already included by <color>, there is no info of <icccolor>)
  3. add link to the similar CSS property
sample
<svg
  viewBox="0 0 10 10"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <linearGradient id="myGradient" gradientTransform="rotate(90)">
      <stop offset="5%" stop-color="gold" />
      <stop offset="95%" stop-color="red">
        <script>
          console.log(0)
        </script>
        <style>
          stop[offset="95%"] {
            stop-color: green;
          }
        </style>
      </stop>
    </linearGradient>
  </defs>

  <circle cx="5" cy="5" r="4" fill="url('#myGradient')" />
</svg>

Motivation

Additional details

Related issues and pull requests

see also mdn/data#782 and mdn/browser-compat-data#25131

@github-actions github-actions bot added Content:SVG SVG docs size/s [PR only] 6-50 LoC changed labels Nov 20, 2024
Copy link
Contributor

github-actions bot commented Nov 20, 2024

@skyclouds2001 skyclouds2001 marked this pull request as ready for review November 20, 2024 16:44
@skyclouds2001 skyclouds2001 requested review from a team as code owners November 20, 2024 16:44
@skyclouds2001 skyclouds2001 requested review from chrisdavidmills and bsmth and removed request for a team November 20, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:SVG SVG docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant