_mixins.less 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @import '_remixins.less';
  2. .radius(@val) {
  3. @rem-val: (unit(@val) / @base-font-size-px);
  4. border-radius:~"@{rem-val}rem";
  5. background-clip: padding-box;
  6. }
  7. .border (@width: 1px, @type: solid, @color: #ccc) {
  8. @rem-w: (unit(@width) / @base-font-size-px);
  9. border: ~"@{width} @{type} @{color}";
  10. border: ~"@{rem-w}rem @{type} @{color}";
  11. }
  12. .border-top (@width: 1px, @type: solid, @color: #ccc) {
  13. @rem-w: (unit(@width) / @base-font-size-px);
  14. border-top: ~"@{width} @{type} @{color}";
  15. border-top: ~"@{rem-w}rem @{type} @{color}";
  16. }
  17. .border-bottom (@width: 1px, @type: solid, @color: #ccc) {
  18. @rem-w: (unit(@width) / @base-font-size-px);
  19. border-bottom: ~"@{width} @{type} @{color}";
  20. border-bottom: ~"@{rem-w}rem @{type} @{color}";
  21. }
  22. .border-left (@width: 1px, @type: solid, @color: #ccc) {
  23. @rem-w: (unit(@width) / @base-font-size-px);
  24. border-left: ~"@{width} @{type} @{color}";
  25. border-left: ~"@{rem-w}rem @{type} @{color}";
  26. }
  27. .border-right (@width: 1px, @type: solid, @color: #ccc) {
  28. @rem-w: (unit(@width) / @base-font-size-px);
  29. border-right: ~"@{width} @{type} @{color}";
  30. border-right: ~"@{rem-w}rem @{type} @{color}";
  31. }
  32. .drop-shadow (@x: 0px, @y: 1px, @blur: 2px, @spread: 0px, @color: rgba(0, 0, 0, .25)) {
  33. @rem-x: (unit(@x) / @base-font-size-px);
  34. @rem-y: (unit(@y) / @base-font-size-px);
  35. @rem-b: (unit(@blur) / @base-font-size-px);
  36. @rem-s: (unit(@spread) / @base-font-size-px);
  37. -webkit-box-shadow: ~"@{rem-x}rem @{rem-y}rem @{rem-b}rem @{rem-s}rem @{color}";
  38. -moz-box-shadow: ~"@{rem-x}rem @{rem-y}rem @{rem-b}rem @{rem-s}rem @{color}";
  39. box-shadow: ~"@{rem-x}rem @{rem-y}rem @{rem-b}rem @{rem-s}rem @{color}";
  40. }
  41. .box-sizing (@type: border-box) {
  42. -webkit-box-sizing: @type;
  43. -moz-box-sizing: @type;
  44. -ms-box-sizing: @type;
  45. box-sizing: @type;
  46. }
  47. .background-color (@color) {
  48. background-color: @color;
  49. }
  50. .column-width (@width) {
  51. @rem-w: (unit(@width) / @base-font-size-px);
  52. -webkit-column-width: ~"@{rem-w}rem";
  53. -moz-column-width: ~"@{rem-w}rem";
  54. -ms-column-width: ~"@{rem-w}rem";
  55. column-width: ~"@{rem-w}rem";
  56. }
  57. .column-width-raw (@width) {
  58. -webkit-column-width: @width;
  59. -moz-column-width: @width;
  60. -ms-column-width: @width;
  61. column-width: @width;
  62. }
  63. .blur(@val) {
  64. -webkit-filter: blur(@val);
  65. -moz-filter: blur(@val);
  66. -o-filter: blur(@val);
  67. -ms-filter: blur(@val);
  68. filter: blur(@val);
  69. }