-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Spinner: Enforce no background. #49695
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also have been:
which effectively resets the styles that were set by a CSS class rule, and makes them to be inherited from a parent element. Just like if the child element never specified any
background-color
.inherit
is better in a sense that it doesn't express any opinion about what the background color should be.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would inherit the background of its parent element.
If the structure is simply
div.components-spinner > svg
, then inherit would most likely make it transparent indeed, or at least the same background color as its parent.But I like transparent in this case, as it is an easily readable statement: this component should always have a transparent background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the spinner case however the structure is
svg.components-spinner
, both the class name and the Emotion-generated style are on the same element. It would work.But never mind, I just wanted to share a possible alternative solution. And in case of
background-color
,transparent
in the end means the same thing asinherit
, just on a different conceptual level: "inherit the color of the layer that's under this one"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right, my mistake. But it would still inherit the background of its parent, might have its own background set. It would be invisible unless it was a tiling image, which would be unlikely, but nevertheless, not quite as explicit as "transparent".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right, too, about the tiling images etc.
background-color
is not inherited by default, as that would copy the style from the parent, and we don't want to do that. It would break gradients, tiles etc. The right default forbackground-color
istransparent
.It's
initial
that is the real alternative solution that works: