pico icon indicating copy to clipboard operation
pico copied to clipboard

Non-Modal Dialogs are rendered with Buttons to the left (instead to the right)

Open mrh1997 opened this issue 1 year ago • 3 comments

According to the docs one can create Dialogs-like-looking-Elements without the Popup-semantics by omitting the <dialog> tag and only use <article>:

  <article>
    ...
    <footer>
      <button className="secondary">Cancel</button>
      <button>OK</button>
    </footer>
  </article>

Current Behavior

Unfortunaltely the Buttons are rendered to the left side in this case. When embracing the article by a dialog the buttons are rendered to the right.

Expected Behavior

I expect <article> without an enclosing <dialog> renders the same way (i.e. the buttons to the right)

I think the problem is this line as it is part of a selector dialog > article > footer instead of simply article > footer.

Maybe the whole footer section should be moved out of the dialog selector?!?

Reproduction URL

https://jsfiddle.net/owgcpb4j

Environment

Windows 11, Firefox, PicoCSS latest (v2)

mrh1997 avatar Oct 17 '23 09:10 mrh1997

One hack that you can use is that you put a nav in the footer and put the buttons in a div or ul. You can then use an empty div as the first child of nav, which will move the buttons (second child) to the right.

rokf avatar Oct 29 '23 18:10 rokf

My intention was not to find a hack (I implemented already a workaround via CSS), but to fix the issue.

I would even provide a pull request if s.b. conforms that my solution will not break something else...

mrh1997 avatar Oct 30 '23 13:10 mrh1997

Aligning right for dialogue > article > footer is already very opinionated. Aligning right for article > footer might be too much.

I would love to hear other user's thoughts.

lucaslarroche avatar Jan 27 '24 03:01 lucaslarroche