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

140 lines
2.5 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: {
left: -(sl-px-to-rem(2px));
right: sl-px-to-rem(32px);
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;
2018-10-24 00:06:39 +02:00
margin: 0 #{-$gutter-width * 2};
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: {
2018-10-24 00:06:39 +02:00
right: $gutter-width * 2;
left: $gutter-width * 2;
2013-10-09 12:30:53 +02:00
}
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;
2018-10-24 00:06:39 +02:00
h2 {
display: inline-block;
white-space: nowrap;
}
2013-10-16 09:14:29 +02:00
2013-10-12 20:25:16 +02:00
@include breakpoint($tablet-large) {
2013-10-12 23:39:55 +02:00
> li {
2013-10-12 20:25:16 +02:00
width: 50%;
&:nth-child(odd) { clear: both; }
}
}
}
.list-tiled {
@extend %list-columns;
@include breakpoint($tablet-large) {
2013-10-12 23:39:55 +02:00
> li {
2013-10-12 20:25:16 +02:00
width: 100 / 3 * 1%;
&:nth-child(3n+4) { clear: both; }
}
}
}
2013-10-13 01:26:11 +02:00
ol {
&.list-columns,
&.list-feature {
list-style: decimal {
position: inside;
}
2013-10-12 23:39:55 +02:00
2013-10-13 01:26:11 +02:00
ul,
ol { list-style-position: outside; }
span.info {
@include font-size-small;
}
2013-10-13 01:26:11 +02:00
}
2013-10-12 23:39:55 +02:00
}
2013-10-09 12:30:53 +02:00
%description-list {
2013-10-13 01:26:11 +02:00
max-width: none;
@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;
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
2013-10-12 23:39:55 +02:00
.list-feature {
@extend %reset-list;
@include font-size-large;
}
2018-10-24 00:06:39 +02:00
.sl-c-list {
margin: 0;
padding: 0;
list-style: none;
}
.sl-c-list--navigation__item,
.sl-c-list--navigation-wrap li { // account for when markdown is used.
margin: sl-px-to-rem(2px) 0;
2018-10-24 00:06:39 +02:00
}
.sl-c-list--navigation .sl-c-list--navigation,
.sl-c-list--navigation-wrap ul ul {
margin-left: sl-px-to-rem(16px);
2018-10-24 00:06:39 +02:00
}