_mixins.guide-line.scss 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Vertical and horizontal divider lines to visualise nesting in
  3. * StreamField and InlinePanel.
  4. */
  5. $guide-line-default-color: theme('colors.grey.150');
  6. @mixin guide-line-vertical() {
  7. // 3px dash height, 3px space, 1px dash width.
  8. background-size: 1px 6px;
  9. background-repeat: repeat-y;
  10. background-image: linear-gradient(
  11. to bottom,
  12. var(--guide-line-color, $guide-line-default-color) 50%,
  13. rgba(255, 255, 255, 0) 0%
  14. );
  15. @media (forced-colors: active) {
  16. border-inline-start: 1px dashed var(--guide-line-color, CanvasText);
  17. background: none;
  18. }
  19. }
  20. @mixin guide-line-horizontal() {
  21. min-height: 1px;
  22. // 3px dash width, 3px space, 1px dash height.
  23. background-size: 6px 1px;
  24. background-repeat: repeat-x;
  25. background-image: linear-gradient(
  26. to right,
  27. var(--guide-line-color, $guide-line-default-color) 50%,
  28. rgba(255, 255, 255, 0) 0%
  29. );
  30. // Guide lines are always shown in forced-colors mode, as it’s
  31. // not possible to have transparent borders there.
  32. @media (forced-colors: active) {
  33. border-top: 1px dashed var(--guide-line-color, CanvasText);
  34. background: none;
  35. }
  36. }
  37. // More visible guide line for nested panels in the currently-active DOM tree.
  38. @mixin guide-line-nested() {
  39. &:is(:hover, :focus-within) {
  40. --guide-line-color: theme('colors.primary.DEFAULT');
  41. @media (forced-colors: active) {
  42. --guide-line-color: Highlight;
  43. }
  44. }
  45. }