Skip to content

Commit

Permalink
fix(spinner): add and document custom properties
Browse files Browse the repository at this point in the history
references #14850
  • Loading branch information
camwiegert committed Aug 9, 2018
1 parent dc762f0 commit da6df2a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 47 deletions.
6 changes: 6 additions & 0 deletions core/src/components/spinner/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ boolean
If true, the spinner's animation will be paused. Defaults to `false`.


## CSS Custom Properties

| Name | Description |
| --------- | -------------------- |
| `--color` | Color of the spinner |


----------------------------------------------

Expand Down
23 changes: 0 additions & 23 deletions core/src/components/spinner/spinner.ios.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
@import "./spinner";
@import "./spinner.ios.vars";

// iOS Spinner
// --------------------------------------------------

:host(.spinner-lines) {
--ion-color-base: #{$spinner-ios-lines-color};
}

:host(.spinner-bubbles) {
--ion-color-base: #{$spinner-ios-bubbles-color};
}

:host(.spinner-circles) {
--ion-color-base: #{$spinner-ios-circles-color};
}

:host(.spinner-crescent) {
--ion-color-base: #{$spinner-ios-crescent-color};
}

:host(.spinner-dots) {
--ion-color-base: #{$spinner-ios-dots-color};
}
23 changes: 0 additions & 23 deletions core/src/components/spinner/spinner.md.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
@import "./spinner";
@import "./spinner.md.vars";

// Material Design Spinner
// --------------------------------------------------

:host(.spinner-lines-md) {
--ion-color-base: #{$spinner-md-lines-color};
}

:host(.spinner-bubbles) {
--ion-color-base: #{$spinner-md-bubbles-color};
}

:host(.spinner-circles) {
--ion-color-base: #{$spinner-md-circles-color};
}

:host(.spinner-crescent) {
--ion-color-base: #{$spinner-md-crescent-color};
}

:host(.spinner-dots) {
--ion-color-base: #{$spinner-md-dots-color};
}
8 changes: 7 additions & 1 deletion core/src/components/spinner/spinner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
// --------------------------------------------------

:host {
/**
* @prop --color: Color of the spinner
*/

display: inline-block;
position: relative;

width: 28px;
height: 28px;

color: var(--color);

user-select: none;
}

:host(.ion-color) {
color: #{current-color(base)};
color: current-color(base);
}

svg {
Expand Down
7 changes: 7 additions & 0 deletions core/src/components/spinner/test/standalone/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
<ion-spinner name="bubbles"></ion-spinner>
<ion-spinner name="circles"></ion-spinner>
<ion-spinner name="crescent"></ion-spinner>
<ion-spinner name="lines" class="custom"></ion-spinner>
<ion-spinner paused></ion-spinner>

<style>
.custom {
--color: red;
}
</style>
</body>
</html>

0 comments on commit da6df2a

Please sign in to comment.