Angular UI Tree Styles 🌳

This SCSS file defines the core styles for the Angular UI Tree component.
It controls container layout, node appearance, and drag-and-drop visuals.
It ensures consistent spacing and theming for nested list structures.

Base Container: .angular-ui-tree

This class marks the root wrapper for the UI Tree.
It provides a hook for global tree styling and layout.

.angular-ui-tree {
  /* Main tree container */
}

Empty State Placeholder: .angular-ui-tree-empty πŸ“¦

This class styles the drop zone when no nodes exist.
It uses a dashed border and a subtle checkerboard background.

  • Border: 1px dashed #bbb
  • Min-height: 100px
  • Background color: #e5e5e5
  • Checkerboard pattern via CSS gradients
.angular-ui-tree-empty {
  border: 1px dashed #bbb;
  min-height: 100px;
  background-color: #e5e5e5;
  background-image:
    -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
    -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
    -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
    -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
  background-size: 60px 60px;
  background-position: 0 0, 30px 30px;
}

Node List Containers: .angular-ui-tree-nodes

This class resets list styling for node collections.
It supports deeply nested lists via indentation.

  • Position: relative
  • Margin & padding: 0
  • List-style: none
  • Nested indentation: 20px padding on child lists
.angular-ui-tree-nodes {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.angular-ui-tree-nodes .angular-ui-tree-nodes {
  padding-left: 20px;
}

Nodes & Placeholders:

.angular-ui-tree-node

.angular-ui-tree-placeholder

Both classes share base sizing and positioning.
They define default height and line spacing for items.

  • Position: relative
  • Margin & padding: 0
  • Min-height: 20px (30px for placeholders)
  • Line-height: 20px
.angular-ui-tree-node,
.angular-ui-tree-placeholder {
  position: relative;
  margin: 0;
  padding: 0;
  min-height: 20px;
  line-height: 20px;
}
.angular-ui-tree-placeholder {
  margin: 5px 0;
  min-height: 30px;
}

Hidden State: .angular-ui-tree-hidden πŸ•Ά

This utility class completely hides elements.
It applies display: none to remove items from layout flow.

.angular-ui-tree-hidden {
  display: none;
}

Drag Handle: .angular-ui-tree-handle πŸ› 

This class marks the drag handle within a node.
It ensures a consistent clickable area and typography.

  • Cursor: pointer
  • Font style: bold, no underline
  • Box-sizing: border-box
  • Vertical sizing: matches node line height
.angular-ui-tree-handle {
  cursor: pointer;
  text-decoration: none;
  font-weight: bold;
  box-sizing: border-box;
  min-height: 20px;
  line-height: 20px;
}

Drag Preview: .angular-ui-tree-drag βœ‚οΈ

This class styles the β€œghost” element during dragging.
It floats above all content with partial transparency.

  • Position: absolute
  • Pointer-events: none
  • Z-index: 999
  • Opacity: 0.8
.angular-ui-tree-drag {
  position: absolute;
  pointer-events: none;
  z-index: 999;
  opacity: .8;
}

Class Reference Table

Class Purpose
.angular-ui-tree Root container for the tree
.angular-ui-tree-empty Styles the placeholder when the tree is empty
.angular-ui-tree-nodes Resets and wraps nested node lists
.angular-ui-tree-node Base styling for each tree item
.angular-ui-tree-placeholder Drop-target placeholder styling
.angular-ui-tree-hidden Utility class to hide elements
.angular-ui-tree-handle Defines the draggable handle area
.angular-ui-tree-drag Styles the floating drag preview