azouaoui-med / react-pro-sidebar

React Pro Sidebar provides a set of components for creating high level and customizable side navigation
https://azouaoui-med.github.io/react-pro-sidebar/
MIT License
1.69k stars 414 forks source link

Sidebar root element styling inaccessible #196

Closed jerbourgeois closed 8 months ago

jerbourgeois commented 1 year ago

Describe the bug When applying styles using the sidebarClasses object and accessing the root element, the styling rules are not applied to the element at all.

To Reproduce Steps to reproduce the behavior:

  1. Create Sidebar element
  2. Add any styling to sidebarClasses.root through the rootStyles prop on the Sidebar element

Expected behavior The added styles should be reflected on the root.

Actual behavior The root element preserves it's default styling rules with no changes.

rclsilver commented 11 months ago

Hi,

You could use the & target IMO:

const MySidebar = () => {
  const rootStyles: CSSObject = {
    ["&"]: {
      borderRightStyle: "none",
    },
  };

  return <Sidebar rootStyles={rootStyles}></Sidebar>;
};
davidatqala commented 10 months ago

This worked for me thanks. It would be good to be able to target it using the sidebarClass.root to make it more apparent.

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.