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

When both position and transform are used simultaneously, the style display is disorganized #567

Open
1 task done
wqRan opened this issue Mar 9, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@wqRan
Copy link
Collaborator

wqRan commented Mar 9, 2024

Affected version

0.16.0-beta.4

Flutter versions

3.16.0

No same issues found.

  • Yes, I search all issues but not found.

Steps to Reproduce

当position和transform同时使用时,样式未按照预期展示

Code example

<style> .angle-wrap { position: relative; width: 100px; height: 100px; background: pink; } .angle{ position: absolute; } .angle::before{ content: ""; display: block; border-width: 0 6px 6px; border-style: solid; border-color: transparent transparent #333740 } .top{ left: 50%; transform: translateX(-50%); top: 0; } .top::before { margin-top: -6px; transform: rotate(0deg); } .bottom{ left: 50%; transform: translateX(-50%); bottom: 0; } .bottom::before { margin-bottom: -6px; transform: rotate(180deg); } .left{ top: 50%; transform: translateY(-50%); left: 0; } .left::before { margin-left: -9px; transform: rotate(-90deg); } .right{ top: 50%; transform: translateY(-50%); right: 0px } .right::before { margin-right: -9px; transform: rotate(90deg); } </style>

Expected results

image

Actual results

image1

@wqRan wqRan added the bug Something isn't working label Mar 9, 2024
@wqRan
Copy link
Collaborator Author

wqRan commented Mar 9, 2024

    代码如下
    <!DOCTYPE html>
    <html>
    <head>
        <style>
      .angle-wrap {
        position: relative;
        width: 100px;
        height: 100px;
        background: pink;
      }
      .angle{
        position: absolute;
      }
      .angle::before{
        content: "";
        display: block;
        border-width: 0 6px 6px;
        border-style: solid;
        border-color: transparent transparent #333740
        }
      .top{
        left: 50%;
        transform: translateX(-50%);
        top: 0;
      }
      .top::before {
        margin-top: -6px;
        transform: rotate(0deg);
      }
      .bottom{
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
      }
      .bottom::before {
        margin-bottom: -6px;
        transform: rotate(180deg);
      }
      .left{
        top: 50%;
        transform: translateY(-50%);
        left: 0;
      }
      .left::before {
        margin-left: -9px;
        transform: rotate(-90deg);
      }
      .right{
        top: 50%;
        transform: translateY(-50%);
        right: 0px
      }
      .right::before {
        margin-right: -9px;
        transform: rotate(90deg);
      }
        </style>
    </head>
    <body>
    <div class="container">
      <div class="angle-wrap">
        <div class="angle top"></div>
        <div class="angle bottom"></div>
        <div class="angle left"></div>
        <div class="angle right"></div>
      </div>
    </div>
    
    </body>
    </html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant