sass-site/source/assets/stylesheets/components/_lists.scss

92 lines
2.0 KiB
SCSS
Raw Normal View History

2013-02-09 04:10:33 +01:00
// ===========================================================================
// LISTS
2013-02-11 00:04:29 +01:00
// ---------------------------------------------------------------------------
// LIST STYLE MIXINS
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
// FLOATED LIST ITEMS
@mixin horizontal-list($break-size: false,
$container-selector: "ul",
$list-selectors: "li",
$last-list-selector: $list-selectors) {
@if $break-size != false {
#{$container-selector} { @extend %clearfix-#{$break-size}; }
#{$list-selectors} { @extend %float-left-#{$break-size}; }
#{$last-list-selector}:last-child {
@extend %float-left-last-child-#{$break-size};
}
}
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
@else {
2013-02-09 04:10:33 +01:00
#{$container-selector} { @extend %clearfix; }
#{$list-selectors} { @extend %float-left; }
#{$last-list-selector}:last-child { @extend %float-left-last-child; }
}
2013-02-11 00:04:29 +01:00
}
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
// DISPLAY: INLINE ON LIST ITEMS
@mixin horizontal-list-inline {
li {
display: inline-block;
margin-right: $gutter-width;
&:last-child { margin-right: 0; }
2013-02-09 04:10:33 +01:00
}
2013-02-11 00:04:29 +01:00
}
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
// ---------------------------------------------------------------------------
// LIST SELECTORS
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
%content-list {
@include reset-list;
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
li {
padding: {
top: 1em;
bottom: 1em;
}
2013-02-09 04:10:33 +01:00
}
}
%horizontal-list { @include horizontal-list; }
2013-02-11 00:04:29 +01:00
%horizontal-list-inline { @include horizontal-list-inline; }
2013-02-09 04:10:33 +01:00
// ---------------------------------------------------------------------------
// iPhone
@mixin components-lists-iPhone {
%horizontal-list-iPhone { @include horizontal-list(iPhone); }
2013-02-11 00:04:29 +01:00
%horizontal-description-list-iPhone {
@include horizontal-list(iPhone, "dl", "dt, dd", "dd");
}
%horizontal-list-inline-iPhone { @include horizontal-list-inline; }
2013-02-09 04:10:33 +01:00
}
// ---------------------------------------------------------------------------
// SMALL TABLET
@mixin components-lists-small-tablet {
%horizontal-list-small-tablet { @include horizontal-list(small-tablet); }
2013-02-11 00:04:29 +01:00
%horizontal-list-inline-small-tablet { @include horizontal-list-inline; }
2013-02-09 04:10:33 +01:00
}