_mixins.scss 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Mixins
  2. @mixin link-decoration($base: none, $focus_or_hover: initial) {
  3. a {
  4. text-decoration: $base;
  5. &:focus,
  6. &:hover {
  7. text-decoration: $focus_or_hover;
  8. }
  9. }
  10. .btn-link {
  11. text-decoration: $base;
  12. }
  13. }
  14. @mixin link-variant($parent, $color, $hover-color, $underline: false) {
  15. #{$parent} {
  16. color: $color;
  17. &:hover {
  18. color: $hover-color;
  19. }
  20. @if $underline {
  21. text-decoration: underline;
  22. }
  23. }
  24. }
  25. @mixin optional-at-root($sel) {
  26. @at-root #{if(not &, $sel, selector-append(&, $sel))} {
  27. @content;
  28. }
  29. }
  30. // placeholder allows styling of the placeholder used in search input etc.
  31. @mixin placeholder {
  32. @include optional-at-root("::-webkit-input-placeholder") {
  33. @content;
  34. }
  35. @include optional-at-root(":-moz-placeholder") {
  36. @content;
  37. }
  38. @include optional-at-root("::-moz-placeholder") {
  39. @content;
  40. }
  41. @include optional-at-root(":-ms-input-placeholder") {
  42. @content;
  43. }
  44. }