@intergrav/dev.css 4.0.1 → 4.0.3
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/LICENSE +21 -21
- package/README.md +242 -228
- package/addon/header-oneline.css +21 -22
- package/addon/header-sticky.css +18 -17
- package/addon/scroll-to-top.js +25 -25
- package/dev.css +527 -527
- package/package.json +31 -31
- package/theme/boilerplate.user.css +30 -30
- package/theme/catppuccin-frappe.user.css +26 -26
- package/theme/catppuccin-macchiato.user.css +26 -26
- package/theme/catppuccin-mocha.user.css +26 -26
- package/theme/day.user.css +26 -26
- package/theme/night.user.css +26 -26
- package/theme/terminal.user.css +29 -29
package/addon/scroll-to-top.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/* scroll-to-top for dev.css v4, a lightweight CSS framework - https://github.com/intergrav/dev.css */
|
|
2
|
-
/* about: shows a "scroll to top" button in the bottom right corner of the screen when scrolling */
|
|
3
|
-
|
|
4
|
-
const scrollToTopButton = document.createElement("button");
|
|
5
|
-
scrollToTopButton.textContent = "▲";
|
|
6
|
-
Object.assign(scrollToTopButton.style, {
|
|
7
|
-
transition: "0.25s",
|
|
8
|
-
opacity: "0",
|
|
9
|
-
padding: "0",
|
|
10
|
-
position: "fixed",
|
|
11
|
-
bottom: "1rem",
|
|
12
|
-
right: "1rem",
|
|
13
|
-
width: "2.5rem",
|
|
14
|
-
height: "2.5rem",
|
|
15
|
-
"border-radius": "1.25rem",
|
|
16
|
-
});
|
|
17
|
-
document.body.appendChild(scrollToTopButton);
|
|
18
|
-
|
|
19
|
-
window.addEventListener("scroll", () => {
|
|
20
|
-
scrollToTopButton.style.opacity = window.scrollY > 0 ? "0.5" : "0";
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
scrollToTopButton.addEventListener("click", () => {
|
|
24
|
-
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
25
|
-
});
|
|
1
|
+
/* scroll-to-top for dev.css v4, a lightweight CSS framework - https://github.com/intergrav/dev.css */
|
|
2
|
+
/* about: shows a "scroll to top" button in the bottom right corner of the screen when scrolling */
|
|
3
|
+
|
|
4
|
+
const scrollToTopButton = document.createElement("button");
|
|
5
|
+
scrollToTopButton.textContent = "▲";
|
|
6
|
+
Object.assign(scrollToTopButton.style, {
|
|
7
|
+
transition: "0.25s",
|
|
8
|
+
opacity: "0",
|
|
9
|
+
padding: "0",
|
|
10
|
+
position: "fixed",
|
|
11
|
+
bottom: "1rem",
|
|
12
|
+
right: "1rem",
|
|
13
|
+
width: "2.5rem",
|
|
14
|
+
height: "2.5rem",
|
|
15
|
+
"border-radius": "1.25rem",
|
|
16
|
+
});
|
|
17
|
+
document.body.appendChild(scrollToTopButton);
|
|
18
|
+
|
|
19
|
+
window.addEventListener("scroll", () => {
|
|
20
|
+
scrollToTopButton.style.opacity = window.scrollY > 0 ? "0.5" : "0";
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
scrollToTopButton.addEventListener("click", () => {
|
|
24
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
25
|
+
});
|