i'm new on using compas / susy and i'm building my grid with the mobile first approach.
after lot of reads, i don't understand how to use compass breakpoints ($mobile,$tablet,$desktop) with susy.
Actually i need to set my $container width:
//*Réglage de la grille de Susy - approche mobile-first
$total-columns: 8; // nombre de colonnes de la grille de base
$column-width: 4em; // largeur de chaque colonnes
$gutter-width: 1em; // taille de la gouttière entre colonnes
$grid-padding: $gutter-width; // grid-padding equal to gutters
//Réglage du nombre de colonnes pour at-breakpoint() mixin
// qui simplifie les media-queries
$mobile : 4;
$tablet : 10;
$desktop : 14;
then for my container :
#general{
@include container;
@include susy-grid-background;
@include at-breakpoint($desktop) {
@include ???
}
}
after for elements i think this could be:
#header{
@include @include span-columns(3);
@include at-breakpoint($desktop) {
@include span-columns(13, $desktop);
@include prefix(3, $desktop);
}
thanks for help
EDIT1:
whith this code
#general{
//Approche mobile-first,réglage pour mobile
@include container;
@include susy-grid-background;
#header{}
#header-inner{}
#content-global{}
#left-content{}
#content-inner{}
#right-content{}
#footer{}
@include at-breakpoint($desktop) {/* //Dimensions pour les pc*/
@include set-container-width;
#header{@include span-columns($desktop,$desktop);}
#header-inner{}
#content-global{@include span-columns($desktop,$desktop);}
#left-content{@include span-columns(2 alpha,$desktop);}
#content-inner{@include span-columns(10,$desktop);}
#right-content{@include span-columns(2 omega,$desktop);}
#footer{@include span-columns($desktop,$desktop);}
}
@include at-breakpoint($tablet) {/* //Dimensions pour les tablettes*/
@include set-container-width;
#header{}
#header-inner{}
#content-global{}
#left-content{}
#content-inner{}
#right-content{}
#footer{}
}
}
firebug give me:
@media (min-width: 36.75em)
#general {
max-width: 49em; => applied
}
@media (min-width: 51.75em)
#general {
max-width: 69em;=> not applied
}
why my breakpoint isn't applied ?
does exist a mixin or something like that to make images responsive (susy or compass)?
EDIT2: still testing and seem this work better but the container isn't centered as it was with your suggestion.but why ? i face to the basic container setting, and my columns settings doesn't override mobile-first setting too.
#general{
//Approche mobile-first,réglage pour mobile
@include container;
@include susy-grid-background;
@include at-breakpoint($desktop) {/* //Dimensions pour les pc*/
@include span-columns($desktop);
#header{@include span-columns($desktop);}
#left-content{@include span-columns(2 alpha,$desktop);}...}
EDIT3: another test that seem better, i think my at-breakpoint are applied but the max width is still 49em instead of 69em..
#general{
//Approche mobile-first,réglage pour mobile
@include container;
@include susy-grid-background;
@include at-breakpoint($desktop) {/* //Dimensions pour les pc*/
@include set-container-width($desktop);
#header{@include span-columns($desktop);}
#left-content{@include span-columns(2 alpha,$desktop);}...}
at this point, i think that @include set-container-width($desktop);
is better for the container width changing, and @include span-columns($desktop);
for the elements nested in the container.
EDIT4(08/11/13)
#header {
.headHaut {@include span-columns($mobile);
.logoHead { @include set-container-width;}
.menuImg { @include set-container-width;}
}
.headBas {@include span-columns($mobile);
.site-slogan{@include span-columns($mobile);}
}
@include at-breakpoint($desktop) {/* //Dimensions pour les pc*/
.headHaut {@include set-container-width;
.logoHead { @include span-columns(3,$desktop);}
.menuImg { @include span-columns(7 omega,$desktop);}
}
.headBas {@include span-columns($desktop);
.site-slogan{@include span-columns(7,$desktop);}
}
}
doesn't render the same as,with the same grid settings,
#header {
.headHaut {@include span-columns($mobile);
.logoHead { @include set-container-width;}
.menuImg { @include set-container-width;}
}
.headBas {@include span-columns($mobile);
.site-slogan{@include span-columns($mobile);}
}
@include at-breakpoint($desktop) {/* //Dimensions pour les pc*/
#header{
.headHaut {@include set-container-width;
.logoHead { @include span-columns(3,$desktop);}
.menuImg { @include span-columns(7 omega,$desktop);}
}
.headBas {@include span-columns($desktop);
.site-slogan{@include span-columns(7,$desktop);}
}
} }