_mixins.guide-line.scss 1.5 KB

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