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

              
                <html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Blue Crayon</title>
  </head>
  <body>
    <main>
      <div class="container">
        <div class="rectangle"></div>
      </div>
    </main>
  </body>
</html>
              
            
!

CSS

              
                $black-30: rgba(0, 0, 0, 0.3);
$lg-test: linear-gradient(#2980B9, #2ECC71);
$blu: #2980B9;
$crayon-ends: #21618C;
$bluTwo: #1F618D;
$crayon-tip: #154360;

$ellipse: radial-gradient(ellipse at top, #000 78px, transparent 83px);

$stripes: linear-gradient(to right, 
  transparent 40px, 
  #000 40px, #000 47px, 
  transparent 47px, transparent 54px, 
  #000 54px, #000 61px, 
  transparent 61px, transparent 283px, 
  #000 285px, #000 292px, 
  transparent 292px, transparent 300px,
  #000 300px, #000 307px, 
  transparent 307px);

$wrapper: linear-gradient(to right, 
  transparent 18px, 
  $blu 18px, 
  $blu 328px, 
  transparent 328px);

$body-shading: linear-gradient(to bottom, 
  transparent 70%, 
  $black-30 100%);

@mixin create-triangle($t, $r, $b, $l, $x: 0, $y: 0) {
  border-top: $t;
  border-right: $r;
  border-bottom: $b;
  border-left: $l;
  width: $x;
  height: $y;
}

body {
  height: 100vh;
  margin: 0 auto 0 auto;
  padding: 0;
  background: #e7a61a;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  .container {
    display: flex;
    .rectangle {
      width: 350px;
      height: 56px;
      border-radius: 0.2rem;
      background: #154360;
      background-image: $ellipse, $stripes, $wrapper, $body-shading;
      box-shadow: 2px 2px 3px #333;
    }
    /* Creating the triangle with psuedo element :before */
    .rectangle:before {
      content: ""; // must include content property even if its empty or psuedo classes wont show up on the DOM tree 
      position: relative;
      top: 1.2rem;
      right: 3.78rem;
      @include create-triangle(17px solid transparent, 60.5px solid $crayon-tip, 17px solid transparent, 0);
      background-image: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0px,
        rgba(255, 255, 255, 0.2) 8px,
        rgba(255, 255, 255, 0.2) 10px,
        rgba(255, 255, 255, 0) 16px);
    }
    .rectangle:after {
      content: "blue";
      display: flex;
      position: relative;
      justify-content: flex-end;
      align-items: center;
      padding-top: 0.48rem;
      padding-right: 5rem;
      right: 17.2%;
      width: 94.62%;
      font-size: 1.25rem;
      background-image: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0px,
        rgba(255, 255, 255, 0.2) 8px,
        rgba(255, 255, 255, 0.2) 10px,
        rgba(255, 255, 255, 0) 16px);
    } 
  }
}

@media only screen and (max-width: 520px) {
  .container {
    padding-left: 3rem;
  }
}

@media only screen and (max-width: 450px) {
    .rectangle {
      margin-left: auto;
      margin-right: auto;
      height: 56px;
      border-radius: 0.2rem;
      background: #154360;
      background-image: $ellipse, $stripes, $wrapper, $body-shading;
      box-shadow: 2px 2px 3px #333;
    }
    /* Creating the triangle with psuedo element :before */
    .rectangle:before {
      content: ""; // must include content property even if its empty or psuedo classes wont show up on the DOM tree 
      position: relative;
      top: 1.2rem;
      right: 3.1rem !important;
      @include create-triangle(17px solid transparent, 51px solid $crayon-tip !important, 15px solid transparent !important, 0);
      background-image: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0px,
        rgba(255, 255, 255, 0.2) 8px,
        rgba(255, 255, 255, 0.2) 10px,
        rgba(255, 255, 255, 0) 16px);
    }
    .rectangle:after {
      content: "blue";
      display: flex;
      position: relative;
      justify-content: flex-end;
      align-items: center;
      padding-top: 0.48rem;
      padding-right: 5rem;
      right: 14.4% !important;
      width: 91.6% !important;
      font-size: 1.25rem;
      background-image: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0px,
        rgba(255, 255, 255, 0.2) 8px,
        rgba(255, 255, 255, 0.2) 10px,
        rgba(255, 255, 255, 0) 16px);
    } 
}

              
            
!

JS

              
                
              
            
!
999px

Console