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

Apply styles directly with styles prop #103

Open
arcasoy opened this issue Oct 17, 2023 · 1 comment
Open

Apply styles directly with styles prop #103

arcasoy opened this issue Oct 17, 2023 · 1 comment

Comments

@arcasoy
Copy link

arcasoy commented Oct 17, 2023

I'm developing a web component library. Due to the nature of Shadow DOMs, using className in JS and referring to a class defined in an external CSS or SCSS file is not feasible. I'd like to be able to directly edit the style tag of the component by passing a style={} prop.

This is, in fact, just a means to an end and I'd like the width:100% height: 100% that is applied when the fullscreen is active to be applied at all times, since the component is not large enough. But either way, I think adding this style prop pass through would enable others to tweak the full screen wrapper as they see fit.

@wchargin
Copy link

+1 for a different reason. We use Tailwind for most styling, but style for some attributes that Tailwind doesn't support. In this case, I wanted to write:

return (
  <FullScreen className="grid" style={{gridTemplateAreas: "..."}}>
    {/* some children in a grid layout */}
  </FullScreen>
);

but since I cannot apply styles to the FullScreen itself, I have to use an extra wrapper div.

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

2 participants