_flex.scss 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* ==================
  2. 弹性布局
  3. ==================== */
  4. .flex {
  5. display: flex !important;
  6. &-sub {
  7. flex: 1 !important;
  8. }
  9. &-twice {
  10. flex: 2 !important;
  11. }
  12. &-treble {
  13. flex: 3 !important;
  14. }
  15. &-column {
  16. flex-direction: column !important;
  17. }
  18. &-row {
  19. flex-direction: row !important;
  20. }
  21. &-column-reverse {
  22. flex-direction: column-reverse !important;
  23. }
  24. &-row-reverse {
  25. flex-direction: row-reverse !important;
  26. }
  27. &-wrap {
  28. flex-wrap: wrap !important;
  29. }
  30. &-center {
  31. @include flex-center;
  32. }
  33. &-bar {
  34. @include flex-bar;
  35. }
  36. }
  37. .basis {
  38. @each $class, $value in (xs: 20%, sm: 40%, df: 50%, lg: 60%, xl: 80%) {
  39. &-#{$class} {
  40. flex-basis: $value !important;
  41. }
  42. }
  43. }
  44. .align {
  45. @each $class,
  46. $value
  47. in (start: flex-start, end: flex-end, center: center, stretch: stretch, baseline: baseline)
  48. {
  49. &-#{$class} {
  50. align-items: $value !important;
  51. }
  52. }
  53. }
  54. .self {
  55. @each $class,
  56. $value
  57. in (start: flex-start, end: flex-end, center: center, stretch: stretch, baseline: baseline)
  58. {
  59. &-#{$class} {
  60. align-self: $value !important;
  61. }
  62. }
  63. }
  64. .justify {
  65. @each $class,
  66. $value
  67. in (
  68. start: flex-start,
  69. end: flex-end,
  70. center: center,
  71. between: space-between,
  72. around: space-around
  73. )
  74. {
  75. &-#{$class} {
  76. justify-content: $value !important;
  77. }
  78. }
  79. }