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

Importing specific component styles doesn't include all the styles required for that component to work #2386

Open
Darksoulsong opened this issue Mar 7, 2022 · 0 comments

Comments

@Darksoulsong
Copy link

Darksoulsong commented Mar 7, 2022

What version of rsuite are you using?

5.6.2

What version of React are you using?

17.0.2

What version of TypeScript are you using (if any)?

4.5.5

What browser are you using?

Chrome

Describe the Bug

I'm trying to use only the DateRangePicker component from rsuite, as it fits my project's needs. So I followed the modularization tutorial and tried to use it as described in there.

import RSuiteDateRangePicker from "rsuite/DateRangePicker";
import "rsuite/DateRangePicker/styles/index.less";

[...]

But there are some rules that are not being included to the .rs-picker-menu if I use the style import as it was described in the documentation, it`s missing the flex display rules, for example.

The datepicker is render correctly only if I include the whole rsuite.css file, which is far from ideal if the idea is to include only one rsuite component to your app.

Expected Behavior

I expect to have a fully working date range picker component when I use the path imports, both for the component and the styles, without the need to include all the rsuite css module.

To Reproduce

  • Create a clean project
  • import the DateRangePicker component using path imports import RSuiteDateRangePicker from "rsuite/DateRangePicker";
  • Include the component's styles: import "rsuite/DateRangePicker/styles/index.less";
  • Add the DateRangePicker to your Reacts's functional component.
  • Launch the project

You should see a date range picker with only 1 calendar, when it's supposed to have 2, and general broken layout.

A reproducible example can be found here.

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

2 participants