Skip to content

Commit c625c8e

Browse files
committed
Get rid of the pre-processor
1 parent 4575125 commit c625c8e

File tree

6 files changed

+58
-245
lines changed

6 files changed

+58
-245
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Reporting an issue
44

5-
If you have found a bug please feel free to report an issue after ensuring that no such bug has been reported yet (check [existing issues](https://github.com/Amphiluke/handy-scroll/issues) first). Be sure to write a clear description of the problem. It will be great if you also provide a minimum example revealing the bug. You may use such services as [CodePen](https://codepen.io/) or [JSFiddle](https://jsfiddle.net/) and [unpkg](https://unpkg.com/) to assemble a live demo for the issue you’ve found.
5+
If you have found a bug, please feel free to report an issue after ensuring that no such bug has been reported yet (check [existing issues](https://github.com/Amphiluke/handy-scroll/issues) first). Be sure to write a clear description of the problem. It will be great if you also provide a minimum example revealing the bug. You may use such services as [CodePen](https://codepen.io/) or [JSFiddle](https://jsfiddle.net/) and [unpkg](https://unpkg.com/) to assemble a live demo for the issue you’ve found.
66

77
## Making changes in code and opening a pull request
88

dist/handy-scroll.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 0 additions & 191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"prepare": "husky install",
2424
"lint": "eslint src/*.js",
2525
"test": "echo \"Error: no test specified\" && exit 1",
26-
"build": "rollup -c && lessc src/handy-scroll.less | cleancss -O2 -o dist/handy-scroll.css"
26+
"build": "rollup -c && cleancss -O2 -o dist/handy-scroll.css src/handy-scroll.css"
2727
},
2828
"repository": {
2929
"type": "git",
@@ -48,7 +48,6 @@
4848
"clean-css-cli": "^5.6.3",
4949
"eslint": "^8.56.0",
5050
"husky": "8.0.3",
51-
"less": "^4.2.0",
5251
"rollup": "^4.9.5"
5352
}
5453
}

src/handy-scroll.css

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.handy-scroll {
2+
bottom: 0;
3+
min-height: 17px; /* based on https://codepen.io/sambible/post/browser-scrollbar-widths (fixes #3) */
4+
overflow: auto;
5+
position: fixed;
6+
}
7+
8+
.handy-scroll div {
9+
height: 1px;
10+
overflow: hidden;
11+
pointer-events: none;
12+
}
13+
14+
.handy-scroll div::before {
15+
content: "\A0"; /* fixes Amphiluke/floating-scroll#6 */
16+
}
17+
18+
.handy-scroll,
19+
.handy-scroll div {
20+
font-size: 1px;
21+
line-height: 0;
22+
margin: 0;
23+
padding: 0;
24+
}
25+
26+
.handy-scroll-hidden {
27+
bottom: 9999px;
28+
}
29+
30+
.handy-scroll-hidden div::before {
31+
content: "\A0\A0"; /* changing content fixes eventual bug with widget re-rendering in Chrome */
32+
}
33+
34+
.handy-scroll-viewport {
35+
/* It can be any type of positioning except static. Redefine in your CSS as needed */
36+
position: relative;
37+
}
38+
39+
.handy-scroll-body {
40+
overflow: auto;
41+
}
42+
43+
.handy-scroll-viewport .handy-scroll {
44+
left: 0;
45+
position: absolute;
46+
}
47+
48+
.handy-scroll-hoverable .handy-scroll {
49+
opacity: 0;
50+
transition: opacity 0.5s ease 0.3s;
51+
}
52+
53+
.handy-scroll-hoverable:hover .handy-scroll {
54+
opacity: 1;
55+
}

0 commit comments

Comments
 (0)