heti/lib/modifiers/column.scss

34 lines
806 B
SCSS
Raw Normal View History

2020-02-20 21:37:10 +08:00
// Author: Sivan [sun.sivan@gmail.com]
// Description: define column styles.
2020-02-11 21:01:13 +08:00
@import "../variables";
@mixin hetiColumnModifier {
// 定义多栏排版
$selector-list: batch-fix-list(join($column-count-list, $column-width-list), '&--columns-');
#{join($selector-list, comma)} {
// 多行时不再设总宽度限制
max-width: none;
column-gap: 2em;
// 多栏排版时减半段间距
p {
margin-block-start: $std-block-unit / 2 / 2;
margin-block-end: $std-block-unit / 2;
text-indent: $text-indent-length;
}
}
@each $columns in $column-count-list {
&--columns-#{$columns} {
column-count: #{$columns};
}
}
@each $column-width in $column-width-list {
&--columns-#{$column-width} {
column-width: #{$column-width};
}
}
}