Skip to content

Instantly share code, notes, and snippets.

@luiz
Last active August 29, 2015 14:10
Show Gist options
  • Save luiz/7cc64cc8941195bb3386 to your computer and use it in GitHub Desktop.
Save luiz/7cc64cc8941195bb3386 to your computer and use it in GitHub Desktop.
Pulsating multiple borders with box-shadow & var
/* Pulsating multiple borders with box-shadow & var */
body {
--bg: #6495ED;
background-color: var(--bg);
}
div {
--border-size: 4px;
width: 50%;
height: 10em;
background-color: white;
position: fixed;
top: 25%;
left: 25%;
box-shadow: 0 0 0 var(--border-size) black,
0 0 0 calc(2 * var(--border-size)) var(--bg),
0 0 0 calc(3 * var(--border-size)) black,
0 0 0 calc(4 * var(--border-size)) var(--bg),
0 0 0 calc(5 * var(--border-size)) black;
transition: 1s;
}
div:hover {
--border-size: 8px;
}
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment