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 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

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

              
                #app
	dialog(btn-text-confirm="Yes" btn-text-cancel="No") Are you sure?
	
template#dialog-template
	.dialog(v-show="active")
		.dialog__overlay(@click = close)
		.dialog__content
			.dialog__body 
				slot
			.dialog__footer
				button.btn(@click="onCancel()") {{btnTextCancel}}
				button.btn.btn-ok(@click="onConfirm()") {{btnTextConfirm}}
	a.link(href="#" @click="open") Click me!
              
            
!

CSS

              
                gray-color = #F7F7F7
purple-color = #5856D6
blue-color = #007AFF

*
	font-family '-apple-system', sans-serif
	font-size 16px
	margin 0
	padding 0
	box-sizing border-box
	
button
	padding 5px


.link
	font-size 20px
	text-decoration none
	position absolute
	color blue-color
	top 50%
	right 50%
	margin-right -30px
	
.dialog__content
	position: fixed
	z-index: 13
	top: 50%
	left: 50%
	transform: translate(-50%, -50%)
	background-color: white
	text-align: center
	border-radius: 2px
	width: 70%
	max-width: 250px
	border-radius 5px
	
.dialog__footer
	display flex
	
.dialog__body 
	padding 20px 0

.dialog__overlay
	position: fixed
	z-index 1
	width: 100%
	height: 100%
	top: 0
	left: 0
	background: rgba(0, 0, 0, 0.6)
	
.btn
	width 50%
	padding 10px
	background white
	border 1px solid gray-color
	color blue-color
	border-bottom none
	border-radius 5px
	cursor pointer
	
              
            
!

JS

              
                Vue.component('dialog', {
	template: '#dialog-template',
	data: function() {
		return {
			active: false
		}
	},
	props: ['btnTextCancel', 'btnTextConfirm' ],
	methods: {
	 	open: function() {
			this.active = true
		},
		close: function() {
			this.active = false
		},
		onCancel: function() {
			this.close();
		},
		onConfirm: function() {
			this.close();
		}
	}
})

new Vue ({
	el: '#app',
	data: {
		active: false
	}
})
              
            
!
999px

Console