Skip to content

White gradient at the end of the preview's text [having the "Page previews" wikipedia beta feature enabled] #27

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

Closed
darkred opened this issue Aug 27, 2017 · 13 comments

Comments

@darkred
Copy link

darkred commented Aug 27, 2017

It's about the 'Page previews' beta feature of wikipedia (login to your wikipedia account|Preferences|'Beta features and enable 'Page previews').

When hovering on a link, there's a white gradient at the end of the preview's text.
Example link: https://en.wikipedia.org/wiki/Jeff_Loomis
Screenshot:
2017-08-28_015439

PS. Yes, it's a beta feature, but I believe it's super useful to have it enabled,

@Mottie
Copy link
Member

Mottie commented Aug 27, 2017

Hi @darkred!

I'm not seeing the gradient background... I think it was fixed in 1.0.25, please make sure you have that (latest) version installed.

@darkred
Copy link
Author

darkred commented Aug 27, 2017

@Mottie, yes, that's the version I have.

Hope it helps (sorry I forgot to include this info to my first post):
I use Firefox 55.0.3 and Stylish 2.0.7,
have all the wikipedia beta features enabled,
and there's no other style (or script) active.

@Mottie
Copy link
Member

Mottie commented Aug 27, 2017

I tried both Stylish 2.0.7 and Stylus 1.1.3.1 with v1.0.25 Wikipedia-Dark style. The preview is narrower, but there's no gradient.

2017-08-27 17_45_33-jeff loomis - wikipedia
2017-08-27 17_45_53-jeff loomis - wikipedia

Can you share the HTML?

@darkred
Copy link
Author

darkred commented Aug 27, 2017

Yes, here is the saved page:
test page.zip

@Mottie
Copy link
Member

Mottie commented Aug 27, 2017

Sorry that doesn't help, the preview is loaded dynamically on hover. Right click inside the preview and copy/paste the HTML into a code block here please... and if you can find the offending css style and share it, that'd be an even better.

@darkred
Copy link
Author

darkred commented Aug 27, 2017

Also, the issue also occurs in Chrome 60 with Stylish 1.8.2.

@Mottie
Copy link
Member

Mottie commented Aug 28, 2017

All placehoders (like /*[[base-color]]*/) are replaced in the installed style by user preferences:

I'm going to go ahead and find and disable all bright box-shadow definitions that I find in their style and let's see if that fixes this issue.

@darkred
Copy link
Author

darkred commented Aug 28, 2017

Unfortunately your last commit didn't fix the issue.


Here is the HTML you asked (it's the ::after node as seen in the screenshot )
(I managed to get it by navigating via keyboard while hovering link with mouse, so I edited my previous comment)

<div class="mwe-popups mwe-popups-fade-in-up flipped_x mwe-popups-image-tri mwe-popups-is-not-tall" role="tooltip" aria-hidden="" style="top: 210px; left: 827px; display: block;">
  <div class="mwe-popups-container">
    <a href="https://en.wikipedia.org/wiki/Nevermore" class="mwe-popups-discreet"><svg xmlns="http://www.w3.org/2000/svg" width="303" height="200"><image xlink:href="https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Nevermore_Summerbreeze2007_04.jpg/300px-Nevermore_Summerbreeze2007_04.jpg" x="0" y="-12.5" width="300" height="225" clip-path="url(#mwe-popups-mask-flip)"></image></svg></a>
    <a dir="ltr" class="mwe-popups-extract" href="https://en.wikipedia.org/wiki/Nevermore" lang="en"><b>Nevermore</b> is an American progressive metal band from Seattle, Washington, United States. Formed in 1991, they are known to incorporate elements from various styles such as power metal, modern hard rock, classic heavy metal and technical thrash metal. The band has been on hiatus since 2011, due to personal issues between the band members. In April 2015, lead singer Warrel Dane confirmed that Nevermore has not disbanded, and there is a possibility for them to continue in the next two years with another album.

</a>
    <footer>
      <a class="mwe-popups-settings-icon mw-ui-icon mw-ui-icon-element mw-ui-icon-popups-settings" href="/wiki/Special:Preferences#mw-prefsection-betafeatures"></a>
    </footer>
  </div>
</div>

In this ::after node, the following css style rule is applied (got it in Style Editor|'inline style sheet # 4', beautified)

.mwe-popups .mwe-popups-extract[dir='ltr']:after {
    right: 0;
    background-image: -webkit-linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 50%);
    background-image: -moz-linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 50%);
    background-image: -o-linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 50%);
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 50%)
}

i.e. as you may see from the screenshot, in that rule, the property that's active is the 4th one:
if you disable it, and then disable the 2nd one (which then becomes active) the issue is fixed.

Mottie added a commit that referenced this issue Aug 28, 2017
@Mottie
Copy link
Member

Mottie commented Aug 28, 2017

Ok, try that update.

@darkred
Copy link
Author

darkred commented Aug 28, 2017

That's it - thanks a lot!

@darkred darkred closed this as completed Aug 28, 2017
@darkred
Copy link
Author

darkred commented Aug 28, 2017

@Mottie, on second thought, I think that this is more preferable:
background-image: linear-gradient(to right, rgb(34, 34, 34, 0), rgb(34, 34, 34, 1) 50% ) !important;
because it retains the "ellipsis" meaning of the gradient, instead of removing it completely.
Comparison:
2017-08-28_2326132017-08-28_232911

I hope you agree.

@darkred darkred reopened this Aug 28, 2017
@Mottie
Copy link
Member

Mottie commented Aug 28, 2017

Done... updated on userstyles.org. Let me know if that takes care of it because I still can't see that gradient.

@darkred
Copy link
Author

darkred commented Aug 28, 2017

Thanks again. Yes, it's great now.

@darkred darkred closed this as completed Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants