@localnerve/jump-scroll 0.3.7 → 0.3.8

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.
Files changed (2) hide show
  1. package/README.md +20 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,12 +12,19 @@ Provides a small scrolling control that allows the user to go to the top or bott
12
12
 
13
13
  ## Attributes
14
14
 
15
- * target - A selector to select all the elements to vertically "jump scroll" to in the page. Defaults to 'section'.
16
- * display - "both" | "best"
17
- * `both` - Default. The control displays both [top, previous] AND [bottom, next] jump scrolling options simulataneously.
18
- * `best` - The control displays either [top, previous] OR [bottom, next] jump scrolling options. Which one is displayed depends on the position on the page and the direction of scrolling. If the user is in the middle of the page and scrolls, the control only displays the jump scroll options in the direction of the scroll. Less vertical space required.
15
+ * `target` - *Required*. A selector to select all the elements to vertically "jump scroll" to in the page. Defaults to 'section'.
16
+
17
+ * `display` - "both" | "best"
18
+ **"both"** - *Default*. The control displays both [top, previous] AND [bottom, next] jump scrolling options simulataneously.
19
+ **"best"** - The control displays either [top, previous] OR [bottom, next] jump scrolling options. Which one is displayed depends on the position on the page and the direction of scrolling. If the user is in the middle of the page and scrolls, the control only displays the jump scroll options in the direction of the scroll. Less vertical space required.
20
+
21
+ * `colormap` - *Optional*. A map of targets to colors. Changes the color of the jump-scroll control over specific elements.
22
+ **Format:** `index:color[;index:color]*`
23
+ **index** - *Integer*. A zero-based index of the elements selected by the `target` attribute. The index is in the order of selected elements top-down on the page. Zero is the top most element, larger numbers are further down on the page.
24
+ **color** - *CssColor|CssCustomProperty*. A css color or a css variable of a color to use for the background of the control.
19
25
 
20
26
  ## Overridable CSS Variables
27
+
21
28
  * `--js-width` - The overall width of the control. Defaults to 2em.
22
29
  * `--js-height` - The overall height of the control. Defaults to 8em.
23
30
  * `--js-bg-color` - The color of the control arrows. Defaults to black.
@@ -27,18 +34,25 @@ Provides a small scrolling control that allows the user to go to the top or bott
27
34
  * `--js-attach-bottom` - The distance form the fixed, bottom-edge attachment. Defaults to 0.7rem;
28
35
 
29
36
  ## Usage Example
37
+
30
38
  ```html
31
- <jump-scroll target="article" display="best"></jump-scroll>
39
+ <jump-scroll target="article" display="best"></jump-scroll>
32
40
  ```
33
41
  ## Non-browser Exports
42
+
34
43
  The non-browser version of the module exports methods to help with builds.
35
44
 
36
45
  ### {Promise} getJumpScrollCssText()
37
- A function to asynchronously get the raw shadow css text. This is useful for computing the hash for a CSP style rule. Returns a Promise that resolves to the full utf8 string of css text.
46
+
47
+ Asynchronously gets the raw shadow css text.
48
+ Useful for computing the hash for a CSP style rule.
49
+ Returns a Promise that resolves to the full utf8 string of css text.
38
50
 
39
51
  ## License
52
+
40
53
  LocalNerve [BSD-3-Clause](LICENSE.md) Licensed
41
54
 
42
55
  ## Contact
56
+
43
57
  twitter: @localnerve
44
58
  email: alex@localnerve.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localnerve/jump-scroll",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "A small, fast, no-dep, jump-scroll web component",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/jump-scroll.js",