| 1 |
// Inline-Block list layout module. |
| 2 |
// |
| 3 |
// Easy mode using simple descendant li selectors: |
| 4 |
// |
| 5 |
// ul.nav { |
| 6 |
// @import inline-block-list; |
| 7 |
// } |
| 8 |
// |
| 9 |
// Advanced mode: |
| 10 |
// If you need to target the list items using a different selector then use |
| 11 |
// `@include inline-block-list-container` on your ul/ol and |
| 12 |
// `@include inline-block-list-item` on your li. This may help when working |
| 13 |
// on layouts involving nested lists. For example: |
| 14 |
// |
| 15 |
// ul.nav { |
| 16 |
// @include inline-block-list-container; |
| 17 |
// > li { |
| 18 |
// @include inline-block-list-item; |
| 19 |
// } |
| 20 |
// } |
| 21 |
|
| 22 |
@import "bullets"; |
| 23 |
@import "horizontal-list"; |
| 24 |
@import "../../utilities/general/float"; |
| 25 |
@import "../../css3/inline-block"; |
| 26 |
|
| 27 |
// Can be mixed into any selector that target a ul or ol that is meant |
| 28 |
// to have an inline-block layout. Used to implement `inline-block-list`. |
| 29 |
@mixin inline-block-list-container { |
| 30 |
@include horizontal-list-container; } |
| 31 |
|
| 32 |
// Can be mixed into any li selector that is meant to participate in a horizontal layout. |
| 33 |
// Used to implement `inline-block-list`. |
| 34 |
@mixin inline-block-list-item($padding: false) { |
| 35 |
@include no-bullet; |
| 36 |
@include inline-block; |
| 37 |
white-space: nowrap; |
| 38 |
@if $padding { |
| 39 |
padding: { |
| 40 |
left: $padding; |
| 41 |
right: $padding; |
| 42 |
}; |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
// A list(ol,ul) that is layed out such that the elements are inline-block and won't wrap. |
| 47 |
@mixin inline-block-list($padding: false) { |
| 48 |
@include inline-block-list-container; |
| 49 |
li { |
| 50 |
@include inline-block-list-item($padding); } } |