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

106 lines
2.0 KiB
Plaintext
Raw Normal View History

2013-10-11 22:06:20 +02:00
@mixin reset-list {
2013-10-09 12:30:53 +02:00
margin: 0;
padding: 0;
list-style: none;
2013-02-11 00:04:29 +01:00
}
2013-02-09 04:10:33 +01:00
2013-10-11 22:06:20 +02:00
@mixin horizontal-list($resolution: false) {
@if $resolution == false { @extend %reset-list; }
@else { @extend %reset-list-#{$resolution}; }
2013-02-09 04:10:33 +01:00
2013-02-11 00:04:29 +01:00
li {
display: inline-block;
2013-10-09 12:30:53 +02:00
margin: {
right: -2px;
2013-10-12 20:25:16 +02:00
left: 2em;
2013-10-09 12:30:53 +02:00
}
2013-02-11 00:04:29 +01:00
2013-10-09 12:30:53 +02:00
&:first-child { margin-left: 0; }
2013-02-09 04:10:33 +01:00
}
2013-02-11 00:04:29 +01:00
}
2013-10-11 22:06:20 +02:00
%reset-list { @include reset-list; }
%horizontal-list { @include horizontal-list; }
<% data.layout.resolutions.each do |resolution| %>
@include breakpoint($<%= resolution.target %>) {
%reset-list-<%= resolution.target %> { @include reset-list; }
%horizontal-list-<%= resolution.target %> {
@include horizontal-list(<%= resolution.target %>);
}
}
<% end %>
2013-10-12 20:25:16 +02:00
%list-columns {
2013-10-09 12:30:53 +02:00
@extend %reset-list;
margin: 0 auto;
2013-10-12 17:51:13 +02:00
@include breakpoint($tablet-large) {
@extend %clear-fix-tablet-large;
margin: 0 #{-$gutter-width};
2013-10-09 12:30:53 +02:00
2013-10-12 20:25:16 +02:00
> li {
2013-10-09 12:30:53 +02:00
float: left;
padding: {
right: $gutter-width;
left: $gutter-width;
}
li {
float: none;
width: auto;
padding: {
right: 0;
left: 0;
}
}
2013-02-11 00:04:29 +01:00
}
2013-02-09 04:10:33 +01:00
}
}
2013-10-12 20:25:16 +02:00
.list-columns {
@extend %list-columns;
@include breakpoint($tablet-large) {
li {
width: 50%;
&:nth-child(odd) { clear: both; }
}
}
}
.list-tiled {
@extend %list-columns;
@include breakpoint($tablet-large) {
li {
width: 100 / 3 * 1%;
&:nth-child(3n+4) { clear: both; }
}
}
}
2013-10-09 12:30:53 +02:00
%description-list {
2013-10-11 22:06:20 +02:00
@include breakpoint($mobile-large) { dd { margin-left: 0; } }
2013-02-09 04:10:33 +01:00
2013-10-11 22:06:20 +02:00
@include breakpoint($tablet-small) {
2013-10-09 12:30:53 +02:00
@extend %table-layout-tablet-small;
table-layout: fixed;
text-align: left;
2013-02-09 04:10:33 +01:00
2013-10-09 12:30:53 +02:00
dt,
dd { @extend %table-layout-cell-baseline-tablet-small; }
2013-02-09 04:10:33 +01:00
2013-10-09 12:30:53 +02:00
dt { padding-right: $gutter-width / 2; }
dd { padding-left: $gutter-width / 2; }
2013-02-11 00:04:29 +01:00
}
2013-10-11 22:06:20 +02:00
@include breakpoint($screen-small) {
2013-10-09 12:30:53 +02:00
dt { width: 100 / 3 * 1%; }
}
2013-02-09 04:10:33 +01:00
}
2013-10-11 22:06:20 +02:00
@include breakpoint($mobile-small) {}