Skip to content

Conversation

@SebastianZ
Copy link
Contributor

I've added the definition for the none value of box-shadow-offset and corrected the computed value of that property to account for the none value now being part of the shadow list.

This is meant to fix #8567.

Sebastian

Copy link
Contributor

Choose a reason for hiding this comment

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

box-shadow should also change to "Computed value: see individual properties".

BTW, "Animation type" should also be "see individual properties", and the animation logic should go to the right property, but I guess that depends on #8592.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed the computed value and removed the now incorrect note for "Animatable" about "treating none as a zero-item list".

I kept the animation logic at the shorthand for now and will fix it in the patch for #8592.

I also kept "Animatable" for now and replace it in another patch by "Animation type" as it's unrelated to this one.

Animatable: by computed value,
treating ''box-shadow-offset/none'' as a zero-item list
and appending blank shadows (''transparent 0 0 0 0'')
appending blank shadows (''transparent 0 0 0 0'')
Copy link
Contributor

Choose a reason for hiding this comment

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

Just dropping "treating none as a zero-item list" would change the behavior.

I think that box-shadow-offset should treat none as 0 0 when interpolated with non-none values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was to align it with animation-name, i.e. a value of none cancels out this one shadow within the list.

And I think it is better to treat none as-is, meaning the interpolation between none and non-none values is discrete and the shadow appears or disappears.

Sebastian

Copy link
Contributor

Choose a reason for hiding this comment

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

Well this would break https://software.hixie.ch/utilities/js/live-dom-viewer/saved/11442 which works with interoperability, so you need CSSWG resolution to change it.

@SebastianZ SebastianZ requested a review from Loirooriol March 31, 2023 22:22
Comment on lines 907 to 909
Animatable: by computed value,
treating ''box-shadow-offset/none'' as a zero-item list
and appending blank shadows (''transparent 0 0 0 0'')
with a corresponding ''box-shadow-position/inset'' keyword as needed
to match the longer list
if the shorter list is otherwise compatible with the longer one
letting ''box-shadow-offset/none'' create a blank shadow
(''transparent 0 0 0 0'') when interpolated with non-'none' values
and appending blank shadows with a corresponding
''box-shadow-position/inset'' keyword as needed to match the longer list
if the shorter list is otherwise compatible with the longer one
Copy link
Contributor

@Loirooriol Loirooriol Apr 2, 2023

Choose a reason for hiding this comment

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

I don't think this works.

Let's say we interpolate from box-shadow-offset: none; box-shadow-color: #f00 to box-shadow-offset: 10px 10px; box-shadow-color: #f00.

box-shadow-offset interpolates none as 0 0, so at linear 50% we have 5px 5px. But what about box-shadow-color? Its computed value was always #f00 (none was only changing the used value into transparent), so we get #f00, but current browsers say rgba(255, 0, 0, 0.5).

So I guess that either:

  • box-shadow-offset: none should affect the computed values of other properties (even though coordinated value lists were only supposed to affect each other at used value time I believe).
  • Interpolation with box-shadow-offset: none should not just treat it as 0 0 but somehow affect the used value of other properties at used value time.
  • We get rid of this magical behavior, as you initially wanted.

@SebastianZ SebastianZ force-pushed the css-backgrounds-4-box-shadow-offset-none-value branch from 2f413e4 to a00eeb3 Compare July 19, 2023 04:35
@SebastianZ
Copy link
Contributor Author

Since we split borders and box decorations out into CSS Borders 4, I'll close this PR and set up a new one to avoid rebasing issues.

Sebastian

@SebastianZ SebastianZ closed this Jul 19, 2023
@SebastianZ
Copy link
Contributor Author

For reference, the new PR is #9096.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[css-backgrounds-4] Allow repeating none in box-shadow-offset

2 participants