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

Find out computed element CSS style value #971

Open
smfukaya opened this issue May 7, 2024 · 0 comments
Open

Find out computed element CSS style value #971

smfukaya opened this issue May 7, 2024 · 0 comments

Comments

@smfukaya
Copy link

smfukaya commented May 7, 2024

Hi,

Is there a way to know (hook, subscribe, listen) before rendering (Preflight) what would be the inherited CSS styles of a inner element and somehow make on-the-fly changes to the element? For instance would somehow be possible to know that the following img inherits margin-left from p that will affect the maximum width I could set to the image in order to prevent it from going beyond the page right margin?

<style>
  p { margin-left: 5pt}
  @page{A4;margin:3cm 3cm 2cm 3cm}}
</style>
<body>
<p><img src="http://some URL" />
</p>
</body>

Best Regards,
Sergio Fukaya

@smfukaya smfukaya changed the title Find out inherited element style Find out inherited element style value May 7, 2024
@smfukaya smfukaya changed the title Find out inherited element style value Find out computed element CSS style value May 7, 2024
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