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

Absolute positioning inside relatively positioned flexbox does not work #1679

Closed
LukasKlement opened this issue Jul 10, 2022 · 2 comments
Closed

Comments

@LukasKlement
Copy link

Absolutely positioning an element inside a flex-element appears to be broken. The relative position appears to be ignored.

WeasyPrint version: 56

Minimum reproducible example:

<html>
  <head>
    <style>
      .item {
        position: relative;
        display: flex;
        justify-content: center;
        width: 100%;
      }

      .primary-language,
      .secondary-language {
        display: block;
        flex: 1;
        text-align: right;
      }

      .primary-language {
        padding-right: 12pt;
      }

      .primary-language::after {
        content: '';
        border-width: 1pt;
        border-style: solid;
        border-color: var(--color-text);
        position: relative;
        top: 1pt;
        display: inline-block;
        width: 8pt;
        height: 8pt;
        position: absolute;
        left: 50%;
        transform: translateX(-5pt);
      }

      .secondary-language {
        text-align: left;
        padding-left: 12pt;
        color: var(--color-text-secondary);
      }
    </style>
  </head>
  <body>
    <div class="item">
      <span class="primary-language">Coffee</span><span class="secondary-language">قهوة</span>
    </div>
    <div class="item">
      <span class="primary-language">Tea</span><span class="secondary-language">شاي</span>
    </div>
    <div class="item">
      <span class="primary-language">Hot milk</span><span class="secondary-language">حليب ساخن</span>
    </div>
  </body>
</html>

If you were to wrap each <div class="item"></div> in a <div> with position: relative, WeasyPrint would produce the correct output.

@liZe
Copy link
Member

liZe commented Jul 10, 2022

Hi!

Thanks for the bug report. I think that it’s a duplicate of #996, isn’t it?

@liZe
Copy link
Member

liZe commented Jul 16, 2022

Let’s continue the discussion in #996.

@liZe liZe closed this as completed Jul 16, 2022
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