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

Styling with CSS #14

Closed
raunofreiberg opened this issue Jan 8, 2020 · 5 comments · Fixed by #18
Closed

Styling with CSS #14

raunofreiberg opened this issue Jan 8, 2020 · 5 comments · Fixed by #18

Comments

@raunofreiberg
Copy link
Contributor

raunofreiberg commented Jan 8, 2020

Hey, thanks for the great library!

I have a question about how should one go about styling certain components? A lot of the components in ui don't have a className to them (e.g. https://github.com/uber/react-view/blob/master/src/ui/editor.tsx#L75)

@tajo
Copy link
Member

tajo commented Jan 8, 2020

You need to implement your own components. We do it at baseweb.design.

However, I am open to make the basic ui components more customizable so you if you need small tweaks, you don't have to copy&paste everything over.

@raunofreiberg
Copy link
Contributor Author

raunofreiberg commented Jan 9, 2020

Thanks for the response. For now, I went with implementing my own components (knobs, specifically), which works well.

Although, there are some components that I wouldn't want to implement on my own. For example, I'd like to change the flex positioning of Compiler, or change the focus border color of Editor.

Compiler and Editor don't seem like the kind of components that anyone would implement any different from the library's either, so right now it's just causing duplication for projects that wish to make minor adjustments 🙂


I think adding a few global class names for tweaking would suffice. Happy to help out with this, if necessary!

@tajo
Copy link
Member

tajo commented Jan 9, 2020

I think adding a few global class names for tweaking would suffice.

I would rather see an ability to pass down classNames which would get applied to those divs instead of inline styles (inline styles would be still used as a default option).

So for example, Compiler could be styled as:

<Compiler cx={{ root: "className-a", inner: "className-b" }} />

(compiler has two nested divs)

this way, you could also use CSS in JS libs to generate these classNames and avoid globals.

@raunofreiberg
Copy link
Contributor Author

Sounds good. Would you like me to kick this off with a PR?

@tajo
Copy link
Member

tajo commented Jan 9, 2020

That would be great. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants