Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you change the default width of semantic-ui sidebars?

Semantic-ui sidebars are 275px wide. Where should I add the css/js which makes them wider or narrower?

Their code is

.ui.sidebar {
   width: 275px!important;
   margin-left: -275px!important;
}

If I modify this, then the change is global for all the sidebars. If I change their content's width, semantic-ui ignores my change and overrides it with the default 275px.

You can find the sidebar example here: http://semantic-ui.com/modules/sidebar.html#/examples

like image 394
Mihai Oprea Avatar asked Mar 01 '14 22:03

Mihai Oprea


People also ask

What is a sidebar in UI?

A sidebar enables app navigation and provides quick access to top-level collections of content in your app or game. The term sidebar refers to a list of top-level app areas and collections, almost always displayed in the primary pane of a split view.

What is the use of semantic UI?

Semantic UI is a front-end development framework similar to bootstrap designed for theming. It contains pre-built semantic components that helps create beautiful and responsive layouts using human-friendly HTML.

Is Semantic UI responsive?

Semantic-UI Responsive Grid Stackable is used to stack the grid element in mobile or small screen devices. It will automatically stack all rows to a single column. Semantic-UI Responsive Grid Stackable Class: stackable: This class is used to automatically stack all the grid elements on a mobile devices.


1 Answers

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;
}
like image 118
Mihai Oprea Avatar answered Oct 11 '22 23:10

Mihai Oprea