scss: add vars to manage min and max sidebar width (#38451)

This commit is contained in:
Thomas Jund 2019-12-12 11:27:39 +01:00
parent a156f1bd47
commit c0b718b63a
2 changed files with 20 additions and 1 deletions

View File

@ -77,6 +77,16 @@ paramètre, la deuxième sa description et la troisième la valeur par défaut.
<td><p>Largeur de la barre latérale</p></td>
<td><p><var>300px</var></p></td>
</tr>
<tr>
<td><p><code>$sidebar-max-width</code></p></td>
<td><p>Largeur maximale de la barre latérale, utile dans le cas où la valeur de <code>$sidebar-width</code> est définie en %</p></td>
<td><p><var>$sidebar-width</var></p></td>
</tr>
<tr>
<td><p><code>$sidebar-min-width</code></p></td>
<td><p>Largeur minimale de la barre latérale, utile dans le cas où la valeur de <code>$sidebar-width</code> est définie en %</p></td>
<td><p><var>0</var></p></td>
</tr>
<tr>
<td><p><code>$notification-style</code></p></td>
<td><p>Rendu des notifications (messages, erreurs, etc.), soit « classic »

View File

@ -5,6 +5,8 @@ $footer-background: #666666 !default;
$footer-color: white !default;
$top-logo-width: 0 !default;
$sidebar-width: 300px !default;
$sidebar-max-width: $sidebar-width !default;
$sidebar-min-width: 0 !default;
$sidebar-position: left !default;
html, body {
@ -99,7 +101,10 @@ div#main-content {
-ms-flex: 0 0 $sidebar-width;
-webkit-flex: 0 0 $sidebar-width;
flex: 0 0 $sidebar-width;
max-width: $sidebar-width;
max-width: $sidebar-max-width;
@if $sidebar-min-width != 0 {
min-width: $sidebar-min-width;
}
@if $sidebar-position == right {
-ms-flex-order: 1;
-webkit-order: 1;
@ -136,6 +141,10 @@ div#main-content {
-webkit-flex: 0 0 auto;
flex: 0 0 auto;
max-width: 100%;
// don't apply min-width on mobile
@if $sidebar-min-width != 0 {
min-width: 0;
}
margin: 0 0.7em;
div.cell {
margin-left: 0;