index.scss 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // @import url(reset.css);
  2. @import './reset.scss';
  3. $aa:#ff0;
  4. $box:50px !default;
  5. $box1:20px !global;
  6. @mixin vase {
  7. border: 1px solid #f00;
  8. color: purple;
  9. width: 200px;
  10. height: 100px;
  11. display: flex;
  12. justify-content: center;
  13. align-items: center;
  14. }
  15. @mixin part6($aa,$bb,$cc) {
  16. width: $aa;
  17. height: $bb;
  18. background-color: $cc;
  19. }
  20. @mixin part1($a1) {
  21. border-radius: $a1;
  22. }
  23. @mixin part2($a1:20px,$a2:double) {
  24. border-radius: $a1;
  25. border: 3px $a2 #00f;
  26. }
  27. @mixin part3($aaa...) {
  28. box-shadow: $aaa;
  29. }
  30. .part4{
  31. cursor: pointer; //鼠标变小手
  32. width: 100px;
  33. height: 100px;
  34. background: plum;
  35. }
  36. %part5 {
  37. width: 100px;
  38. height: 100px;
  39. border-radius: 50%;
  40. border: 3px dotted #0f0;
  41. }
  42. @function part7($a) {
  43. @return $a * 2;
  44. }
  45. .box {
  46. width: 800px;
  47. height: 800px;
  48. border: 1px solid #000;
  49. background-color: $aa;
  50. // @include part1(10px);
  51. @include part2();
  52. @include part3(30px 35px 15px #f0f);
  53. font: {
  54. size: 25px;
  55. weight: 600;
  56. }
  57. h1 {
  58. font-size: $box1;
  59. color: red;
  60. // @extend .part4;
  61. }
  62. .main {
  63. @include vase;
  64. color: #00f;
  65. &:hover {
  66. color: #f00;
  67. }
  68. }
  69. h2,h3,h4,h5,h6 {
  70. // @extend .part4;
  71. // @extend %part5;
  72. // @include part6(100px,200px,#0ff)
  73. // #{函数名(变量值)}px
  74. width: (400/2) + px;
  75. height: #{part7(150)}px;
  76. background-color: #ff0+#0f0; // #ff0
  77. background-color: #f00+#fff; // #fff
  78. margin-top: 20px;
  79. }
  80. }
  81. // .main::after {
  82. // content: '放假了';
  83. // color: #f00;
  84. // }
  85. // 今天天气真好
  86. /*
  87. 哈哈哈哈
  88. */