Skip to main content

Overview

This section is a work in progress, but listed below are the available CSS variables for styling elements. Types are not provided as these are traditional CSS parameters. These variables can be passed as styling props to individual components or used to create global themes using a selector with the following structure: :root[svelvet-theme="theme-name"]. These theme names can be passed to the Svelvet component via the reactive theme prop and to the Theme Toggle component via the main and alt props. When passing to individual components, these styles are scoped to the component itself. This is not currently true of Edges and our recommendation is to create custom Edge components. Scroll to the bottom for example code.
You can style parameters beyond those available here by using global selectors. :global(.svelvet-node) applies to all Nodes, for instance. Will add all internal class names with time!

Graph

default:"move"
Icon displayed when the cursor is over the background element.
default:"white"
Color of the background.
default:"gray"
Color of the grid dots
default:"lightblue"
Color of the selection box used to grab multiple Nodes

Nodes

default:"1px"
Width of the default Node border
default:"10px"
Border radius of the default Node
default:"grab"
Icon displayed when the cursor is over a Node component
default:"not-allowed"
Icon displayed when the cursor is over a Node component which is blocked
default:"200px"
Width of the default Node
default:"100px"
Height of the default Node
default:"white"
Color of the default Node
default:"white"
Text color of the default Node
default:"white"
Border color of the default Node when selected
default:"white"
Border color of the default Node when not selected
default:"multi-layer shadow"
Shadow of the default Node

Anchors

default:"1px"
Width of the default Anchor border
default:"50%"
Border radius of the default Anchor
default:"12px"
Width of the default Anchor
default:"12px"
Height of the default Anchor
default:"gray"
Color when the default Anchor is in a neutral state
default:"gray"
Color when the default Anchor is in a neutral state
default:"gray"
Color when the default Anchor is connected
default:"gray"
Border color when the default Anchor is connected
default:"gray"
Color when the default Anchor is hovering
default:"gray"
Border color when the default Anchor is hovering
default:"gray"
Color when the default Anchor is connecting
default:"gray"
Border color when the default Anchor is connecting

Edges

default:"2px"
Width of the default Edge
default:"black"
Color of the default Edge
default:"gray"
Color of the default target Edge visible only when hovering and the Edge has been created with an edgeClick function.