demo.scss 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // @import url(reset.css);
  2. @import "./reset.scss";
  3. $bg: #00f;
  4. $ww: 30px !default;
  5. $a: bold;
  6. p {
  7. color: $bg;
  8. font-size: $ww;
  9. $cc: #f00 !global;
  10. //我的注释1
  11. /*
  12. 多行注释
  13. */
  14. }
  15. @mixin border($radius:20px,$style:double) {
  16. border:10px $style #f00;
  17. color: #00f;
  18. background-color: #ff0;
  19. font-size: 30px;
  20. width: 200px;
  21. height: 100px;
  22. margin-top: 20px;
  23. border-radius: $radius;
  24. }
  25. @mixin bos($shadow...) {
  26. box-shadow: $shadow;
  27. }
  28. .box {
  29. @include border;
  30. @include bos(10px 10px 10px #0f0)
  31. // h1 {
  32. // .main {
  33. // color: aquamarine;
  34. // }
  35. // }
  36. // h2 {
  37. // color: #f00;
  38. // }
  39. // h3 {
  40. // color: blueviolet;
  41. // a {
  42. // font-size: 30px;
  43. // &:hover {
  44. // color: aqua;
  45. // }
  46. // }
  47. // }
  48. }
  49. .newBox {
  50. @include border;
  51. }
  52. #list {
  53. width: 200px;
  54. height: 200px;
  55. background: #f00;
  56. }
  57. .newList {
  58. // @extend .box;
  59. }
  60. %a1 {
  61. color: #0f0;
  62. }
  63. .newList {
  64. // @extend %a1;
  65. }
  66. @function fn1($aa) {
  67. @return $aa*2;
  68. }
  69. .mask {
  70. width: #{fn1(20)}px;
  71. height: 50px;
  72. background: #0f0 + #f00;
  73. }