Skip to content

Commit d2b49ae

Browse files
author
Simon Finney
committed
feat(api): rename API for distance custom property
1 parent 457fab6 commit d2b49ae

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import 'custom-properties-parallax';
3333

3434
| Name | Type | Default |
3535
| ---------------- | ------ | -------- |
36-
| `--cpp-modifier` | Unit | 0.625rem |
36+
| `--cpp-distance` | Unit | 0.625rem |
3737
| `--cpp-speed` | Number | 0.5 |
3838

3939
* For individual control, leverage the cascade by declaring any of the above custom properties within the CSS selectors of the target elements. For example:

src/parallax/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
*/
55

66
const DEFAULT_VALUES = {
7-
MODIFIER: '.0625rem',
7+
DISTANCE: '.0625rem',
88
SPEED: 0.5,
99
};
1010

1111
const NAMESPACE = 'cpp';
1212

1313
const CUSTOM_PROPERTIES = {
14-
MODIFIER: `--${NAMESPACE}-modifier`,
14+
DISTANCE: `--${NAMESPACE}-distance`,
1515
PARALLAX: `--${NAMESPACE}-parallax`,
1616
SPEED: `--${NAMESPACE}-speed`,
1717
};

src/parallax/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function create(parallaxElement) {
3232
parallaxElement.style.setProperty(
3333
'transform',
3434
`translate3d(0, calc(var(${CUSTOM_PROPERTIES.PARALLAX}) * var(${
35-
CUSTOM_PROPERTIES.MODIFIER
35+
CUSTOM_PROPERTIES.DISTANCE
3636
})), 0)`
3737
);
3838

0 commit comments

Comments
 (0)