1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
// Columns
@import "compass/support";
// The prefixed support threshold for columns.
// Defaults to the $critical-usage-threshold.
$multicolumn-support-threshold: $critical-usage-threshold !default;
// Specify the shorthand `columns` property.
//
// Example:
//
// @include columns(20em 2);
@mixin columns($width-and-count) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
columns: $width-and-count
));
}
// Specify the number of columns
@mixin column-count($count) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-count: $count
));
}
// Specify the gap between columns e.g. `20px`
@mixin column-gap($width) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-gap: $width
));
}
// Specify the width of columns e.g. `100px`
@mixin column-width($width) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-width: $width
));
}
// Specify how many columns an element should span across.
//
// * legal values are 1, all
@mixin column-span($columns) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-span: $columns
));
}
// Specify the width of the rule between columns e.g. `1px`
@mixin column-rule-width($width) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
rule-width: $width
));
}
// Specify the style of the rule between columns e.g. `dotted`.
// This works like border-style.
@mixin column-rule-style($style) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
rule-style: $style
));
}
// Specify the color of the rule between columns e.g. `blue`.
// This works like border-color.
@mixin column-rule-color($color) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
rule-color: $color
));
}
// Mixin encompassing all column rule properties
// For example:
//
// @include column-rule(1px, solid, #c00)
//
// Or the values can be space separated:
//
// @include column-rule(1px solid #c00)
@mixin column-rule($width, $style: null, $color: null) {
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-rule: $width $style $color
));
}
// All-purpose mixin for setting column breaks.
//
// * legal values for $type : before, after, inside
// * legal values for '$value' are dependent on $type
// * when $type = before, legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column
// * when $type = after, legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column
// * when $type = inside, legal values are auto, avoid, avoid-page, avoid-column
//
// Examples:
// h2.before {@include column-break(before, always);}
// h2.after {@include column-break(after, always); }
// h2.inside {@include column-break(inside); }
//
// Which generates:
// h2.before {
// -webkit-column-break-before: always;
// break-before: always;}
//
// h2.after {
// -webkit-column-break-after: always;
// break-after: always; }
//
// h2.inside {
// -webkit-column-break-inside: auto;
// break-inside: auto;}
@mixin column-break($type: before, $value: auto){
@include with-each-prefix(multicolumn, $multicolumn-support-threshold) {
@if $current-prefix == -webkit {
// Webkit uses non-standard syntax
-webkit-column-break-#{$type}: $value;
} @else if $current-prefix == -moz {
// Moz uses a different non-standard syntax
-moz-page-break-#{$type}: $value;
} @else {
@include prefix-prop(break-#{$type}, $value);
}
}
}
// Mixin for setting break-before
//
// * legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column
//
// Example:
// h2.before {@include break-before(always);}
//
// Which generates:
//
// h2.before {
// -webkit-column-break-before: always;
// break-before: always;}
@mixin break-before($value: auto){
@include column-break(before, $value);
}
@mixin column-break-before($value: auto){
@include column-break(before, $value);
@warn '"column-break-before" has been deprecated in favor of the official syntax: "break-before".';
}
// Mixin for setting break-after
//
// * legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column
//
// Example:
// h2.after {@include break-after(always); }
//
// Which generates:
//
// h2.after {
// -webkit-column-break-after: always;
// break-after: always; }
@mixin break-after($value: auto){
@include column-break(after, $value);
}
@mixin column-break-after($value: auto){
@include column-break(after, $value);
@warn '"column-break-after" has been deprecated in favor of the official syntax: "break-after".';
}
// Mixin for setting break-inside
//
// * legal values are auto, avoid, avoid-page, avoid-column
//
// Example:
// h2.inside {@include break-inside();}
//
// Which generates:
//
// h2.inside {
// -webkit-column-break-inside: auto;
// break-inside: auto;}
@mixin break-inside($value: auto){
@include column-break(inside, $value);
}
@mixin column-break-inside($value: auto){
@include column-break(inside, $value);
@warn '"column-break-inside" has been deprecated in favor of the official syntax: "break-inside".';
}
// Mixin for setting column-span
//
// * legal values: none, all
//
// Example:
// h2.span {@include column-span();}
@mixin column-span($span: all){
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-span: $span
));
}
// Mixin for setting column-fill
//
// * legal values: auto, balance
//
// Example:
// h2.fill {@include column-fill();}
@mixin column-fill($fill: balance){
@include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
column-fill: $fill
));
}
|