Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] document loader with full-screen overlay #30

Open
derekphilipau opened this issue Jan 28, 2017 · 1 comment
Open

[Suggestion] document loader with full-screen overlay #30

derekphilipau opened this issue Jan 28, 2017 · 1 comment

Comments

@derekphilipau
Copy link

beautiful loaders!

for people like me who suck at css it would be nice to have documentation of how to use the loaders with a full-screen overlay with adjustable overlay background opacity. i could only come up with the following code (opaque background), still can't figure out how to center the loader.

.load-container {
  position: fixed;
  display: block;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: $loader-background-color;
}

.loader {
  z-index: 1001;
}
@day0ops
Copy link

day0ops commented Nov 15, 2018

@derekphilipau bit late to the party but I got it working with the following,

HTML,

<div class="transparent-background">
  <div class="loader-center">
    <div class="loader">Loading...</div>
  </div>
</div>

CSS,

.transparent-background {
  content: '';
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
}

.loader-center {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants