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

86 lines
1.7 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;
left: $gutter-width;
}
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-09 12:30:53 +02:00
.tiled-list {
@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
max-width: none;
li {
float: left;
width: 100 / 3 * 1%;
padding: {
right: $gutter-width;
left: $gutter-width;
}
&:nth-child(3n+4) { clear: both; }
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-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) {}