-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bootstrap5 border spinner (#359)
- Loading branch information
1 parent
3d3fc72
commit b934173
Showing
16 changed files
with
122 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.spinner-border { | ||
--bs-spinner-width: 1em; | ||
--bs-spinner-height: 1em; | ||
--bs-spinner-border-width: 0.125em; | ||
|
||
box-sizing: border-box; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# TACC Core Styles - Library - Vendor | ||
|
||
Add and import these only when you need a subset of a vendor's stylesheet. | ||
|
||
## Example Use Case | ||
|
||
1. Client needs a TACC loading spinner. | ||
2. TACC only styles Boostrap's loading spinner. | ||
3. Client does not use Bootstrap. | ||
4. Add Bootstrap's loading spinner to this directory. | ||
5. Client loads Bootstrap's loading spinner from here. | ||
6. Client loads TACC skin for Bootstrap's loading spinner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Spinner (Bootstrap 5) | ||
Port only the Bootstrap 5 spinner styles that LoadingSpinner needs in tup-ui. | ||
- [Reactstrap: Components: Spinners](https://react-bootstrap.github.io/components/spinners/) | ||
- [Bootstrap 5: Components: Spinners](https://getbootstrap.com/docs/5.0/components/spinners/) | ||
Styleguide Component.Bootstrap5.Spinners | ||
*/ | ||
/* https://github.com/twbs/bootstrap/blob/v5.3.3/scss/_spinners.scss */ | ||
/* https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.css */ | ||
.spinner-border { | ||
display: inline-block; | ||
width: var(--bs-spinner-width); | ||
height: var(--bs-spinner-height); | ||
vertical-align: var(--bs-spinner-vertical-align); | ||
border-radius: 50%; | ||
-webkit-animation: var(--bs-spinner-animation-speed) linear infinite | ||
var(--bs-spinner-animation-name); | ||
animation: var(--bs-spinner-animation-speed) linear infinite | ||
var(--bs-spinner-animation-name); | ||
} | ||
@-webkit-keyframes spinner-border { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
@keyframes spinner-border { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
.spinner-border { | ||
--bs-spinner-width: 2rem; | ||
--bs-spinner-height: 2rem; | ||
--bs-spinner-vertical-align: -0.125em; | ||
--bs-spinner-border-width: 0.25em; | ||
--bs-spinner-animation-speed: 0.75s; | ||
--bs-spinner-animation-name: spinner-border; | ||
border: var(--bs-spinner-border-width) solid currentcolor; | ||
border-right-color: transparent; | ||
} | ||
@media (prefers-reduced-motion: reduce) { | ||
.spinner-border { | ||
--bs-spinner-animation-speed: 1.5s; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/lib/_imports/vendors/bootstrap5/bootstrap5--border-spinner.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<dl> | ||
<dt>Spinner</dt> | ||
<dd> | ||
<span class="spinner-border" aria-hidden="true"></span> | ||
</dd> | ||
<dt>Spinner in Bootstrap Button</dt> | ||
<dd> | ||
<button class="btn btn-primary" type="button" disabled> | ||
<span>Login</span> | ||
<span class="visually-hidden" role="status">Loading...</span> | ||
<span class="spinner-border" aria-hidden="true"></span> | ||
</button> | ||
</dd> | ||
<dt>Spinner in a TACC Button</dt> | ||
<dd> | ||
<button class="c-button c-button--primary c-button--is-busy" type="button" disabled> | ||
<span>Login</span> | ||
<span class="u-hide--visually" role="status">Loading...</span> | ||
<span class="spinner-border" aria-hidden="true"></span> | ||
</button> | ||
</dd> | ||
</dl> |
3 changes: 3 additions & 0 deletions
3
src/lib/_imports/vendors/bootstrap5/bootstrap5--border-spinner.readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[Bootstrap 5 Spinners: Border spinner](https://getbootstrap.com/docs/5.3/components/spinners/#border-spinner). | ||
|
||
<script src="{{path '/assets/_utils/js/open-ext-links-in-new-window.js'}}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Bootstrap v5 is used by TACC in: | ||
|
||
<ul> | ||
<li> | ||
<a href="https://github.com/TACC/tup-ui/blob/v1.1.10/libs/core-components/src/lib/LoadingSpinner/LoadingSpinner.global.css#L27-L42" target="_blank">TACC/tup-ui</a> | ||
</li> | ||
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variants: | ||
- name: border-spinner | ||
status: prototype | ||
context: | ||
shouldLoadBootstrap5: true | ||
supportStyles: | ||
- ../../assets/trumps/u-hide.css | ||
- ../../assets/vendors/bootstrap5--border-spinner.css | ||
- ../../assets/components/bootstrap5.border-spinner.css |