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

New pages: stop-opacity and stop-color properties #35170

Merged
merged 11 commits into from
Aug 8, 2024
Merged

New pages: stop-opacity and stop-color properties #35170

merged 11 commits into from
Aug 8, 2024

Conversation

estelle
Copy link
Member

@estelle estelle commented Jul 26, 2024

part of #34763

@estelle estelle requested a review from a team as a code owner July 26, 2024 21:21
@estelle estelle requested review from chrisdavidmills and removed request for a team July 26, 2024 21:21
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/m [PR only] 51-500 LoC changed labels Jul 26, 2024
@estelle estelle requested a review from a team as a code owner July 26, 2024 21:22
Copy link
Contributor

github-actions bot commented Jul 26, 2024

Preview URLs

Flaws (31)

URL: /en-US/docs/Web/CSS/stop-color
Title: stop-color
Flaw count: 15

  • macros:
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/stroke
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/stroke-width
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/fill
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/marker-end
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/marker-mid
    • and 10 more flaws omitted

URL: /en-US/docs/Web/CSS/stop-opacity
Title: stop-opacity
Flaw count: 16

  • macros:
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/stroke
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/stroke-width
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/fill
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/fill
    • Wrong xref macro used (consider changing which macro you use). Error processing path /en-US/docs/Web/CSS/marker-end
    • and 11 more flaws omitted

(comment last updated: 2024-08-08 06:48:24)

@estelle estelle changed the title New page: stop-opacity property New pages: stop-opacity and stop-color properties Jul 26, 2024
The **`stop-color`** [CSS](/en-US/docs/Web/CSS) property defines the color to use for an SVG {{SVGElement("stop")}} element within a gradient. If present, it overrides the element's {{SVGAttr("stop-color")}} attribute.

> [!NOTE]
> The `stop-color` property only applies to {{SVGElement('stop')}} element nested in an {{SVGElement("svg")}}. It doesn't apply other SVG, HTML, or pseudo-elements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `stop-color` property only applies to {{SVGElement('stop')}} element nested in an {{SVGElement("svg")}}. It doesn't apply other SVG, HTML, or pseudo-elements.
> The `stop-color` property only applies to {{SVGElement('stop')}} elements nested in an {{SVGElement("svg")}}. It doesn't apply to other SVG, HTML, or pseudo-elements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done.


## Formal definition

{{CSSInfo}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This macro is broken here.


#### HTML

We have an SVG with three {{SVGElement("rect")}} squares and three almost identical {{SVGElement("linearGradient")}} elements. Each gradient has four {{SVGElement("stop")}} elements creating gradients that go from black to white and then white to grey; the only difference between them is the `id` value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We have an SVG with three {{SVGElement("rect")}} squares and three almost identical {{SVGElement("linearGradient")}} elements. Each gradient has four {{SVGElement("stop")}} elements creating gradients that go from black to white and then white to grey; the only difference between them is the `id` value.
We have an SVG with three {{SVGElement("rect")}} squares and three {{SVGElement("linearGradient")}} elements. Each gradient has four {{SVGElement("stop")}} elements creating gradients that go from black to white and then white to grey; the only difference between them is the `id` value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done.

The property value impacts the `stop-color`'s alpha channel; it can increase the transparency of a `<stop>`'s color but can not make the color defined by the `color-stop` property more opaque.

> [!NOTE]
> The `stop-opacity` property only applies to {{SVGElement('stop')}} element nested in an {{SVGElement("svg")}}. It doesn't apply other SVG, HTML, or pseudo-elements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `stop-opacity` property only applies to {{SVGElement('stop')}} element nested in an {{SVGElement("svg")}}. It doesn't apply other SVG, HTML, or pseudo-elements.
> The `stop-opacity` property only applies to {{SVGElement('stop')}} elements nested in an {{SVGElement("svg")}}. It doesn't apply to other SVG, HTML, or pseudo-elements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle the "to" near the end of the sentence still needs to be added.


The **`stop-opacity`** [CSS](/en-US/docs/Web/CSS) property the opacity of a given color gradient stop in the SVG {{SVGElement("stop")}} element. If present, it overrides the element's {{SVGAttr("stop-opacity")}} attribute.

The property value impacts the `stop-color`'s alpha channel; it can increase the transparency of a `<stop>`'s color but can not make the color defined by the `color-stop` property more opaque.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link them?

Suggested change
The property value impacts the `stop-color`'s alpha channel; it can increase the transparency of a `<stop>`'s color but can not make the color defined by the `color-stop` property more opaque.
The property value impacts the {{cssxref("stop-color")}}'s alpha channel; it can increase the transparency of a `<stop>`'s color but can not make the color defined by the `color-stop` property more opaque.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we have color-stop and stop-color, it would be good to disambiguate when they're so close together in prose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed. They were both supposed to be stop-color, which has been updated.


## Formal definition

{{CSSInfo}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue with the broken macro here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR has been filed on MDN/data - mdn/data#753


#### HTML

We have an SVG with a few {{SVGElement("polygon")}} stars and three almost identical {{SVGElement("linearGradient")}} elements: each has three {{SVGElement("stop")}} elements defining three color-stops that create a gradient going from blue to white to pink; the only difference between them is the `id` value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We have an SVG with a few {{SVGElement("polygon")}} stars and three almost identical {{SVGElement("linearGradient")}} elements: each has three {{SVGElement("stop")}} elements defining three color-stops that create a gradient going from blue to white to pink; the only difference between them is the `id` value.
We have an SVG with a few {{SVGElement("polygon")}} stars and three {{SVGElement("linearGradient")}} elements: each has three {{SVGElement("stop")}} elements defining three color-stops that create a gradient going from blue to white to pink; the only difference between them is the `id` value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done.


We include a {{cssxref("stroke")}} and {{cssxref("stroke-width")}} making the polygon path line visible.

Each `polygon` has a gradient background set using the {{cssxref("fill")}} property; the gradient's`id` is the `url()` parameter. We set `magenta` as the fallback color.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each `polygon` has a gradient background set using the {{cssxref("fill")}} property; the gradient's`id` is the `url()` parameter. We set `magenta` as the fallback color.
Each `polygon` has a gradient background set using the {{cssxref("fill")}} property; the gradient's `id` is the `url()` parameter. We set `magenta` as the fallback color.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done.

@bsmth
Copy link
Member

bsmth commented Aug 1, 2024

Thanks! Back over to you, Estelle if you want to have a look at the comments.

@bsmth bsmth removed the request for review from chrisdavidmills August 1, 2024 12:06
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle a few more bits for you to consider

files/en-us/web/css/stop-color/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/stop-color/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/stop-opacity/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/stop-opacity/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/stop-opacity/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/stop-opacity/index.md Outdated Show resolved Hide resolved
@estelle estelle requested a review from bsmth August 7, 2024 18:46
@estelle estelle requested a review from chrisdavidmills August 7, 2024 18:46
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle there are a couple of bits that I noticed were not actioned, which I've commented, however, these are really minor, so I've approved the PR.

@estelle estelle merged commit 8ad43cb into main Aug 8, 2024
9 checks passed
@estelle estelle deleted the stop branch August 8, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants