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
              
            
!

CSS

              
                $yellow = #fcd000
$blue = #0ebeff
$green = #47cf73
$purple = #ae63e4
$black = #28282b
$white = #cccccc
.container
	height 100vh
	background-color #111
	width 100vw
	display flex
	align-items center
	justify-content center
	flex-wrap wrap
	.card
		width 400px
		height 300px
		background-color $black
		color #fff
		box-sizing border-box
		padding 40px
		border-radius 2px
		font-family Roboto, sans-serif
		margin 15px 15px
		h2
			margin 0
		.line
			width 320px
			height 5px
			margin-top 10px
		p
			margin-top 15px
			font-size 15px
			line-height 1.6
			color $white
              
            
!

JS

              
                class Card extends React.Component {
	render() {
		return(
			<div className="card">
				<h2>{this.props.title}</h2>
				<div className="line" style={{backgroundColor: this.props.bgc}}></div>
				<p>{this.props.content}</p>
			</div>
		)
	}
}

class Link extends React.Component {
	render() {
		return(
			<a href={this.props.href}>{this.props.text}</a>
		)
	}
}

class App extends React.Component {
	constructor() {
		super()
		this.state = {
			yellow: '#fcd000',
			blue: '#0ebeff',
			green: '#47cf73',
			purple: '#ae63e4'
		}
	}
	render() {
		return(
			<div className="container">
				<Card title="Title One" bgc={this.state.yellow} content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus officiis neque, eveniet ab, autem dolore saepe voluptate praesentium sapiente debitis, facere assumenda optio hic! Recusandae, libero. Laudantium ipsum cumque dolores!"/>
				<Card title="Title Two" bgc={this.state.blue} content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus officiis neque, eveniet ab, autem dolore saepe voluptate praesentium sapiente debitis, facere assumenda optio hic! Recusandae, libero. Laudantium ipsum cumque dolores!"/>
				<Card title="Title Three" bgc={this.state.green} content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus officiis neque, eveniet ab, autem dolore saepe voluptate praesentium sapiente debitis, facere assumenda optio hic! Recusandae, libero. Laudantium ipsum cumque dolores!"/>
				<Card title="Title Four" bgc={this.state.purple} content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus officiis neque, eveniet ab, autem dolore saepe voluptate praesentium sapiente debitis, facere assumenda optio hic! Recusandae, libero. Laudantium ipsum cumque dolores!"/>
			</div>
		)
	}
}

ReactDOM.render(
	<App/>,
	document.getElementById('app')
)
              
            
!
999px

Console