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

Styles are missing for the component #42

Closed
sarada-Cheukupalli opened this issue Feb 7, 2018 · 5 comments
Closed

Styles are missing for the component #42

sarada-Cheukupalli opened this issue Feb 7, 2018 · 5 comments

Comments

@sarada-Cheukupalli
Copy link

Hi

I just installed this component and tried to run and noticed that it's missing a few styles. I don't see the arrow in select input and the expander symbols for opening and closing the data items. Also, only if I search for a keyword, it would expand the data items as shown in the screen-shots. Please advise!

Thanks!

image
image

@aseroj
Copy link

aseroj commented Feb 7, 2018

what are you using for the templating ? (e.g. bootstrap, reactstrap, material)

@sarada-Cheukupalli
Copy link
Author

I'm using the Vanilla (no framework)

@aseroj
Copy link

aseroj commented Feb 7, 2018

I'd suggest following the original documentation for styling guides.
Also checkout the examples provided, although there aren't any for vanilla, but you'll get the gist of it.

@mrchief
Copy link
Collaborator

mrchief commented Feb 8, 2018

@sarada-Cheukupalli When you do

import DropdownTreeSelect from 'react-dropdown-tree-select'

a bundler like webpack will also import the styles, provided you allow for it:

// allow webpack to import/bundle styles from node_modules for this component
module: {
  rules: [
    {
      test: /\.css$/,
      use: ExtractTextPlugin.extract({
        fallback: 'style-loader',
        use: [{
          loader: 'css-loader'
        }]
      }),
      include: /node_modules[/\\]react-dropdown-tree-select/
    }
  ]
}

This will suffice to include vanilla/default styles.

If you want to use it with frameworks like Bootstrap/material, you'll also need to provide (in addition to allowing the default styles) some framework specific overrides with your own CSS. E.g. checkout the examples for bootstrap and material-design.

The 3rd option, as pointed out by @aseroj, is to completely come up with your own style - and the documentation provides the CSS skeleton that you need to implement to do so.

@mrchief
Copy link
Collaborator

mrchief commented Feb 8, 2018

Another option to include styles (if you're not using webpack or any bundler) is to reference them from a CDN: https://unpkg.com/react-dropdown-tree-select@1.0.6/dist/styles.css

mrchief added a commit that referenced this issue Feb 11, 2018
mrchief added a commit that referenced this issue Feb 11, 2018
* ✨ feat: Provide uncompressed and compressed assets

Fixes #43

* 📚 docs: Add documentation on how to use default styles with various approaches (webpack, CDN, other

Fixes #42
mrchief added a commit that referenced this issue Feb 11, 2018
* 📚 docs: Add documentation on how to use default styles with various approaches (webpack, CDN, other

Fixes #42

* ✨ feat: Provide uncompressed and compressed assets

Fixes #43
mrchief added a commit that referenced this issue Feb 11, 2018
* Docs: Add documentation on how to use default styles with various approaches (webpack, CDN, other 📚

Fixes #42

* Feat: Provide uncompressed and compressed assets ✨

Fixes #43
mrchief added a commit that referenced this issue Feb 11, 2018
* docs: Add documentation on how to use default styles with various approaches (webpack, CDN, other 📚

Fixes #42

* feat: Provide uncompressed and compressed assets ✨

Fixes #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants