_selection.scss 848 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. @charset "UTF-8";
  2. /// Outputs the spec and prefixed versions of the `::selection` pseudo-element.
  3. ///
  4. /// @param {Bool} $current-selector [false]
  5. /// If set to `true`, it takes the current element into consideration.
  6. ///
  7. /// @example scss - Usage
  8. /// .element {
  9. /// @include selection(true) {
  10. /// background-color: #ffbb52;
  11. /// }
  12. /// }
  13. ///
  14. /// @example css - CSS Output
  15. /// .element::-moz-selection {
  16. /// background-color: #ffbb52;
  17. /// }
  18. ///
  19. /// .element::selection {
  20. /// background-color: #ffbb52;
  21. /// }
  22. @mixin selection($current-selector: false) {
  23. @if $current-selector {
  24. &::-moz-selection {
  25. @content;
  26. }
  27. &::selection {
  28. @content;
  29. }
  30. } @else {
  31. ::-moz-selection {
  32. @content;
  33. }
  34. ::selection {
  35. @content;
  36. }
  37. }
  38. }