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 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="text-center">
<h1>Ultimate arrow mixin (sass)</h1>
  <pre class="use-spec">@include arrow($side, $align, $size, $color, $borderColor, $borderSize);</pre>
  <p>Note: You need to add a position attribute (other than static/inherited) to the element you want a arrow on, in order to position the arrow correctly.</p>
<div class="gist-group">
<script src=""></script>
<div class="box-group text-center">
<div class="box arrow-top-left"><span>top, left</span></div>
<div class="box arrow-top-center"><span>top, center</span></div>
<div class="box arrow-top-right"><span>top, right</span></div>
<div class="box-with-border arrow-top-left"><span>top, left, border</span></div>
<div class="box-with-border arrow-top-center"><span>top, center, border</span></div>
<div class="box-with-border arrow-top-right"><span>top, right, border</span></div>
<div class="box arrow-bottom-left"><span>bottom, left</span></div>
<div class="box arrow-bottom-center"><span>bottom, center</span></div>
<div class="box arrow-bottom-right"><span>bottom, right</span></div>
<div class="box-with-border arrow-bottom-left"><span>bottom, left, border</span></div>
<div class="box-with-border arrow-bottom-center"><span>bottom, center, border</span></div>
<div class="box-with-border arrow-bottom-right"><span>bottom, right, border</span></div>
<div class="box arrow-left-top"><span>left, top</span></div>
<div class="box arrow-left-center"><span>left, center</span></div>
<div class="box arrow-left-bottom"><span>left, bottom</span></div>
<div class="box-with-border arrow-left-top"><span>left, top, border</span></div>
<div class="box-with-border arrow-left-center"><span>left, center, border</span></div>
<div class="box-with-border arrow-left-bottom"><span>left, bottom, border</span></div>
<div class="box arrow-right-top"><span>right, top</span></div>
<div class="box arrow-right-center"><span>right, center</span></div>
<div class="box arrow-right-bottom"><span>right, bottom</span></div>
<div class="box-with-border arrow-right-top"><span>right, top, border</span></div>
<div class="box-with-border arrow-right-center"><span>right, center, border</span></div>
<div class="box-with-border arrow-right-bottom"><span>right, bottom, border</span></div>



@mixin arrow_helper($arrowSize, $arrowColor, $margin, $side, $align) {
  @if $side == "top" {
    border-bottom-color: $arrowColor;
    top: -2 * $arrowSize;
  @if $side == "bottom" {
    border-top-color: $arrowColor;
    bottom: -2 * $arrowSize;
  @if $side == "left" {
    border-right-color: $arrowColor;
    left: -2 * $arrowSize;
  @if $side == "right" {
    border-left-color: $arrowColor;
    right: -2 * $arrowSize;
  @if $side == "right" or $side == "left" {
    @if $align == "center" {
      top: 50%;
      margin-top: -$arrowSize;
    @else if $align == "top" {
      top: $margin;
    @else if $align == "bottom" {
      bottom: $margin;
  @if $side == "bottom" or $side == "top" {
    @if $align == "center" {
      right: 50%;
      margin-right: -$arrowSize;
    @else if $align == "left" {
      left: $margin;
    @else if $align == "right" {
      right: $margin;

@mixin arrow($side: "right", $align: "center", $size: 20px, $color: #f6f6f6, $borderColor: "none", $borderSize: 3px) {
  $selector: "&:after, &:before";
  @if $borderColor == "none" {
    $selector: "&:after";
  #{$selector} {
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    visibility: visible;
  &:after {
    border-width: $size;
    @include arrow_helper($size, $color, $size, $side, $align);
  @if $borderColor != "none" {
    &:before {
      border-width: $borderSize + $size;
      @include arrow_helper($size + $borderSize, $borderColor, $size - $borderSize, $side, $align);

.box {
  &.arrow-top-left {@include arrow('top','left', 10px, #4fade3)}
  &.arrow-top-right {@include arrow('top','right', 10px, #4fade3)}
  &.arrow-top-center {@include arrow('top','center', 10px, #4fade3)}
  &.arrow-bottom-left {@include arrow('bottom','left', 10px, #4fade3)}
  &.arrow-bottom-right {@include arrow('bottom','right', 10px, #4fade3)}
  &.arrow-bottom-center {@include arrow('bottom','center', 10px, #4fade3)}
  &.arrow-left-top {@include arrow('left','top', 10px, #4fade3)}
  &.arrow-left-center {@include arrow('left','center', 10px, #4fade3)}
  &.arrow-left-bottom {@include arrow('left','bottom', 10px, #4fade3)}
  &.arrow-right-top {@include arrow('right','top', 10px, #4fade3)}
  &.arrow-right-center {@include arrow('right','center', 10px, #4fade3)}
  &.arrow-right-bottom {@include arrow('right','bottom', 10px, #4fade3)}

.box-with-border {
  &.arrow-top-left {@include arrow('top','left', 10px, #eee, #4fade3, 6px)}
  &.arrow-top-right {@include arrow('top','right', 10px, #eee, #4fade3, 6px)}
  &.arrow-top-center {@include arrow('top','center', 10px, #eee, #4fade3, 6px)}
  &.arrow-bottom-left {@include arrow('bottom','left', 10px, #eee, #4fade3, 6px)}
  &.arrow-bottom-right {@include arrow('bottom','right', 10px, #eee, #4fade3, 6px)}
  &.arrow-bottom-center {@include arrow('bottom','center', 10px, #eee, #4fade3, 6px)}
  &.arrow-left-top {@include arrow('left','top', 10px, #eee, #4fade3, 6px)}
  &.arrow-left-center {@include arrow('left','center', 10px, #eee, #4fade3, 6px)}
  &.arrow-left-bottom {@include arrow('left','bottom', 10px, #eee, #4fade3, 6px)}
  &.arrow-right-top {@include arrow('right','top', 10px, #eee, #4fade3, 6px)}
  &.arrow-right-center {@include arrow('right','center', 10px, #eee, #4fade3, 6px)}
  &.arrow-right-bottom {@include arrow('right','bottom', 10px, #eee, #4fade3, 6px)}

 Css for demo
*, *:before, *:after {
  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
body {
  font-family: 'Helvetica neue';
  padding: 24px;

.box-with-border, .box {
  width: 28%;
  height: 100px;
  background: #4fade3;
  margin: 24px;
  span {
    color: #f1f1f1;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 100%;
    left: 0;
    font-size: 18px;

.box-with-border {
  border: 4px solid #4fade3;
  background: #eee;
  span {
    color: #4fade3;

.use-spec {
  background: #f1f1f1;
  padding: 6px 12px;
  font-size: 16px;
  border-radius: 3px;
  margin: 0 auto;

.gist-group, .box-group {
  vertical-align: top;

.gist-group {width: 40%;}
.box-group {width: 59%;}