Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                .bubbleTea
	.cup
		.bubble
		.tag Bubble<br>Milk Tea
		.straw
              
            
!

CSS

              
                *
	font-size: calc(1vmin * 5)


.bubbleTea
	position: absolute
	top: 50%
	left: 50%
	transform: translate(-50%, -50%)
	width: 100vw
	height: 100vh
	background: #c8e2e7

	//杯子
	.cup
		position: absolute
		top: calc(50% + 1.8rem)
		left: 50%
		transform: translate(-50%, -50%) perspective(2em) rotateX(-5deg)
		width: 6rem
		height: 7rem
		border-radius: 0 0 2rem 2rem
		background: linear-gradient(319deg, rgba(241,199,171,1) 0%, rgba(252,227,209,1) 62%, rgba(242,200,173,1) 100%)
		box-shadow: 0 0.2rem 0 0.2rem #f6f6f8
		&::before
			content: ''
			position: absolute
			top: -0.4rem
			left: 50%
			transform: translateX( -50%)
			width: 6.4rem
			height: 0.8rem
			border-radius: 50%
			background: #5d3e2a
			box-shadow: 0 0.1rem 0 0 #f6f6f8
		&:after
			content: ''
			position: absolute
			bottom: -0.4rem
			left: 1rem
			width: 1rem
			height: 6.55rem
			transform: perspective(1.8em) rotateX(-4deg)
			background: #f6f6f8
			filter: blur(0.02rem)
			opacity: 0.4
	
		//珍珠
		.bubble
			position: absolute
			top: 0
			left: 0
			width: 1rem
			height: 1rem
			border-radius: 50%
			box-shadow: 0.6rem 5rem 0 0 #7b523a, 1.8rem 5.6rem 0 0 #7b523a, 2.4rem 4.6rem 0 0 #7b523a, 4rem 5.2rem 0 0 #7b523a, 4.6rem 4.2rem 0 0 #7b523a
			&:before
				content: ''
				position: absolute
				top: 0
				left: 0
				width: 1rem
				height: 1rem
				border-radius: 50%
				box-shadow: 0.2rem 4.6rem 0 0 #9c6545, 1rem 5.6rem 0 0 #9c6545, 1.4rem 4.4rem 0 0 #9c6545, 3rem 5.6rem 0 0 #9c6545, 3.4rem 4.2rem 0 0 #9c6545, 2.6rem 4.8rem 0 0 #9c6545, 4.6rem 5.2rem 0 0 #9c6545
		
		//杯子上的標籤
		.tag
			position: absolute
			top: 1.8rem
			left: 50%
			transform: translateX(-50%)
			width: 3rem
			height: 3rem
			padding-top: 0.6rem
			border: 0.2rem solid #6b4b3c
			border-radius: 50%
			font-size: 0.6rem
			font-family: 'Raleway', sans-serif
			text-align: center
			line-height: 0.6rem
			box-sizing: border-box
			opacity: 0.8
			
	
	//吸管
	.straw
		position: absolute
		top: -2rem
		left: 50%
		transform: translateX(-50%) perspective(2em) rotateX(5deg) rotate(4deg)
		width: 0.8rem
		height: 2rem
		background: linear-gradient(90deg, rgba(124,82,58,1) 30%, rgba(187,132,100,1) 80%, rgba(124,82,58,1) 95%)
              
            
!

JS

              
                
              
            
!
999px

Console