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

Unable to style Dropdown Input #674

Closed
FaideWW opened this issue Jul 27, 2016 · 3 comments
Closed

Unable to style Dropdown Input #674

FaideWW opened this issue Jul 27, 2016 · 3 comments

Comments

@FaideWW
Copy link

FaideWW commented Jul 27, 2016

Hello,

We are trying to apply styling to the label inside the Input contained in Dropdown components. Currently we are unable to access the theme of the Input, because the Dropdown does not pass its theme property onto its children.

Would it be possible to add this functionality, or to add a sub-theme property to pass theme data through the Dropdown into the Input?

@coreyar
Copy link

coreyar commented Aug 3, 2016

Check out the Customizing components section of the install doc page.

I was able to create a theme file and section the Dropdown element using the className defined by react-toolbox. Then I sub-selected any elements I wanted to modify.

Example for input

.dropdown input {
    padding: 10px!important;
    background-color:white!important;
 }

This is my first day using React-toolbox and I have little experience styling react elements. If you find another way of doing this, I'd love to hear it.

@javivelasco
Copy link
Member

There are many ways to achieve this. In some components we are passing down the theme object given to the root to some other child components. This way, if you want to target a subcomponent you can use the same className used in the original component.

There was a bug though. The Dropdown was not passing down the Input this.props.theme. Now it is. This allows to use classNames from the Input inside the Dropdown theme. This way yo should be able to customize as you want.

@javivelasco
Copy link
Member

Sorry, my bad. Actually passing down the theme makes classNames collisions because the Dropdown component and Input are using the same classNames for labels, errors, etc. What is exactly what you want to change? remember you can still target DOM attributes as @coreyar said.

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

3 participants