creativetimofficial / ct-paper-dashboard-pro-react

17 stars 6 forks source link

How set a background-image in Sidebar like "Light Bootstrap Dashboard PRO React" #7

Closed dalborgo closed 5 years ago

dalborgo commented 5 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

View the background-image in the Sidebar like the "Light Bootstrap Dashboard PRO React"

Current Behavior

The background-image is not visible

Failure Information (for bugs)

I can't set the _sidebar-and-main-panel.scss correctly to add this feature.

Steps to Reproduce

I added the code with the image. I can see the image in the "browser devtools" but I don't know how change the scss to show it.

Sidebar.jsx:

<div
        className="sidebar"
        data-color={this.props.bgColor}
        data-active-color={this.props.activeColor}
        data-image={image}
      > 
<div className="sidebar-background" style={bgImage}></div>

Context

einazare commented 5 years ago

Hello again, @dalborgo ,

Sorry for this late response. It was a bit of a struggle to achieve your desired effect. You will need to add the following scss/css code in your project:

.sidebar .sidebar-background:after{
  display: none;
}
.sidebar[data-image]:after{
  opacity: 0.77;
}

Best, Manu

dalborgo commented 5 years ago

It works perfectly! Thanks.