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

              
                <div class="icons">
	<i class="icon check"></i>
	<i class="icon check big"></i>
	<i class="icon star"></i>
	<i class="icon heart"></i>
	<i class="icon heart big"></i>
</div>

<div class="panel--normal">
	<i class="icon check"></i>
	<strong>체크 아이콘을 사용 중이에요!</strong>
</div>

<div class="panel--red">
	<i class="icon check"></i>
	<strong>이렇게 아이콘에 다른 색상을 쓸 수도 있어요.</strong>
</div>

<div class="panel--yellow">
	<i class="icon check"></i>
	<strong>변수로 선언한 곳에 색상코드만 다르게 줍니다.</strong>
</div>

<div class="panel--blue">
	<i class="icon check"></i>
	<strong>색상 변경 예제</strong>
</div>


<div class="panel--normal">
	<i class="icon star"></i>
	<strong>아니면 다른 아이콘을 쓸 수도 있어요.</strong>
</div>

<div class="panel--normal">
	<i class="icon heart"></i>
	<strong>아이콘 사용 예제</strong>
</div>

<div class="panel--red">
	<i class="icon heart"></i>
	<strong>아이콘 사용 예제</strong>
</div>
              
            
!

CSS

              
                @function icon($iconName, $color:555555) {
	$iconList: ( 
		check: "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 477.867 477.867'%3E%3Cpath fill='%23#{$color}' d='M238.933 0C106.974 0 0 106.974 0 238.933s106.974 238.933 238.933 238.933 238.933-106.974 238.933-238.933C477.726 107.033 370.834.141 238.933 0zm0 443.733c-113.108 0-204.8-91.692-204.8-204.8s91.692-204.8 204.8-204.8 204.8 91.692 204.8 204.8c-.122 113.058-91.742 204.678-204.8 204.8z'/%3E%3Cpath fill='%23#{$color}' d='M370.046 141.534c-6.614-6.388-17.099-6.388-23.712 0l-158.601 158.6-56.201-56.201c-6.548-6.78-17.353-6.967-24.132-.419-6.78 6.548-6.967 17.353-.419 24.132.137.142.277.282.419.419l68.267 68.267c6.664 6.663 17.468 6.663 24.132 0l170.667-170.667c6.548-6.779 6.36-17.583-.42-24.131z'/%3E%3C/svg%3E",
		star: "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 71.7 71.7'%3E%3Cpath d='M35.8 7.3l9.3 18.8 20.7 3-15 14.6 3.5 20.6-18.5-9.7-18.5 9.7 3.5-20.6-15-14.6 20.7-3 9.3-18.8z' fill='%23#{$color}'/%3E%3C/svg%3E",
		heart: "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M474.644 74.27C449.391 45.616 414.358 29.836 376 29.836c-53.948 0-88.103 32.22-107.255 59.25-4.969 7.014-9.196 14.047-12.745 20.665-3.549-6.618-7.775-13.651-12.745-20.665-19.152-27.03-53.307-59.25-107.255-59.25-38.358 0-73.391 15.781-98.645 44.435C13.267 101.605 0 138.213 0 177.351c0 42.603 16.633 82.228 52.345 124.7 31.917 37.96 77.834 77.088 131.005 122.397 19.813 16.884 40.302 34.344 62.115 53.429l.655.574c2.828 2.476 6.354 3.713 9.88 3.713s7.052-1.238 9.88-3.713l.655-.574c21.813-19.085 42.302-36.544 62.118-53.431 53.168-45.306 99.085-84.434 131.002-122.395C495.367 259.578 512 219.954 512 177.351c0-39.138-13.267-75.746-37.356-103.081zM309.193 401.614c-17.08 14.554-34.658 29.533-53.193 45.646-18.534-16.111-36.113-31.091-53.196-45.648C98.745 312.939 30 254.358 30 177.351c0-31.83 10.605-61.394 29.862-83.245C79.34 72.007 106.379 59.836 136 59.836c41.129 0 67.716 25.338 82.776 46.594 13.509 19.064 20.558 38.282 22.962 45.659a15 15 0 0028.524 0c2.404-7.377 9.453-26.595 22.962-45.66 15.06-21.255 41.647-46.593 82.776-46.593 29.621 0 56.66 12.171 76.137 34.27C471.395 115.957 482 145.521 482 177.351c0 77.007-68.745 135.588-172.807 224.263z' fill='%23#{$color}'/%3E%3C/svg%3E"
	);
  $icon: map-get($iconList, $iconName);
  @return url("data:image/svg+xml;charset=utf8,#{$icon}");
}

.icon {
	display: inline-block;
	width: 30px;
	height: 30px;
	
	&.check {
		background-image: icon(check);
	}
	
	&.star {
		background-image: icon(star);
	}

	&.heart {
		background-image: icon(heart);
	}
	
	&.big {
		width: 60px;
		height: 60px;
	}
}

.panel--red .check {
	background-image: icon(check, 'ea3333');
}

.panel--yellow .check {
	background-image: icon(check, 'ad5800');
}

.panel--blue .check {
	background-image: icon(check, '1e34dc');
}

.panel--red .heart {
	background-image: icon(heart, 'ea3333');
}




// Check & Heart Icon from Flaticon (https://www.flaticon.com/)



// ----- STYLE

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR&display=swap');

* {
	margin: 0;
	padding: 0;
	font-family: 'Noto Sans KR', sans-serif;
	box-sizing: border-box;
}

body {
	margin: 30px 0;
}

.icons {
	width: 50%;
	margin: 0 auto 50px;
	padding: 20px;
	border: 1px solid #333;
}


%panel {
	width: 80%;
	margin: 10px auto;
	padding: 20px;
	color: #555;
	border: 1px solid #999;
	border-radius: 10px;
	
	i {
		margin-right: 10px;
		vertical-align: middle;
	}
	
	strong {
		display: inline-block;
		font-size: 16px;
		letter-spacing: -.05rem;
		vertical-align: middle;
	}
}

[class^=panel] {
		@extend %panel;
}

.panel {
	&--red {
		color: #ea0000;
		background-color: #ffeaea;
		border-color: #ff5050;
	}

	&--yellow {
		color: #ab6d1f;
		background-color: #ffffe7;
		border-color: #c18600;
	}

	&--blue {
		color: #1e34dc;
    background-color: #eaf3ff;
    border-color: #001b7d;
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console