_table-layout.scss 471 B

1234567891011121314151617
  1. /**
  2. * [tableLayout 模拟table布局垂直居中对齐,只传两个参数将识别为水平垂直居中]
  3. * @param {[string]} $parent [eg:'.parent']
  4. * @param {[string]} $child [eg:'.child']
  5. * @param {[string]} $align [eg:center,可选参数,默认为水平居中]
  6. */
  7. @mixin tableLayout($parent, $child, $align: center) {
  8. #{$parent} {
  9. display: table;
  10. #{$child} {
  11. display: table-cell;
  12. text-align: $align;
  13. vertical-align: middle;
  14. }
  15. }
  16. }