jointjs
Version:
JavaScript diagramming library
171 lines (139 loc) • 4.07 kB
CSS
/*
A complete list of SVG properties that can be set through CSS is here:
http://www.w3.org/TR/SVG/styling.html
Important note: Presentation attributes have a lower precedence over CSS style rules.
*/
/* .viewport is a <g> node wrapping all diagram elements in the paper */
.joint-viewport {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.joint-paper > svg,
.joint-paper-background,
.joint-paper-grid {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
/*
1. IE can't handle paths without the `d` attribute for bounding box calculation
2. IE can't even handle 'd' attribute as a css selector (e.g path[d]) so the following rule will
break the links rendering.
path:not([d]) {
display: none;
}
*/
/* magnet is an element that can be either source or a target of a link */
[magnet=true]:not(.joint-element) {
cursor: crosshair;
}
[magnet=true]:not(.joint-element):hover {
opacity: .7;
}
/*
Elements have CSS classes named by their types. E.g. type: basic.Rect has a CSS class "element basic Rect".
This makes it possible to easilly style elements in CSS and have generic CSS rules applying to
the whole group of elements. Each plugin can provide its own stylesheet.
*/
.joint-element {
/* Give the user a hint that he can drag&drop the element. */
cursor: move;
}
.joint-element * {
-webkit-user-drag: none;
}
.joint-element .scalable * {
/* The default behavior when scaling an element is not to scale the stroke in order to prevent the ugly effect of stroke with different proportions. */
vector-effect: non-scaling-stroke;
}
/*
connection-wrap is a <path> element of the joint.dia.Link that follows the .connection <path> of that link.
In other words, the `d` attribute of the .connection-wrap contains the same data as the `d` attribute of the
.connection <path>. The advantage of using .connection-wrap is to be able to catch pointer events
in the neighborhood of the .connection <path>. This is especially handy if the .connection <path> is
very thin.
*/
.marker-source,
.marker-target {
/* This makes the arrowheads point to the border of objects even though the transform: scale() is applied on them. */
vector-effect: non-scaling-stroke;
}
/* Paper */
.joint-paper {
position: relative;
}
/* Paper */
/* Highlighting */
.joint-highlight-opacity {
opacity: 0.3;
}
/* Highlighting */
/*
Vertex markers are `<circle>` elements that appear at connection vertex positions.
*/
.joint-link .connection-wrap,
.joint-link .connection {
fill: none;
}
/* <g> element wrapping .marker-vertex-group. */
.marker-vertices {
opacity: 0;
cursor: move;
}
.marker-arrowheads {
opacity: 0;
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
/* display: none; */ /* setting `display: none` on .marker-arrowheads effectivelly switches of links reconnecting */
}
.link-tools {
opacity: 0;
cursor: pointer;
}
.link-tools .tool-options {
display: none; /* by default, we don't display link options tool */
}
.joint-link:hover .marker-vertices,
.joint-link:hover .marker-arrowheads,
.joint-link:hover .link-tools {
opacity: 1;
}
/* <circle> element used to remove a vertex */
.marker-vertex-remove {
cursor: pointer;
opacity: .1;
}
.marker-vertex-group:hover .marker-vertex-remove {
opacity: 1;
}
.marker-vertex-remove-area {
opacity: .1;
cursor: pointer;
}
.marker-vertex-group:hover .marker-vertex-remove-area {
opacity: 1;
}
/*
Example of custom changes (in pure CSS only!):
Do not show marker vertices at all: .marker-vertices { display: none; }
Do not allow adding new vertices: .connection-wrap { pointer-events: none; }
*/
/* foreignObject inside the elements (i.e joint.shapes.basic.TextBlock) */
.joint-element .fobj {
overflow: hidden;
}
.joint-element .fobj body {
background-color: transparent;
margin: 0px;
position: static;
}
.joint-element .fobj div {
text-align: center;
vertical-align: middle;
display: table-cell;
padding: 0px 5px 0px 5px;
}