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

Inconsistent styles inheritance in NcAvatar #3877

Closed
Antreesy opened this issue Mar 10, 2023 · 0 comments · Fixed by #3925
Closed

Inconsistent styles inheritance in NcAvatar #3877

Antreesy opened this issue Mar 10, 2023 · 0 comments · Fixed by #3925
Labels
0. to triage bug Something isn't working feature: avatar Related to the avatar component

Comments

@Antreesy
Copy link
Contributor

Here are some research results:

  • Avatar comes as image from server. Its color is defined by method avatarUrlGenerator() in NcAvatar.vue
    Related PR: https://github.com/nextcloud/nextcloud-vue/pull/3119/files
  • method avatarUrlGenerator() is called with method loadAvatarUrl(), which is called in mounted hook, but returns different result from the second attempt
  • parameter --background-invert-if-dark: invert(100%) is defined by app theme (dark.css) and remains the same in process

So the conclusion is, result of window.getComputedStyle() call is inconsistent due to different browsers and security reasons
Changing the attribute from this.$el to document.body in this place works, because body and its style aren't changing, unlike the unmounted and mounted again avatar.

Originally posted by @Antreesy in nextcloud/spreed#8625 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. to triage bug Something isn't working feature: avatar Related to the avatar component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant