Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
ui: add <Spinner>
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwhite committed Aug 30, 2021
1 parent 2b42203 commit bebf5cb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ui/app/components/spinner.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{!--
Usage:
<Spinner />
<Spinner @size="16" />
<Spinner @size="20" />
<Spinner @size="24" />
<Spinner @size="24" class="some-other-class" />
--}}

<Pds::Icon
@type="loading"
class="spinner"
data-size={{or @size "inherit"}}
...attributes
/>
2 changes: 2 additions & 0 deletions ui/app/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ $button-shadow: 0 3px 2px rgba(var(--shadow), 0.2);
--warning-border: #{dehex(color.$yellow-100)};
--info: #{dehex(color.$blue-050)};
--info-text: #{dehex(color.$blue-500)};
--spinner-stroke: #{dehex(color.$black)};
}

@media (prefers-color-scheme: dark) {
Expand Down Expand Up @@ -69,5 +70,6 @@ $button-shadow: 0 3px 2px rgba(var(--shadow), 0.2);
--pds-color: #{dehex(color.$white)};
--pds-input-backgroundColor: #{dehex(color.$ui-cool-gray-900)};
--pds-input-color: #{dehex(color.$white)};
--spinner-stroke: #{dehex(color.$white)};
}
}
1 change: 1 addition & 0 deletions ui/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
@import './components/navigation/header';
@import './components/icon-tile';
@import './components/input';
@import './components/spinner';
@import './pages/login';
@import './components/notifications';
@import './pages/onboarding';
Expand Down
25 changes: 25 additions & 0 deletions ui/app/styles/components/spinner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.spinner {
position: relative;

top: 1px;

svg {
fill: none !important;
}
svg,
g {
stroke: rgb(var(--spinner-stroke));
}
&[data-size='inherit'] {
font-size: inherit;
}
&[data-size='16'] {
font-size: 16px;
}
&[data-size='20'] {
font-size: 20px;
}
&[data-size='24'] {
font-size: 24px;
}
}

0 comments on commit bebf5cb

Please sign in to comment.