_mixins.scss 657 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Responsive breakpoints mixin
  2. @mixin add_variables( $view: frontend ) {
  3. @if frontend == $view {
  4. :root {
  5. @content;
  6. }
  7. }
  8. @if editor == $view {
  9. body {
  10. @content;
  11. }
  12. }
  13. }
  14. // Crop Text Boundry
  15. // - Sets a fixed-width on content within alignwide and alignfull blocks
  16. @mixin crop-text($inset-line-height: 1) {
  17. line-height: $inset-line-height;
  18. $offset-top: calc(.5em * #{$inset-line-height} + -.38);
  19. $offset-bottom: calc(.5em * #{$inset-line-height} + -.39);
  20. &:before,
  21. &:after {
  22. content: '';
  23. display: block;
  24. height: 0;
  25. width: 0;
  26. }
  27. &:before {
  28. margin-bottom: -($offset-top);
  29. }
  30. &:after {
  31. margin-top: -($offset-bottom);
  32. }
  33. }