_mixins.less 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. @a:percentage((1.0-alpha(@color))/5.0);
  49. background-color: hsl(hue(@color), saturation(@color), lightness(@color)+@a);
  50. background-color: @color;
  51. }
  52. .column-width (@width) {
  53. @rem-w: (unit(@width) / @base-font-size-px);
  54. -webkit-column-width: ~"@{rem-w}rem";
  55. -moz-column-width: ~"@{rem-w}rem";
  56. -ms-column-width: ~"@{rem-w}rem";
  57. column-width: ~"@{rem-w}rem";
  58. }
  59. .column-width-raw (@width) {
  60. -webkit-column-width: @width;
  61. -moz-column-width: @width;
  62. -ms-column-width: @width;
  63. column-width: @width;
  64. }
  65. .blur(@val) {
  66. -webkit-filter: blur(@val);
  67. -moz-filter: blur(@val);
  68. -o-filter: blur(@val);
  69. -ms-filter: blur(@val);
  70. filter: blur(@val);
  71. }