@mixin 指令允许我们定义一个可以在整个样式表中重复使用的样式。
    @include 指令可以将混入(mixin)引入到文档中。

    1. @mixin flex {
    2. display: flex;
    3. }
    4. @mixin flex-center-v {
    5. display: flex;
    6. align-items: center;
    7. }
    8. @mixin flex-center-h {
    9. display: flex;
    10. justify-content: center;
    11. }
    12. @mixin flex-center {
    13. display: flex;
    14. align-items: center;
    15. justify-content: center;
    16. }
    17. @mixin flex-column {
    18. display: flex;
    19. flex-flow: column wrap;
    20. align-items: center;
    21. justify-content: center;
    22. }
    23. @mixin ellipsis($lines) {
    24. overflow: hidden;
    25. text-overflow: ellipsis;
    26. display: -webkit-box;
    27. -webkit-line-clamp: $lines;
    28. -webkit-box-orient: vertical;
    29. }
    30. @mixin scroller {
    31. &::-webkit-scrollbar {
    32. background: transparent;
    33. width: 8px;
    34. }
    35. &::-webkit-scrollbar-thumb {
    36. background: #ddd;
    37. }
    38. }
    1. $purple: #d08fff;
    2. $green: #43ac8d;
    3. $primary: #ef7f45;
    4. $primary-dark: #eb6528;
    5. $blue: #1b9ef0;
    6. $red: #ff3b45;
    1. @import "./variables.scss";
    2. @import "./mixins.scss";
    3. #app {
    4. font-family: Avenir, Helvetica, Arial, sans-serif;
    5. -webkit-font-smoothing: antialiased;
    6. -moz-osx-font-smoothing: grayscale;
    7. color: #2c3e50;
    8. a {
    9. color: #42b983;
    10. }
    11. }
    12. .column-center {
    13. display: flex;
    14. flex-flow: column wrap;
    15. align-items: center;
    16. }
    17. .flex {
    18. @include flex;
    19. }
    20. .flex-center {
    21. @include flex-center;
    22. }
    23. .flex-center-v {
    24. @include flex-center-v;
    25. }
    26. .flex-center-h {
    27. @include flex-center-h;
    28. }