Skip to content

Commit

Permalink
Merge pull request #974 from primer/loaders
Browse files Browse the repository at this point in the history
Add Animated Ellipsis
  • Loading branch information
simurai authored Nov 7, 2019
2 parents f755e43 + aa03ce9 commit 40aa120
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/content/components/loaders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Loaders
path: components/loaders
status: New
source: 'https://github.com/primer/css/tree/master/src/loaders'
bundle: loaders
---

Loaders inform users that an action is still in progress and might take a while to complete.

## Animated Ellipsis

Add an animated ellipsis at the end of text with `<span class="AnimatedEllipsis"></span>`.

```html live
<span>Loading</span><span class="AnimatedEllipsis"></span>
```

It can also be used in combination with other components.

```html live
<h2><span>Loading</span><span class="AnimatedEllipsis"></span></h2>
<span class="branch-name mt-2"><span>Loading</span><span class="AnimatedEllipsis"></span></span><br>
<span class="Label bg-blue mt-3"><span>Loading</span><span class="AnimatedEllipsis"></span></span><br>
<button class="btn mt-3" disabled><span>Loading</span><span class="AnimatedEllipsis"></span></button>
```
2 changes: 2 additions & 0 deletions docs/src/@primer/gatsby-theme-doctocat/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
url: /components/header
- title: Labels
url: /components/labels
- title: Loaders
url: /components/loaders
- title: Markdown
url: /components/markdown
- title: Marketing buttons
Expand Down
25 changes: 25 additions & 0 deletions src/loaders/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
bundle: "loaders"
generated: true
---

# Primer CSS: `loaders` bundle

## Usage

Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:

```scss
@import "@primer/css/loaders/index.scss";
```

## Build

The `@primer/css` npm package includes a standalone CSS build of this module in `dist/loaders.css`.

## License

[MIT](https://github.com/primer/css/blob/master/LICENSE) &copy; [GitHub](https://github.com/)


[scss]: https://sass-lang.com/documentation/syntax#scss
2 changes: 2 additions & 0 deletions src/loaders/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "../support/index.scss";
@import "./loaders.scss";
19 changes: 19 additions & 0 deletions src/loaders/loaders.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Loaders

// Animated Ellipsis

.AnimatedEllipsis {
display: inline-block;
overflow: hidden;
vertical-align: bottom;

&::after {
display: inline-block;
content: "...";
animation: AnimatedEllipsis-keyframes 1.2s steps(4, jump-none) infinite;
}

@keyframes AnimatedEllipsis-keyframes {
0% { transform: translateX(-100%); }
}
}
1 change: 1 addition & 0 deletions src/product/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import "../dropdown/index.scss";
@import "../header/index.scss";
@import "../labels/index.scss";
@import "../loaders/index.scss";
@import "../markdown/index.scss";
@import "../popover/index.scss";
@import "../progress/index.scss";
Expand Down

0 comments on commit 40aa120

Please sign in to comment.