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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <div class="wrapper">
	<div class="btn">Click Me 1</div>
	<div class="btn">Click Me 2</div>
	<div class="btn">Click Me 3</div>
	<div class="btn">Click Me 4</div>
	<div class="btn">Click Me 5</div>
	<div class="btn">Click Me 6</div>
	<div class="btn">Click Me 7</div>
	<div class="btn">Click Me 8</div>
	<div class="btn">Click Me 9</div>
	<div class="btn">Click Me 10</div>
	<div class="btn">Click Me 11</div>
	<div class="btn">Click Me 12</div>
	<div class="btn">Click Me 13</div>
	<div class="btn">Click Me 14</div>
	<div class="btn">Click Me 15</div>
	<div class="btn">Click Me 16</div>
	<div class="btn">Click Me 17</div>
	<div class="btn">Click Me 18</div>
	<div class="btn">Click Me 19</div>
	<div class="btn">Click Me 20</div>
	<div class="btn">Click Me 21</div>
	<div class="btn">Click Me 22</div>
	<div class="btn">Click Me 23</div>
	<div class="btn">Click Me 24</div>
	<div class="btn">Click Me 25</div>
	<div class="btn">Click Me 26</div>
	<div class="btn">Click Me 27</div>
	<div class="btn">Click Me 28</div>
	<div class="btn">Click Me 29</div>
	<div class="btn">Click Me 30</div>

<button class="decorate">Convert to </br>pseudo-buttons</button>


                * {
	box-sizing: border-box;

body {
	margin: 0;
	background-color: #545454;
	font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Tahoma, Roboto, Oxygen, Ubuntu, Cantarell,
        "Fira Sans", "Open Sans", sans-serif;

.wrapper {
	max-width: 1200px;
	width: 80%;
	margin: 0 auto;

.btn {
	font-size: 1em;
	color: #dcdcdc;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	min-height: 45px;
	padding: 0 10px;
	border-radius: 2px;
	border: 1px solid #b5b5b5;
	background-color: #616161;
	margin: 2px;
	&:focus {
		border: 1px solid white;
		outline: 0;
	&[aria-pressed="true"] {
		background-color: #e4e4e4;
		color: #137a5a;

.decorate {
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	height: 50px;
	font-size: 1em;
	width: 200px;


                // Are the btns decorated of not
let decorated = false;

// Grab the button to decorate
var decorate = document.querySelector("button.decorate");
// Grab wrapper
var wrapper = document.querySelector(".wrapper");

// Handle action on the decorate btn
decorate.addEventListener("click", e => {

function decorateBtns() {
	if (decorated) {
	// Grab btns
	let btns = document.querySelectorAll(".btn");
	// decorate them
	btns.forEach((btn, idx) => {
		btn.setAttribute("role", "button");
		btn.setAttribute("aria-pressed", "false");
		btn.setAttribute("tabindex", "0");
	// You don't get keyboard handler by default on converted btns:
	wrapper.addEventListener("keydown", e => {
			if (e.key === " " || e.key === "Enter" || e.key === "Spacebar") {
	decorated = true;

function toggleBtn(ele) {
		ele.getAttribute("aria-pressed") === "true" ? "false" : "true"