One way to do it is to just add a new class:
.ui.custom.sidebar {
width: 315px !important;
margin-left: -315px !important;
}
.ui.active.custom.sidebar {
margin-left: 0px !important;
}
.ui.active.right.custom.sidebar {
margin-left: -315px !important;
}