@phun-ky/arclace 0.3.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/style.css CHANGED
@@ -1,12 +1,17 @@
1
1
  /**
2
2
  * Optional styles for @phun-ky/arclace.
3
3
  *
4
- * Lines work without this file. It adds the label halo, hollow anchors and
4
+ * Lines work without this file. It adds label backgrounds, hollow anchors and
5
5
  * the dash animation, and exposes custom properties for theming:
6
6
  *
7
7
  * --arc-color line, arrow and anchor color
8
8
  * --arc-label-color label text color
9
- * --arc-label-halo outline drawn behind labels so they stay readable
9
+ * --arc-label-bg background behind labels, so lines don't cross them
10
+ * (defaults to --arc-label-halo, then #fff)
11
+ * --arc-label-border outline of the label background
12
+ * --arc-label-radius corner radius of the label background
13
+ * --arc-label-padding space around the text inside the background, in
14
+ * lengths (px, em, rem), not percentages
10
15
  * --arc-label-size label font size
11
16
  * --arc-anchor-fill inside of anchor dots
12
17
  */
@@ -23,10 +28,17 @@
23
28
  .arc-label {
24
29
  fill: var(--arc-label-color, currentColor);
25
30
  font-size: var(--arc-label-size, 12px);
26
- paint-order: stroke;
27
- stroke: var(--arc-label-halo, #fff);
28
- stroke-width: 4px;
29
- stroke-linejoin: round;
31
+ }
32
+
33
+ .arc-label-bg {
34
+ fill: var(--arc-label-bg, var(--arc-label-halo, #fff));
35
+ stroke: var(--arc-label-border, none);
36
+ stroke-width: 1px;
37
+ rx: var(--arc-label-radius, 4px);
38
+ /* Read by Arclace to size the background; SVG itself ignores padding */
39
+ padding: var(--arc-label-padding, 3px 6px);
40
+ /* So em padding is relative to the label's text */
41
+ font-size: var(--arc-label-size, 12px);
30
42
  }
31
43
 
32
44
  .arc-anchor {