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


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


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.


                <h1><a href="">vue-bem-cn</a> - Simple <a href="">BEM</a> class name generator for Vue.JS</h1>

<div id="mount"></div>

<template id="app">
	<div class="app">

		<div>Live component:</div>
		<div class="example" ref="source">
				I am BEM button!


		<html-tree :code="source">

<template id="ui-button">
	<button :class="b({ size, look })" :type="type">
    <span :class="b('text', { look })">
      <i v-if="icon" :class="b('icon', { icon })">👍</i>

<template id="html-tree">
	<div :class="b()">
		<div :class="b('title')">HTML Tree:</div>
		<div :class="b('content', 'gnr-tree')" v-html="showTree"></div>


                .ui-button {
	display: inline-block;
	font-weight: 400;
	line-height: 1.25;
	text-align: center;
	vertical-align: middle;
	padding: .5rem 1rem;
	font-size: 1rem;
	border: 1px solid transparent;
	border-radius: .25rem;

.ui-button--look-primary {
	background-color: #0275d8;
	border-color: #0275d8;

.ui-button--size-large {
	padding: .75rem 1.5rem;
	border-radius: .3rem;

.ui-button__text--look-primary {
	color: #fff;

.ui-button__icon {
	padding-right: 5px; 

.ui-button__icon--icon-emoji {
	text-shadow: 1px 1px 0px #555;

.mix-any-class {
	box-shadow: 0 2px 2px grey;

/* dev styles */
.html-tree {
	margin-top: 20px;
h1 {
	font-size: 1.5rem;
	border-bottom: 1px solid gray;

body { 
	font: 14px/1.5 Trebuchet MS, sans-serif; 


                Vue.component('app', {
	template: '#app',
	data() {
		return {
			source: '',
	mounted() {
		this.source = this.$refs.source.outerHTML;

Vue.component('ui-button', {
	template: '#ui-button',
	props: ['size', 'look', 'type', 'icon'],

Vue.component('html-tree', {
	template: '#html-tree',
	props: ['code'],
	computed: {
		showTree() {
			// thx @yoksel_en for html-tree (
			return createTreeFromHTML(this.code);


new Vue({
	el: '#mount',
	render: (h) => h('app'),