Bulma: link color bug on safari

Created on 29 Jan 2020  Â·  9Comments  Â·  Source: jgthms/bulma

Description

On Safari only, the link color is not correctly computed when inserted in a hero with some color modifier.

To reproduce

<section class="hero is-info">
  <a>Hello world</a>
</section>

<section class="hero">
  <a>Hello world</a>
</section>

Result:

| Correct behavior (Chrome) | Wrong behavior (Safari) |
| --- | --- |
| correct behavior | wrong behavior |

I expect that the link color should be $link-color as on Chrome.

Reason

When not working (on Safari only), the following rule is triggered:

https://github.com/jgthms/bulma/blob/master/sass/layout/hero.sass#L24-L26

I cannot explain why this occurs only on Safari, but for sure, inheriting the color (i.e. take the parent color) cannot lead to a good result here.

browser bug stale

Most helpful comment

Thank you for your reply and interest, this explains indeed why there is a difference here.

  • I also observe the same issue in iOS.
  • Therefore, using :not() in your sass files is not a good idea. It may explain other bugs as this one: #2597
  • This is my personal point of view, but I am not fan of the fact that the link color inherits from its parent in case of strong and a in a hero section. A link is a link, I would like to be able to see clearly it's a link, consistently in the whole page. => I would go to drop this rule, without pressure :-D

How to proceed next?

All 9 comments

Naively, I would go to drop the lines:

https://github.com/jgthms/bulma/blob/master/sass/layout/hero.sass#L24-L26

.. but I don't know the side effects. I don't see any example when inheriting the color is a good idea.

Could I have the opinion of Bulma maintainers? I could submit a patch to drop these lines.

Do you have a sample HTML code to share? It might come from an error in your markup where the browser doesn’t parse your page correctly.

I confirm I can reproduce the issue with this simple example:

<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
  </head>
  <body>

    <section class="hero is-info">
      <a>Hello world</a>
    </section>

    <section class="hero">
      <a>Hello world</a>
    </section>

  </body>

</html>

Capture d’écran 2020-01-29 à 17 50 24

Do I missed something?

That is the correct behaviour. In hero components, all links inherit the text color. Otherwise, the links would be blue on blue.

The bug is that this small sample does not provide the same result on safari (the first ‘hello world’ is white) and on Chrome/Firefox (the first ´Hello World’ is blue). I expect that the Chrome behavior is more correct, but the important thing to me is that Bulma should behave the same in every Browser.

Seems Safari is the only browser to support chaining :not() selectors: https://developer.mozilla.org/en-US/docs/Web/CSS/:not#complex-selector-list

Thank you for your reply and interest, this explains indeed why there is a difference here.

  • I also observe the same issue in iOS.
  • Therefore, using :not() in your sass files is not a good idea. It may explain other bugs as this one: #2597
  • This is my personal point of view, but I am not fan of the fact that the link color inherits from its parent in case of strong and a in a hero section. A link is a link, I would like to be able to see clearly it's a link, consistently in the whole page. => I would go to drop this rule, without pressure :-D

How to proceed next?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fundon picture fundon  Â·  3Comments

choonggg picture choonggg  Â·  3Comments

jaredreich picture jaredreich  Â·  3Comments

Antrikshy picture Antrikshy  Â·  3Comments

swamikevala picture swamikevala  Â·  3Comments