Skip to content

Commit da6df2a

Browse files
committed
fix(spinner): add and document custom properties
references #14850
1 parent dc762f0 commit da6df2a

File tree

5 files changed

+20
-47
lines changed

5 files changed

+20
-47
lines changed

core/src/components/spinner/readme.md

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ boolean
9393
If true, the spinner's animation will be paused. Defaults to `false`.
9494

9595

96+
## CSS Custom Properties
97+
98+
| Name | Description |
99+
| --------- | -------------------- |
100+
| `--color` | Color of the spinner |
101+
96102

97103
----------------------------------------------
98104

Original file line numberDiff line numberDiff line change
@@ -1,25 +1,2 @@
11
@import "./spinner";
22
@import "./spinner.ios.vars";
3-
4-
// iOS Spinner
5-
// --------------------------------------------------
6-
7-
:host(.spinner-lines) {
8-
--ion-color-base: #{$spinner-ios-lines-color};
9-
}
10-
11-
:host(.spinner-bubbles) {
12-
--ion-color-base: #{$spinner-ios-bubbles-color};
13-
}
14-
15-
:host(.spinner-circles) {
16-
--ion-color-base: #{$spinner-ios-circles-color};
17-
}
18-
19-
:host(.spinner-crescent) {
20-
--ion-color-base: #{$spinner-ios-crescent-color};
21-
}
22-
23-
:host(.spinner-dots) {
24-
--ion-color-base: #{$spinner-ios-dots-color};
25-
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,2 @@
11
@import "./spinner";
22
@import "./spinner.md.vars";
3-
4-
// Material Design Spinner
5-
// --------------------------------------------------
6-
7-
:host(.spinner-lines-md) {
8-
--ion-color-base: #{$spinner-md-lines-color};
9-
}
10-
11-
:host(.spinner-bubbles) {
12-
--ion-color-base: #{$spinner-md-bubbles-color};
13-
}
14-
15-
:host(.spinner-circles) {
16-
--ion-color-base: #{$spinner-md-circles-color};
17-
}
18-
19-
:host(.spinner-crescent) {
20-
--ion-color-base: #{$spinner-md-crescent-color};
21-
}
22-
23-
:host(.spinner-dots) {
24-
--ion-color-base: #{$spinner-md-dots-color};
25-
}

core/src/components/spinner/spinner.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
// --------------------------------------------------
55

66
:host {
7+
/**
8+
* @prop --color: Color of the spinner
9+
*/
10+
711
display: inline-block;
812
position: relative;
913

1014
width: 28px;
1115
height: 28px;
1216

17+
color: var(--color);
18+
1319
user-select: none;
1420
}
1521

1622
:host(.ion-color) {
17-
color: #{current-color(base)};
23+
color: current-color(base);
1824
}
1925

2026
svg {

core/src/components/spinner/test/standalone/index.html

+7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
<ion-spinner name="bubbles"></ion-spinner>
1818
<ion-spinner name="circles"></ion-spinner>
1919
<ion-spinner name="crescent"></ion-spinner>
20+
<ion-spinner name="lines" class="custom"></ion-spinner>
2021
<ion-spinner paused></ion-spinner>
22+
23+
<style>
24+
.custom {
25+
--color: red;
26+
}
27+
</style>
2128
</body>
2229
</html>

0 commit comments

Comments
 (0)