Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

			.poll-question Will Poland win the footboal match?
				.btn.poll-panel-btn(aria-role='button' data-result=0 data-vote=0) 
					span Yes
				.btn.poll-panel-btn(aria-role='button' data-result=0 data-vote=1) 
					span No
	box-sizing: border-box

$font-headline: 'Poppins', sans-serif
$font-context: 'Roboto', sans-serif

	background: #1b1b1b
	margin: 0

	position: absolute
	top: 50%
	left: 50%
	transform: translate(-50%, -50%)

	margin: 30px 0 0 0
.row, .column
	display: flex
	flex-direction: row
	flex-direction: column
	cursor: pointer

		background: linear-gradient(#803af7, #500cc4)
		border-radius: 3px
		box-shadow: 0px 5px 11px -7px #000
		text-align: center
		padding: 25px 30px
		position: relative
		width: max-content 
		max-width: 700px
		color: #FFF
		font-family: $font-headline
		overflow: hidden
		border-radius: 50px
				background: #FFF
				color: #000
					color: #000
					background: #FFF
				background: #676464
				color: #FFF
				border-radius: 0
				margin: 0
				border: 0
				position: relative
					color: #FFF
					background: #676464
					content: attr(data-result)
					font-size: 9px
					display: block
					opacity: 0.5
					animation: slideWithFade .2s ease
					transform: inherit
					display: block
		width: 100%
			padding: 7px 10px
			font-family: $font-context
			font-size: .7rem
			width: 100%
			border-radius: 50px
			border: 1px solid #FFF
			margin: 0 20px
			color: #FFF
			transition: .15s cubic-bezier(.17,.67,.79,1.24)
				background: #FFF
				color: #000
				transform: scale(.95)
@keyframes slideWithFade
		opacity: 0
		transform: translateY(10px)
		opacity: 1
              // Plugin:

const q1 = new poll("Will Poland win the footboal match?", {
	0: { title: "Yes" },
	1: { title: "No" }

// Add some randome votes
for(let i = 0; i<20; i++) { * (1 - 0 + 1)) + 0);

// Poll interface script
let pollButtons = document.querySelectorAll('.poll-panel-btn'),
		pollPanel = document.querySelector('.poll-panel');
pollButtons.forEach(button => {
	button.onclick = () => {
		if (button.getAttribute('disabled') != 'disabled') {;
			pollButtons.forEach(b => {
				b.setAttribute('disabled', 'disabled');
				let percent = q1.results[].percent + '%'; = percent;
				b.dataset.result = percent;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.