Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="flex-container">
	<div class="popsicle-unit">
		<div class="popsicle">
			<div class="ice"></div>
			<div class="stick"></div>
		</div>
		<div class="shadow"></div>
	</div>
	<div class="popsicle-unit rainbow">
		<div class="popsicle">
			<div class="ice"></div>
			<div class="stick"></div>
		</div>
		<div class="shadow"></div>
	</div>
</div>
              
            
!

CSS

              
                size(w=100%,h=100%)
	width w
	height h

html
body
	size()

body
	background-color #ffdfde

.flex-container
	size()
	display flex
	flex-wrap wrap 
	justify-content center
	align-items center

$degree = 20deg

.popsicle-unit
	margin 0 60px

.popsicle
	display block
	position relative
	animation floating 2s ease infinite

.ice
	box-sizing border-box
	display block
	position relative
	size(100px, 180px)
	margin auto
	border-radius 35px 35px 10px 10px
	background-image linear-gradient(to top, #fcd857, #fcd857 75%, #712b2a 75%, #712b2a)
	background-origin border-box
	border-right 4px solid rgba(255,255,255,.3)
	border-left 4px solid rgba(0,0,0,.05)
	&:before
	&:after
		content ''
		display block
		size(20%, 70%)
		position absolute
		bottom 0
		z-index 5
		border-radius 8px 8px 0 0
		background-image linear-gradient(to right, rgba(0, 0, 0, .025), rgba(0, 0, 0, .025) 50%, rgba(0, 0, 0, .05) 50%, rgba(0, 0, 0, .05) ) 
	&:before
		right 50%
		margin-right 10%
	&:after
		left 50%
		margin-left 10%
	
.stick
	box-sizing border-box
	size(25px, 50px)
	margin auto
	border-radius 0 0 10px 10px
	background-color #F9EFD0
	border-top 8px solid rgba(0,0,0,.025)	
	border-right 3px solid rgba(255,255,255,.2)

.shadow
	display block
	size(100px, 15px)
	border-radius 40%
	margin-top 30px
	margin-right auto
	margin-left auto
	background-color rgba(0,0,0,.05)
	animation floating-shadow 2s ease infinite
	
$pink = #ffbced
$blue = #74e2fa 
$purple = #7892fd

.rainbow 
	.ice
		background-image linear-gradient(to bottom, $pink 8%, $blue 33%, $purple 66%, $pink 92%)
		background-size 200% 200%
		border-right 4px solid rgba(255,255,255,.5)
		animation rainbow 3s linear infinite
	.popsicle
		&:before
		&:after
			content ''
			display block
			position absolute
			left 12%
			z-index 30
			width 5px
			border-radius 5px
			background white
		&:before
			top 10%
			height 50px
		&:after
			top 35%
			height 10px
	


//------ Animation  ------//
@keyframes floating {
 0% {
	 transform:rotate(-20deg) translateY(5px);
 }
 50% {
	 transform:rotate(-20deg) translateY(15px);
 }
 100% {
	 transform:rotate(-20deg) translateY(5px);
 }
}

@keyframes floating-shadow {
 0% {
	 transform:scaleX(0.75);
 }
 50% {
	 transform:scaleX(1);
 }
 100% {
	 transform:scaleX(0.75);
 }
}

@keyframes rainbow {
 0% {
	 background-position:0% 200%;
 }
 100% {
	 background-position:0% 0%;
 }
}
              
            
!

JS

              
                
              
            
!
999px

Console