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

Flex-grow does not work on inline elements #1680

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

Flex-grow does not work on inline elements #1680

LukasKlement opened this issue Jul 10, 2022 · 2 comments

Comments

@LukasKlement
Copy link

LukasKlement commented Jul 10, 2022

A wrapper with display: flex and two nested inline elements with flex: 1 should occupy each half of the available width. However, in WeasyPrint v56 the inline elements do not grow.

Minimum reproducible example (added colour to illustrate the issue):

<html>
  <head>
    <style>
      .line {
        position: relative;
      }

      .item {
        display: flex;
        justify-content: center;
        width: 100%;
      }

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

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

      .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);
        background-color: aquamarine;
      }
    </style>
  </head>
  <body>
    <div class="line">
      <span class="item">
        <span class="primary-language">Coffee</span><span class="secondary-language">قهوة</span>
      </span>
    </div>
    <div class="line">
      <span class="item">
        <span class="primary-language">Tea</span><span class="secondary-language">شاي</span>
      </span>
    </div>
    <div class="line">
      <span class="item">
        <span class="primary-language">Hot milk</span><span class="secondary-language">حليب ساخن</span>
      </span>
    </div>
  </body>
</html>

When the nested elements are <div> insted of <span>, the example works as expected.

@liZe
Copy link
Member

liZe commented Jul 10, 2022

Hello!

Thanks for the bug report. Isn’t this a duplicate of #1652?

@liZe
Copy link
Member

liZe commented Jul 16, 2022

Let’s continue the discussion in #1652.

@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