azouaoui-med / react-pro-sidebar

React Pro Sidebar provides a set of components for creating high level and customizable side navigation

Home Page:https://azouaoui-med.github.io/react-pro-sidebar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sidebar root element styling inaccessible

jerbourgeois opened this issue · comments

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.

Hi,

You could use the & target IMO:

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

  return <Sidebar rootStyles={rootStyles}></Sidebar>;
};

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

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.