_mixins.scss 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @mixin breakpoint($point) {
  2. @if $point == 2x {
  3. @media (min-width:$size-2x) {
  4. @content;
  5. }
  6. } @else if $point == xl {
  7. @media (max-width: $size-xl) {
  8. @content;
  9. }
  10. } @else if $point == lg {
  11. @media (max-width: $size-lg) {
  12. @content;
  13. }
  14. } @else if $point == md {
  15. @media (max-width: $size-md) {
  16. @content;
  17. }
  18. } @else if $point == sm {
  19. @media (max-width: $size-sm) {
  20. @content;
  21. }
  22. } @else if $point == xs {
  23. @media (max-width: $size-xs) {
  24. @content;
  25. }
  26. } @else {
  27. @warn "Breakpoint mixin supports: xs, sm, md, lg, xl, 2x";
  28. }
  29. }
  30. @mixin vertical-align($position: relative) {
  31. position: $position;
  32. top: 50%;
  33. transform: translateY(-50%);
  34. }
  35. @mixin button-primary() {
  36. background: $primary-color;
  37. border-color: $primary-color-dark;
  38. color: $light-color;
  39. &:focus,
  40. &:hover {
  41. background: darken($primary-color-dark, 2%);
  42. border-color: darken($primary-color-dark, 5%);
  43. color: $light-color;
  44. }
  45. &:active,
  46. &.active {
  47. background: darken($primary-color-dark, 4%);
  48. border-color: darken($primary-color-dark, 7%);
  49. color: $light-color;
  50. }
  51. }