Skip to content

Instantly share code, notes, and snippets.

@VitorLuizC
Last active December 10, 2018 19:57
Show Gist options
  • Select an option

  • Save VitorLuizC/7faae99447b33701cbcc1e5f642671e8 to your computer and use it in GitHub Desktop.

Select an option

Save VitorLuizC/7faae99447b33701cbcc1e5f642671e8 to your computer and use it in GitHub Desktop.
position(
$position,
$top = null,
$right = $top,
$bottom = $top,
$left = $right
)
position: $position
top: $top
right: $right
bottom: $bottom
left: $left
@import 'position-shorthand.styl'
.c-modal
body.c-modal-active > &
display: block
&
display none
position: fixed 0
> .panel
position: fixed 50% 50% initial initial
> .background
position: relative 50% 25%
background-color: rgba(#000, .75)
body.c-modal-active > .c-modal {
display: block;
}
.c-modal {
display: none;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.c-modal > .panel {
position: fixed;
top: 50%;
right: 50%;
bottom: initial;
left: initial;
}
.c-modal > .background {
position: relative;
top: 50%;
right: 25%;
bottom: 50%;
left: 25%;
background-color: rgba(0,0,0,0.75);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment