Skip to content

Commit 0ab2a96

Browse files
committed
tweak loader position, and support custom loader better with inner element
1 parent f99dd07 commit 0ab2a96

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

dist/ldbtn.css

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,29 @@
2121
position: absolute;
2222
top: 50%;
2323
left: 50%;
24+
width: 1em;
25+
height: 1em;
2426
margin: -0.5em;
2527
opacity: 0;
2628
z-index: -1;
2729
transition: all 0.3s;
2830
transition-timing-function: ease-in;
2931
}
32+
.ld-ext-right > .ld > *,
33+
.ld-ext-left > .ld > *,
34+
.ld-ext-bottom > .ld > *,
35+
.ld-ext-top > .ld > *,
36+
.ld-over > .ld > *,
37+
.ld-over-inverse > .ld > *,
38+
.ld-over-full > .ld > *,
39+
.ld-over-full-inverse > .ld > * {
40+
width: 1em;
41+
height: 1em;
42+
position: absolute;
43+
top: 50%;
44+
left: 50%;
45+
transform: translate(-0.5em, -0.5em);
46+
}
3047
.ld-ext-right.running > .ld,
3148
.ld-ext-left.running > .ld,
3249
.ld-ext-bottom.running > .ld,
@@ -45,31 +62,31 @@
4562
.ld-ext-right > .ld {
4663
top: 50%;
4764
left: auto;
48-
right: 1em;
65+
right: 1.25em;
4966
}
5067
.ld-ext-left.running {
5168
padding-left: 2.5em !important;
5269
}
5370
.ld-ext-left > .ld {
5471
top: 50%;
5572
right: auto;
56-
left: 1em;
73+
left: 1.25em;
5774
}
5875
.ld-ext-bottom.running {
5976
padding-bottom: 2.5em !important;
6077
}
6178
.ld-ext-bottom > .ld {
6279
top: auto;
6380
left: 50%;
64-
bottom: 1em;
81+
bottom: 1.25em;
6582
}
6683
.ld-ext-top.running {
6784
padding-top: 2.5em !important;
6885
}
6986
.ld-ext-top > .ld {
7087
bottom: auto;
7188
left: 50%;
72-
top: 1em;
89+
top: 1.25em;
7390
}
7491
.ld-over:before,
7592
.ld-over-inverse:before,

dist/ldbtn.min.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.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"name": "ldbutton",
44
"license": "MIT",
55
"description": "css for buttons that load",
6-
"version": "1.0.0",
7-
"homepage": "https://github.com/loadingio/ldbutton",
6+
"version": "1.0.1",
7+
"homepage": "https://loading.io/button/",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/loadingio/ldbutton"

src/ldbtn.styl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
position: absolute
77
top: 50%
88
left: 50%
9+
width: 1em
10+
height: 1em
911
margin: -.5em
1012
opacity: 0
1113
z-index: -1
1214
transition: all .3s
1315
transition-timing-function: ease-in
16+
& > *
17+
width: 1em
18+
height: 1em
19+
position: absolute
20+
top: 50%
21+
left: 50%
22+
transform: translate(-.5em,-.5em)
1423
&.running > .ld
1524
opacity: 1
1625
z-index: auto
@@ -21,28 +30,28 @@
2130
.ld-ext-right > .ld
2231
top: 50%
2332
left: auto
24-
right: 1em
33+
right: 1.25em
2534

2635
.ld-ext-left.running
2736
padding-left: 2.5em!important
2837
.ld-ext-left > .ld
2938
top: 50%
3039
right: auto
31-
left: 1em
40+
left: 1.25em
3241

3342
.ld-ext-bottom.running
3443
padding-bottom: 2.5em!important
3544
.ld-ext-bottom > .ld
3645
top: auto
3746
left: 50%
38-
bottom: 1em
47+
bottom: 1.25em
3948

4049
.ld-ext-top.running
4150
padding-top: 2.5em!important
4251
.ld-ext-top > .ld
4352
bottom: auto
4453
left: 50%
45-
top: 1em
54+
top: 1.25em
4655

4756
.ld-over, .ld-over-inverse, .ld-over-full, .ld-over-full-inverse
4857
&:before

0 commit comments

Comments
 (0)