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 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

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

              
                #helpful-btn-wrap
	button#helpful-btn.helpful-btn(type="button")
		#helpful-btn-icon
			svg(xmlns="http://www.w3.org/2000/svg" width="68.41" height="68.41" viewbox="0 0 68.41 68.41")
				path#helpful-star(d="M25.09 51.54a3.44 3.44 0 0 1-2-.64 3.38 3.38 0 0 1-1.33-3.3l1.44-8.4-6.11-6A3.36 3.36 0 0 1 19 27.51l8.45-1.23 3.77-7.65a3.46 3.46 0 0 1 6 0L41 26.28l8.45 1.23a3.36 3.36 0 0 1 1.86 5.73l-6.11 6 1.44 8.4a3.37 3.37 0 0 1-1.33 3.29 3.42 3.42 0 0 1-3.54.26l-7.55-4-7.56 4a3.4 3.4 0 0 1-1.57.35z" fill="#FFFFFF" stroke="#00baff" stroke-width="2")
		#helpful-btn-text.helpful-btn-text 有幫助!
	.helpful-count-wrap
		#helpful-count 11
		
		

.info
	a(href="https://letswrite.tw/helpful-btn/", target="_blank") helpful button 開發文章
              
            
!

CSS

              
                $main: #00BAFF
$main-hover: #008BBF

.opacity-0
	opacity: 0

#helpful-btn-wrap
	display: flex
	align-items: center
	margin-bottom: 8px
	border: none

.helpful-btn
	display: flex
	align-items: center
	padding: 0 6px
	background-color: #fff
	border: 1px solid $main
	border-radius: 8px
	cursor: pointer
	outline: none
	&:hover
		background-color: $main
		.helpful-btn-text
			color: #fff
	&:active, &.active
		background-color: $main-hover
		border-color: $main-hover
		.helpful-btn-text
			color: #fff
		path
			stroke: $main-hover
		svg
			transform: rotate(180deg)
  
#helpful-btn-icon
	position: relative
	top: 1px
	svg
		width: 28px
		height: 28px
		transition: transform .2s ease

.helpful-btn-text
	padding-left: 4px
	line-height: 28px
	height: 28px
	font-size: 14px
	color: $main



.helpful-count-wrap
	position: relative
	margin-left: 16px
	padding: 2px 10px
	border: 1px solid #ccc
	border-radius: 8px
	font-size: 14px
	color: #a1a1a1
	transition: opacity .2s ease
	&::before, &::after
		content: ''
		position: absolute
		top: 50%
		width: 0
		height: 0
		border-style: solid
		transform: translateY(-50%)
	&::before
		left: -9px
		border-width: 5.5px 9px 5.5px 0
		border-color: transparent #a1a1a1 transparent transparent
	&::after
		left: -8px
		border-width: 5px 8px 5px 0
		border-color: transparent #ffffff transparent transparent



// body, .info sass make button absolute center, when use this pen, they should be deleted.
body
	display: flex
	justify-content: center
	align-items: center
	height: 100vh

.info
	position: fixed
	right: 0
	left: 0
	bottom: 0
	padding: 8px 0
	text-align: center
	a
		color: #00A7E5
		&:hover
			text-decoration: none
              
            
!

JS

              
                
              
            
!
999px

Console