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

[EXP] Add style injection for content script UI to with-ant-design #23

Closed
2 tasks done
louisgv opened this issue Jun 14, 2022 · 0 comments
Closed
2 tasks done

[EXP] Add style injection for content script UI to with-ant-design #23

louisgv opened this issue Jun 14, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@louisgv
Copy link
Contributor

louisgv commented Jun 14, 2022

What is the example you wish to see?

Use D - Optional style container, injected into the shadowDOM in RFC | Style injection for Content Script UI #9
add contents/index.tsx

import { Button } from "antd"
import cssText from "data-text:~/index.css"
import type { PlasmoContentScript } from "plasmo"

export const config: PlasmoContentScript = {
  matches: ["https://space.bilibili.com/*"]
}

export const getStyle = () => {
  const style = document.createElement("style")
  style.textContent = cssText
  return style
}

const Index = () => {
  return (
    <div
      style={{
        position: "fixed",
        top: "50%"
      }}>
      <Button type="primary">Hello Ant Design</Button>
    </div>
  )
}

export default Index

Maybe you also should upgrade your plasmo verison.

Is there any context that might help us understand?

Originally posted in https://github.com/PlasmoHQ/examples/issues/4 by @zangguojun

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@louisgv louisgv added documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed labels Jun 14, 2022
@louisgv louisgv changed the title EXP | Add style injection for content script UI to with-ant-design [EXP] Add style injection for content script UI to with-ant-design Jun 29, 2022
@louisgv louisgv closed this as completed Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant