You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-51Lines changed: 35 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,11 @@ Turn your boring fixed header into a smart one with three lines of code.
12
12
13
13
## Features
14
14
15
-
-**Dead simple** - Write three lines of code and you're done.
16
-
-**Enjoyable defaults** - When scrolling down, the header is hidden, when scrolling up, the header is shown.
17
-
-**Powerful** - Uses acceleration delta (scroll speed) for both hiding and showing instead of fixed thresholds.
18
-
-**Intuitive** - Behaves as expected on page load, scroll restoration, hovering, dropdown navigation, top-reached and reduced motion.
19
-
-**Smart** - Functionalities are automatically enabled/disabled if your header turns from fixed/sticky to something else or it is hidden at different viewports
20
-
-**Flexible** - Works with any scrolling container and with your own styles
15
+
-**Dead simple** - Write three lines of code and you're ready to go
16
+
-**Enjoyable** - When scrolling down, the header is hidden, when scrolling up, the header is shown.
17
+
-**Smart** - Behaves as expected on page load, scroll restoration, hovering, dropdown navigation, top-reached and reduced motion.
18
+
-**Dynamic** - Functionalities are automatically enabled/disabled if your header turns from fixed/sticky to something else or it is hidden at different viewports
19
+
-**Flexible** - Works with any scrolling container
21
20
22
21
<br />
23
22
@@ -27,8 +26,6 @@ Turn your boring fixed header into a smart one with three lines of code.
27
26
pnpm add vue-use-fixed-header
28
27
```
29
28
30
-
Or:
31
-
32
29
```bash
33
30
yarn add vue-use-fixed-header
34
31
```
@@ -78,9 +75,9 @@ On resize, `useFixedHeader` checks your header's `position` and `display` proper
78
75
79
76
_Disabled_ means that no event listeners are attached and the returned styles match an empty object `{}`.
80
77
81
-
### Different viewports
78
+
### Media queries
82
79
83
-
Hence feel free to have code like this:
80
+
Hence feel free to have code like this, it will just work as expected:
84
81
85
82
```css
86
83
.Header {
@@ -102,13 +99,11 @@ Hence feel free to have code like this:
102
99
}
103
100
```
104
101
105
-
It will just work as expected.
106
-
107
102
### Advanced scenarios
108
103
109
-
Let's suppose your header in some pages is not fixed/sticky and you're using some reactive logic to style the `position` property.
104
+
Let's suppose your header in some pages is not fixed/sticky and you're using some reactive logic to determine whether it should be or not.
110
105
111
-
You can pass a reactive source to the `watch` property of `useFixedHeader` to perform a check everytime the value changes:
106
+
You can pass a signal to the `watch` property of `useFixedHeader` to perform a check everytime the value changes:
0 commit comments