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

Mysterious margin in popup #109

Open
Coordinate-Cat opened this issue Apr 18, 2024 · 1 comment
Open

Mysterious margin in popup #109

Coordinate-Cat opened this issue Apr 18, 2024 · 1 comment

Comments

@Coordinate-Cat
Copy link

The mysterious margin was confirmed when the background color was added. I tried to solve it with margin: 0;, padding: 0; but could not.
There doesn't seem to be any margins in the html tag or in the body tag.

スクリーンショット 2024-04-18 午後9 07 46

// popup.tsx
import { useState } from "react"

function IndexPopup() {
  const [data, setData] = useState("")

  return (
    <div
      style={{
        width: 800,
        height: 800,
        margin: 0,
        padding: 0,
        backgroundColor: "#9bae48"
      }}>
      <h2>
        Welcome to your{" "}
        <a href="https://www.plasmo.com" target="_blank" rel="noreferrer">
          Plasmo
        </a>{" "}
        Extension!
      </h2>
      <input onChange={(e) => setData(e.target.value)} value={data} />
      <a href="https://docs.plasmo.com" target="_blank" rel="noreferrer">
        View Docs
      </a>
    </div>
  )
}

export default IndexPopup
// popup.html
<!doctype html>
<html>
  <head>
    <title>__plasmo_static_index_title__</title>
    <meta charset="utf-8" />
  </head>
  <body style="margin: 0; padding: 0"></body>
</html>
@Coordinate-Cat
Copy link
Author

It appears that the <!doctype html> description was the cause of the problem.

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

1 participant