_mixins.scss 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Hide an element accesibly instead of using display: none;
  2. // Source: https://github.com/WordPress/gutenberg/blob/3da717b8d0ac7d7821fc6d0475695ccf3ae2829f/packages/block-editor/src/components/responsive-block-control/style.scss#L1
  3. @mixin hide-accesibly {
  4. border: 0;
  5. clip: rect(1px, 1px, 1px, 1px);
  6. clip-path: inset(50%);
  7. height: 1px;
  8. margin: -1px;
  9. overflow: hidden;
  10. padding: 0;
  11. position: absolute;
  12. width: 1px;
  13. word-wrap: normal !important;
  14. }
  15. @mixin post-meta-icon {
  16. display: flex;
  17. flex-wrap: wrap;
  18. &:before {
  19. align-self: center;
  20. content: '';
  21. display: inline-block;
  22. margin-right: calc(0.5 * var(--wp--custom--gap--baseline) );
  23. height: 16px;
  24. width: 16px;
  25. mask-size: contain;
  26. -webkit-mask-size: contain;
  27. mask-repeat: no-repeat;
  28. -webkit-mask-repeat: no-repeat;
  29. background-color: currentColor;
  30. }
  31. }
  32. @mixin post-meta-with-separator( $content ) {
  33. &.wp-block-group {
  34. gap: 0;
  35. }
  36. > * {
  37. &:not(:first-child):before {
  38. color: var(--wp--custom--color--foreground);
  39. content: $content;
  40. margin-left: var(--wp--custom--gap--baseline);
  41. margin-right: var(--wp--custom--gap--baseline);
  42. }
  43. }
  44. }