Skip to content

Instantly share code, notes, and snippets.

@harberg
Created December 14, 2017 17:18
Show Gist options
  • Save harberg/3984542a7403e98be01bc5efda989eb0 to your computer and use it in GitHub Desktop.
Save harberg/3984542a7403e98be01bc5efda989eb0 to your computer and use it in GitHub Desktop.
@function starShadow($n) {
$val : random(2000) + px random(2000) + px #FFF;
@for $i from 2 through $n {
$val : $val, random(2000) + px random(2000) + px #FFF;
}
@return $val;
}
// number of stars to create
$starShadows : starShadow(100);
$starShadows2 : starShadow(200);
$starShadows3 : starShadow(300);
$starShadows4 : starShadow(50);
.stars {
position: absolute;
background: transparent;
border-radius: 100%;
top:0;
left:0;
}
.stars:after {
content: " ";
position: absolute;
top: 100px;
background: transparent;
border-radius: 100%
}
#stars {
width: 2px;
height: 2px;
box-shadow: $starShadows;
}
#stars:after {
width: 4px;
height: 4px;
box-shadow: $starShadows;
}
#stars2 {
width: 6px;
height: 6px;
box-shadow: $starShadows2;
}
#stars2:after {
width: 5px;
height: 5px;
box-shadow: $starShadows2;
}
#stars3 {
width: 4px;
height: 4px;
box-shadow: $starShadows3;
}
#stars3:after {
width: 8px;
height: 8px;
box-shadow: $starShadows3;
}
#stars4 {
width: 7px;
height: 7px;
box-shadow: $starShadows4;
}
#stars4:after {
width: 5px;
height: 5px;
box-shadow: $starShadows4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment